IOutil
To read and write files.
csv, json, parquet, text, toml formats is supported.
Installation
pip install -U ioutil
Usage
usage: ioutil [options]
optional arguments:
-h, --help show this help message and exit
-v, --version show version number and exit.
to read/write files:
path path to read/write
-r, --read to read file
-w, --write to write file
-d, --data data to write
-f, --format file format to use
-m, --mode mode to open file
--rfv will return formatted string (CSV only)
-w/--write function may return error as it expects data in specific datatype.
Writing files using commandline isn't recommended.
Python Script
To read/write csv file.
from ioutil import csv
data = [['a', 'b'], [1, 2], [3, 4]]
path = '.../file.csv'
csv.write(data=data, path=path) # to write csv
csv.read(path=path) # to read csv
from ioutil import File
data = [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]
path = '.../file.csv'
File.write(data=data, path=path) # to write file
File.read(path=path) # to read file
Command Line (not recommended)
To write a text file.
$ ioutil ".../file.txt" --data "data" --write
True
To read a json file.
$ ioutil ".../file.json" --read
### content of a file ###
Issues:
If you encounter any problems, please file an issue along with a detailed description.
Metadata
Release files for ioutil 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ioutil-1.0.3.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ioutil-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / ioutil-1.0.3.tar.gz
| Download URL | ioutil-1.0.3.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
871e1edad0a7edfd757517d32832650dd5f44d872fe14a1b6f56e4c55fc589fe
|
|
BLAKE2b-256 checksum How to use checksums |
0b8cae81cbb66af64b662b7ceedf6130846b28c0ddde808ff844ff25a9025932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / ioutil-1.0.3-py3-none-any.whl
| Download URL | ioutil-1.0.3-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a9740abc586f9a8de0fc7106a0d2c9002640afca946b24587add67674da8822
|
|
BLAKE2b-256 checksum How to use checksums |
9936357e61faf8c26584bc7203afad8fc09ca26a98ffd825ff6519fe81871d1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|