uproot.source.http.HTTPResource
Defined in uproot.source.http on line 137.
| Inheritance order: | 
|---|
- class uproot.source.http.HTTPResource(file_path, timeout)
- Parameters:
- file_path (str) – A URL of the file to open. 
- timeout (None or float) – An optional timeout in seconds. 
 
 - A uproot.source.chunk.Resource for HTTP(S) connections. - For simplicity, this resource does not manage a live - http.client.HTTPConnectionor- http.client.HTTPSConnection, though in principle, it could.
timeout
- HTTPResource.timeout
- The timeout in seconds or None. 
parsed_url
- HTTPResource.parsed_url
- A - urllib.parse.ParseResultversion of the- file_path.
auth_headers
- HTTPResource.auth_headers
- Returns a dict containing auth headers, if any for this resource 
get
- HTTPResource.get(connection, start: int, stop: int) bytes
- Parameters:
- start (int) – Seek position of the first byte to include. 
- stop (int) – Seek position of the first byte to exclude (one greater than the last byte to include). 
 
 - Returns a Python buffer of data between - startand- stop.
future
- static HTTPResource.future(source: Source, start: int, stop: int)
- Parameters:
- source (uproot.HTTPSource or uproot.MultithreadedHTTPSource) – The data source. 
- start (int) – Seek position of the first byte to include. 
- stop (int) – Seek position of the first byte to exclude (one greater than the last byte to include). 
 
 - Returns a uproot.source.futures.ResourceFuture that calls get with - startand- stop.
multifuture
- static HTTPResource.multifuture(source: Source, range_header: dict, ranges: list[int, int], futures, results)
- Parameters:
- source (uproot.HTTPSource) – The data source. 
- ranges (list of (int, int) 2-tuples) – Intervals to fetch as (start, stop) pairs in a single request, if possible. 
- futures (dict of (int, int) → uproot.source.futures.ResourceFuture) – Mapping from (start, stop) to a future that is awaiting its result. 
- results (dict of (int, int) → None or - numpy.ndarrayof- numpy.uint8) – Mapping from (start, stop) to None or results.
 
 - Returns a uproot.source.futures.ResourceFuture that attempts to perform an HTTP(S) multipart GET, filling - resultsto satisfy the individual uproot.source.chunk.Chunk’s- futureswith its multipart response.- If the server does not support multipart GET, that same future sets fallback and retries the request without multipart, using a uproot.MultithreadedHTTPSource to fill the same - resultsand- futures. Subsequent attempts would immediately use the fallback.
is_multipart_supported
- HTTPResource.is_multipart_supported(ranges: list[int, int], response: HTTPResponse) bool
- Helper function for multifuture to check for multipart GET support. 
handle_no_multipart
- HTTPResource.handle_no_multipart(source: Source, ranges: list[int, int], futures, results)
- Helper function for multifuture to handle a lack of multipart GET support. 
handle_multipart
- HTTPResource.handle_multipart(source: Source, futures, results, response: HTTPResponse, ranges: list[int, int])
- Helper function for multifuture to handle the multipart GET response. 
next_header
- HTTPResource.next_header(response_buffer)
- Helper function for multifuture to return the next header from the - response_buffer.
partfuture
- static HTTPResource.partfuture(results, start: int, stop: int)
- Returns a uproot.source.futures.ResourceFuture to simply select the - (start, stop)item from the- resultsdict.- In chunks, each chunk has a partfuture that are collectively filled by a single multifuture. 
file_path
Inherited from uproot.source.chunk.Resource.
- HTTPResource.file_path
- A path to the file (or URL).