Skip to main content
Help us improve Python packaging – donate today!

Easily read and write to different storage platforms in Python.

Project Description

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!

Release history Release notifications

This version
History Node

0.1.15

History Node

0.1.14

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.7

History Node

0.1.6

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
uriutils-0.1.15.tar.gz (11.9 kB) Copy SHA256 hash SHA256 Source None Feb 11, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page