# IOutil
[![PyPI](https://img.shields.io/pypi/v/ioutil)](https://pypi.python.org/pypi/ioutil)
[![Pypi - License](https://img.shields.io/github/license/codesrg/ioutil)](https://github.com/codesrg/ioutil/blob/main/LICENSE)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ioutil?color=red)](https://pypi.python.org/pypi/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.
```python
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
```
```python
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](https://github.com/codesrg/ioutil/issues) along with a detailed
description.
Raw data
{
"_id": null,
"home_page": "",
"name": "ioutil",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "io,read,write,file,ioutil",
"author": "",
"author_email": "srg <srg.code@pm.me>",
"download_url": "https://files.pythonhosted.org/packages/0b/8c/ae81cbb66af64b662b7ceedf6130846b28c0ddde808ff844ff25a9025932/ioutil-1.0.3.tar.gz",
"platform": null,
"description": "# IOutil\r\n\r\n[![PyPI](https://img.shields.io/pypi/v/ioutil)](https://pypi.python.org/pypi/ioutil)\r\n[![Pypi - License](https://img.shields.io/github/license/codesrg/ioutil)](https://github.com/codesrg/ioutil/blob/main/LICENSE)\r\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ioutil?color=red)](https://pypi.python.org/pypi/ioutil)\r\n\r\nTo read and write files.\r\n\r\ncsv, json, parquet, text, toml formats is supported.\r\n\r\n## Installation\r\n\r\n`pip install -U ioutil`\r\n\r\n## Usage\r\n\r\n```\r\nusage: ioutil [options]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n -v, --version show version number and exit.\r\n\r\nto read/write files:\r\n path path to read/write\r\n -r, --read to read file\r\n -w, --write to write file\r\n -d, --data data to write\r\n -f, --format file format to use\r\n -m, --mode mode to open file\r\n --rfv will return formatted string (CSV only)\r\n\r\n-w/--write function may return error as it expects data in specific datatype.\r\nWriting files using commandline isn't recommended.\r\n```\r\n\r\n### Python Script\r\n\r\nTo read/write csv file.\r\n\r\n```python\r\nfrom ioutil import csv\r\n\r\ndata = [['a', 'b'], [1, 2], [3, 4]]\r\npath = '.../file.csv'\r\ncsv.write(data=data, path=path) # to write csv\r\ncsv.read(path=path) # to read csv\r\n```\r\n\r\n```python\r\nfrom ioutil import File\r\n\r\ndata = [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]\r\npath = '.../file.csv'\r\n\r\nFile.write(data=data, path=path) # to write file\r\nFile.read(path=path) # to read file\r\n```\r\n\r\n### Command Line (not recommended)\r\n\r\nTo write a text file.\r\n\r\n```\r\n$ ioutil \".../file.txt\" --data \"data\" --write\r\nTrue\r\n```\r\n\r\n###\r\n\r\nTo read a json file.\r\n\r\n```\r\n$ ioutil \".../file.json\" --read\r\n### content of a file ###\r\n```\r\n\r\n## Issues:\r\n\r\nIf you encounter any problems, please file an [issue](https://github.com/codesrg/ioutil/issues) along with a detailed\r\ndescription.\r\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "To read and write files.",
"version": "1.0.3",
"split_keywords": [
"io",
"read",
"write",
"file",
"ioutil"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "ced169c824892e4fe87c035abf9415ee",
"sha256": "4a9740abc586f9a8de0fc7106a0d2c9002640afca946b24587add67674da8822"
},
"downloads": -1,
"filename": "ioutil-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ced169c824892e4fe87c035abf9415ee",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11575,
"upload_time": "2022-12-24T14:17:10",
"upload_time_iso_8601": "2022-12-24T14:17:10.926878Z",
"url": "https://files.pythonhosted.org/packages/99/36/357e61faf8c26584bc7203afad8fc09ca26a98ffd825ff6519fe81871d1f/ioutil-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "93bc84d9351db412df6ac8ff3626ecbe",
"sha256": "871e1edad0a7edfd757517d32832650dd5f44d872fe14a1b6f56e4c55fc589fe"
},
"downloads": -1,
"filename": "ioutil-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "93bc84d9351db412df6ac8ff3626ecbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9253,
"upload_time": "2022-12-24T14:17:12",
"upload_time_iso_8601": "2022-12-24T14:17:12.483463Z",
"url": "https://files.pythonhosted.org/packages/0b/8c/ae81cbb66af64b662b7ceedf6130846b28c0ddde808ff844ff25a9025932/ioutil-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-24 14:17:12",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "ioutil"
}