s3urls is a small, dependency-free Python library designed to parse and build Amazon S3 URLs. It provides utility functions to extract bucket names and keys from S3 URIs (e.g., `s3://bucket/key`) and HTTP/HTTPS S3 object URLs, as well as to construct such URLs. The current version is 0.0.3, with its last release in 2018, indicating a stable but infrequently updated project.
pip install s3urlsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `s3urls` to parse various S3 URL formats (S3 URIs and HTTPS URLs) and how to build S3 URLs, including specifying the scheme, region, and style for HTTPS URLs.
Manually validate S3 bucket and object key names against AWS S3 naming rules before using them with `s3urls` if strict adherence is required.
When building URLs, explicitly set `style='virtual-host'` for HTTPS URLs. Review existing code for path-style URLs and migrate to virtual-hosted-style where possible.
Double-check `pip install` commands and `from ... import` statements to confirm you are using `s3urls`.
Ensure the URL strictly follows one of the supported S3 URL formats. Verify that bucket names, keys, regions, schemes, and styles are correctly structured. For specific regional endpoints, manually construct the URL string if `build_s3_url`'s parameters don't cover the exact format.
When `s3urls`'s automatic parsing or building of regional URLs is problematic, explicitly specify the `region` parameter for `build_s3_url`. For complex cases or non-AWS S3-compatible services, consider using `urllib.parse` for basic component extraction or a dedicated AWS SDK (like `boto3`) for more robust, region-aware URL generation and interaction.
No dependency data recorded yet.