Skip to main content

Parse and build Amazon S3 URLs

Project description


Parse and build Amazon S3 URLs.


Parse S3 URLs

from s3urls import parse_url

>>> parse_url('')
{'bucket': 'my-bucket', 'key': 'my-key/'}

>>> parse_url('')
{'bucket': 'my-bucket', 'key': 'my-key/'}

>>> parse_url('s3://my-bucket/my-key')
{'bucket': 'my-bucket', 'key': 'my-key/'}

>>> parse_url('s3://user@my-bucket/my-key')
{'bucket': 'my-bucket', 'key': 'my-key/', 'credential_name': 'user'}

Build S3 URLs

from s3urls import build_url

>>> build_url('s3', 'my-bucket', 'my-key/')

>>> build_url('s3', 'my-bucket', 'my-key/', credential_name='user')

>>> build_url('bucket-in-path', 'my-bucket', 'my-key/')

>>> build_url('bucket-in-path', 'my-bucket', 'my-key/', region='eu-west-1')

>>> build_url('bucket-in-netloc', 'my-bucket', 'my-key/')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s3urls-0.0.3.tar.gz (2.3 kB view hashes)

Uploaded source

Built Distribution

s3urls-0.0.3-py3-none-any.whl (2.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page