Builds and navigates Amazon Web Services S3 URIs
Project description
Slash3
Slash3 is a Python package for building and navigating Amazon Web Services S3 URIs.
Examples
To construct an S3 URI from its component parts:
from slash3 import S3Uri
S3Uri.to_uri("circus", "images/clowns.jpg") # s3://circus/images/clowns.jpg
To join to a key:
from slash3 import S3Uri
images = S3Uri("s3://circus/") / "images" # s3://circus/images
clowns = images / "clowns.jpg" # s3://circus/images/clowns.jpg
To append to a key:
from slash3 import S3Uri
staff = S3Uri("s3://circus/") / "staff-" # s3://circus/staff-
steve = staff + "steve.jpg" # s3://circus/staff-steve.jpg
penny = staff + "penny.jpg" # s3://circus/staff-penny.jpg
To navigate to a parent path:
from slash3 import S3Uri
steve = S3Uri("s3://circus/images/steve.jpg")
images = steve.parent # s3://circus/images/
To discover a relative path:
from slash3 import S3Uri
steve = S3Uri("s3://circus/images/staff/steve.jpg")
relative = steve.relative_to("s3://circus/images/") # staff/steve.jpg
Logging
Slash3 respects your root logger configuration. To configure the package's logger directly, get the logger named "slash3".
Support
Please submit all your questions, feature requests and bug reports at github.com/cariad/slash3/issues. Thank you!
Licence
Slash3 is open-source and published under the MIT License.
You don't have to give attribution in your project, but -- as a freelance developer with rent to pay -- I appreciate it!
The Author
Hello! 👋 I'm Cariad Eccleston, and I'm a freelance Amazon Web Services architect, DevOps evangelist, CI/CD deployer and backend developer.
You can find me at cariad.earth, github/cariad, linkedin/cariad and on Mastodon at @cariad@tech.lgbt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.