To read and write files.
Project description
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)
Python Script
To read/write csv file.
from ioutil import csv
data = [['a', 'b'], [[1, 2], [3, 4]]]
path = '.../file.csv'
csv.write(data, path) # to write csv
csv.read(path) # to read csv
from ioutil import File
data = [['a', 'b'], [[1, 2], [3, 4]]]
path = '.../file.csv'
csv = File.getinstance('csv')
csv.write(data, path) # to write csv
csv.read(path) # to read csv
Command Line
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ioutil-1.0.1.tar.gz
(8.8 kB
view hashes)
Built Distribution
ioutil-1.0.1-py3-none-any.whl
(11.0 kB
view hashes)