# tinypy
<p>
<img alt="version" src="https://img.shields.io/badge/Version-0.0.3-green"/>
<img alt="python" src="https://img.shields.io/badge/Python- > 3.6 -blue?logo=python&logoColor=white"/>
<br>
<a href="https://pypi.org/project/tinypy/">
<img alt="version" src="https://img.shields.io/badge/pypi-tinypy-yellow"/>
</a>
<a href="https://github.com/arashyeganeh/tinypy">
<img alt="version" src="https://img.shields.io/badge/Docs-github-lightslategrey"/>
</a>
<a href="https://github.com/arashyeganeh/tinypy/releases/tag/0.0.2">
<img alt="version" src="https://img.shields.io/badge/Build-tar.gz | whl-lightseagreen"/>
</a>
<a href="https://github.com/arashyeganeh/tinypy/issues">
<img alt="version" src="https://img.shields.io/badge/issues-https://github.com/arashyeganeh/tinypy/issues-red"/>
</a>
</p>
Tinypy is a collection of small Python functions and classes which make common patterns shorter and faster. All of these can be done by it:
* convert JSON files to CSV files
* convert CSV files to JSON files
## Installation
```bash
pip install tinypy
```
## Usage
### Script
You can also convert the JSON file to a CSV file by passing the "src "and "dest" directories to the function `json2csv(src, dest)`
```python
import tinypy as tp
_tp = tp.Tinypy()
_tp.json2csv(src="sample.json", dest="new-sample.csv")
```
This will convert the JSON file located at `sample.json` to a CSV file located at `new-sample.csv`.
### Command Line Interface
Tinypy also provides a command line interface for converting JSON files to CSV files.
```bash
tinypy -s sample.json -d new-sample.csv json2csv
```
This command will convert the JSON file located at `sample.json` to a CSV file located at `new-sample.csv`.
## Advanced Usage
To get more information, use -h or --help in Command Line Interface.
```bash
> tinypy -h
usage: tinypy [-h] [-v] -s import.json -d export.csv -a
Tinypy is a collection of small Python functions and classes which make common patterns shorter and faster.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s import.json, --src import.json
The path to the JSON file to convert
-d export.csv, --dest export.csv
The path to the CSV file to create
-a , --action json2csv, csv2json
Documentation is available at the GitHub page: https://github.com/arashyeganeh/tinypy
```
### Options
#### action
| Action name | Description | Docs |
| :---------: | :-----------------------------: | :--------------------: |
| json2csv | convert JSON files to CSV files | [Read](/docs/csv2json) |
| csv2json | convert CSV files to JSON files | [Read](/docs/csv2json) |
## Requirements
- Python 3
## License
This library is released under the MIT License.
## Contributing
The Tinypy project welcomes contributions.
Please submit a pull request or an issue on GitHub if you have any improvements to suggest.
## Support
If you have any issues or questions, please feel free to reach out to us on [the GitHub](https://github.com/arashyeganeh/tinypy/issues).
## References
- More information can be found on the [GitHub page](https://github.com/arashyeganeh/tinypy).
Raw data
{
"_id": null,
"home_page": "https://github.com/arashyeganeh/tinypy",
"name": "tinypy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "utils,tiny,lightweight,json,convert json,csv,convert csv",
"author": "Arash Yeganeh",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/1d/4e/0b664ee5d88f8d09b30d45d35d4261dae69c474fe09af0e986508bad9202/tinypy-0.2.2.tar.gz",
"platform": null,
"description": "# tinypy\r\n\r\n<p>\r\n <img alt=\"version\" src=\"https://img.shields.io/badge/Version-0.0.3-green\"/>\r\n <img alt=\"python\" src=\"https://img.shields.io/badge/Python- > 3.6 -blue?logo=python&logoColor=white\"/>\r\n <br>\r\n <a href=\"https://pypi.org/project/tinypy/\">\r\n <img alt=\"version\" src=\"https://img.shields.io/badge/pypi-tinypy-yellow\"/>\r\n </a>\r\n <a href=\"https://github.com/arashyeganeh/tinypy\">\r\n <img alt=\"version\" src=\"https://img.shields.io/badge/Docs-github-lightslategrey\"/>\r\n </a>\r\n <a href=\"https://github.com/arashyeganeh/tinypy/releases/tag/0.0.2\">\r\n <img alt=\"version\" src=\"https://img.shields.io/badge/Build-tar.gz | whl-lightseagreen\"/>\r\n </a>\r\n <a href=\"https://github.com/arashyeganeh/tinypy/issues\">\r\n \t<img alt=\"version\" src=\"https://img.shields.io/badge/issues-https://github.com/arashyeganeh/tinypy/issues-red\"/>\r\n </a>\r\n</p>\r\n\r\n\r\nTinypy is a collection of small Python functions and classes which make common patterns shorter and faster. All of these can be done by it:\r\n\r\n* convert JSON files to CSV files\r\n* convert CSV files to JSON files\r\n\r\n## Installation\r\n\r\n```bash\r\npip install tinypy\r\n```\r\n\r\n## Usage\r\n\r\n### Script\r\n\r\nYou can also convert the JSON file to a CSV file by passing the \"src \"and \"dest\" directories to the function `json2csv(src, dest)`\r\n\r\n```python\r\nimport tinypy as tp\r\n\r\n_tp = tp.Tinypy()\r\n_tp.json2csv(src=\"sample.json\", dest=\"new-sample.csv\")\r\n```\r\n\r\nThis will convert the JSON file located at `sample.json` to a CSV file located at `new-sample.csv`.\r\n\r\n### Command Line Interface\r\n\r\nTinypy also provides a command line interface for converting JSON files to CSV files.\r\n\r\n```bash\r\ntinypy -s sample.json -d new-sample.csv json2csv\r\n```\r\n\r\nThis command will convert the JSON file located at `sample.json` to a CSV file located at `new-sample.csv`.\r\n\r\n## Advanced Usage\r\n\r\nTo get more information, use -h or --help in Command Line Interface.\r\n\r\n```bash\r\n> tinypy -h\r\n\r\nusage: tinypy [-h] [-v] -s import.json -d export.csv -a\r\n\r\nTinypy is a collection of small Python functions and classes which make common patterns shorter and faster.\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n -v, --version show program's version number and exit\r\n -s import.json, --src import.json\r\n The path to the JSON file to convert\r\n -d export.csv, --dest export.csv\r\n The path to the CSV file to create\r\n -a , --action json2csv, csv2json\r\n\r\nDocumentation is available at the GitHub page: https://github.com/arashyeganeh/tinypy\r\n```\r\n\r\n### Options\r\n\r\n#### action\r\n\r\n| Action name | Description | Docs |\r\n| :---------: | :-----------------------------: | :--------------------: |\r\n| json2csv | convert JSON files to CSV files | [Read](/docs/csv2json) |\r\n| csv2json | convert CSV files to JSON files | [Read](/docs/csv2json) |\r\n\r\n## Requirements\r\n\r\n- Python 3\r\n\r\n## License\r\n\r\nThis library is released under the MIT License.\r\n\r\n## Contributing\r\n\r\nThe Tinypy project welcomes contributions. \r\n\r\nPlease submit a pull request or an issue on GitHub if you have any improvements to suggest.\r\n\r\n## Support\r\n\r\nIf you have any issues or questions, please feel free to reach out to us on [the GitHub](https://github.com/arashyeganeh/tinypy/issues).\r\n\r\n## References\r\n\r\n- More information can be found on the [GitHub page](https://github.com/arashyeganeh/tinypy).\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Tinypy is a collection of small Python functions and classes which make common patterns shorter and faster.",
"version": "0.2.2",
"split_keywords": [
"utils",
"tiny",
"lightweight",
"json",
"convert json",
"csv",
"convert csv"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "09d22a35a5315944e947f47fa8cb90f6774d4e3262060592355b0d178653dccb",
"md5": "268906cf9b1fd1df4760bc0cf11c0cb8",
"sha256": "8fec228194528b6683898d2278207d507ad2c540e37bedc66571a5d97af9f483"
},
"downloads": -1,
"filename": "tinypy-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "268906cf9b1fd1df4760bc0cf11c0cb8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 5872,
"upload_time": "2023-02-03T19:02:57",
"upload_time_iso_8601": "2023-02-03T19:02:57.101624Z",
"url": "https://files.pythonhosted.org/packages/09/d2/2a35a5315944e947f47fa8cb90f6774d4e3262060592355b0d178653dccb/tinypy-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d4e0b664ee5d88f8d09b30d45d35d4261dae69c474fe09af0e986508bad9202",
"md5": "f5434eb2c597568bf7c796a1ebaa4d91",
"sha256": "324b933b9282906d519ab34eb0a6700a910ddad0e407aed141b5e34ea5e8fdaf"
},
"downloads": -1,
"filename": "tinypy-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "f5434eb2c597568bf7c796a1ebaa4d91",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 5029,
"upload_time": "2023-02-03T19:03:03",
"upload_time_iso_8601": "2023-02-03T19:03:03.022234Z",
"url": "https://files.pythonhosted.org/packages/1d/4e/0b664ee5d88f8d09b30d45d35d4261dae69c474fe09af0e986508bad9202/tinypy-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-03 19:03:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "arashyeganeh",
"github_project": "tinypy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tinypy"
}