Skip to main content
https://img.shields.io/pypi/v/uriutils.svg https://readthedocs.org/projects/uriutils/badge/?version=latest

Working with multiple storage platforms (i.e., local filesystem, S3, Google Cloud, etc.) can be quite a hassle. This package aims to make it transparent to the user and the developer the underlying storage system by wrapping the different protocols in a common interface.

Documentation available at http://uriutils.readthedocs.io/

Usage

Example:

with uri_open('http://www.example.com', mode='r') as f:
    contents = f.read()

Example with argument parser:

parser = ArgumentParser(description='Read text file from URI.')
parser.add_argument('-i', '--input', type=URIFileType('r'), metavar='<input>', help='Input file URI.')
A = parser.parse_args()

contents = A.input.read()
print(contents)

Or, writing to a file with argument parser is as easy as:

parser = ArgumentParser(description='Write text file to URI.')
parser.add_argument('-o', '--output', type=URIFileType('w'), metavar='<output>', help='Output file URI.')
A = parser.parse_args()

A.output.write('Hello world!\n')
A.output.close()

And you can run python uri.py --output s3://example-bucket/output.txt.

For complete documentation, please see uriutils-0.1 documentation.

Contribution

For bugs and issues, please file them on the issues page. Thanks!

Metadata

Release files for uriutils 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uriutils 0.1.16
File Size Uploaded
uriutils-0.1.16.tar.gz 11.5 kB Details

Release files / uriutils-0.1.16.tar.gz

Download URL uriutils-0.1.16.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
91101576c9711de189b16c357b44b2ef4409048aec2f8d0f8daa8c1b3ffb45af
BLAKE2b-256 checksum
How to use checksums
59f715156911c6935dec648be1cbd1c3500360d99fb930650de1196d501b515c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release history Release notifications | RSS feed

This release

0.1.16 This release

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.7

1 release file

0.1.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page