tlcurl.url_adapters.s3_url_adapter
¶
An adapter for resolving reads/writes to URLs starting with s3://
Module Contents¶
Classes¶
Class |
Description |
---|---|
A directory entry for an S3UrlAdapter |
|
An adapter for resolving reads/writes to URLs starting with |
Data¶
Data |
Description |
---|---|
API¶
- logger = getLogger(...)¶
- class S3UrlAdapterDirEntry( )¶
Bases:
tlcurl.url_adapters.fsspec_url_adapter.FSSpecUrlAdapterDirEntry
A directory entry for an S3UrlAdapter
- class S3UrlAdapter¶
Bases:
tlcurl.url_adapters.fsspec_url_adapter.FSSpecUrlAdapter
An adapter for resolving reads/writes to URLs starting with
s3://
- s3_scheme = None¶
- s3_protocol = None¶
- touch(
- url: Url,
Update the last modified timestamp of a file to the current time. Creates the file if it doesn’t exist.
- Parameters:
url – The URL of the file to touch
- read_string_content_from_url(
- url: Url,
Read the content of a file as a string.
This function overrides the FSSpecUrlAdapter base class implementation which uses
read_text()
. We useread_bytes().decode()
instead sinceS3FileSystem.read_text()
makes an unnecessary and expensivehead_object
API call to S3.- Parameters:
url – The URL of the file to read
- Returns:
The content of the file as a string