ShortIO
ShortIO library is intended to avoid context manager boilerplate in simple io operations. The library supports plain text, JSON, pickle and YAML (PyYAML impl).
Inspired by ilio.
Installation
pip install shortio
Usage
Plain text read & write:
from shortio import read, write
s = read('filename')
write('filename', s)
Binary data read & write:
from shortio import read, write
s = read('filename', 'rb')
write('filename', s, 'wb')
JSON data read & write:
from shortio import read_json, write_json
d = read_json('filename.json')
write_json('filename.json', d)
Pickle data read & write:
from shortio import read_pickle, write_pickle
d = read_pickle('filename.pkl')
write_pickle('filename.pkl', d)
YAML data read & write:
Since python does not support YAML out of the box you have to install PyYAML.
pip install PyYAML>=5.1
from shortio import read_yaml, write_yaml
d = read_yaml('filename.yaml')
write_yaml('filename.yaml', d)
Metadata
Release files for shortio 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shortio-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / shortio-0.1.0-py3-none-any.whl
| Download URL | shortio-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c858bc19fc1a62554135549edac68599be027f3d2ddd88897475ba099c9bb3d6
|
|
BLAKE2b-256 checksum How to use checksums |
44582db9423ee78156c48cd30b393fd463bc2483245e52d848e54e5bded5610f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0
|