Inventory tools helps to convert yeild return value to Json or CSV
Project description
inventools
Inventools helps to covert yield value to Json or csv output
Example to use yeild value to csv
from inventools import tools
Name_of_file = "language"
header_in_list=['s_no','language','version']
output_in_list = ["1","python","0.1"]
@tools.write_csv(Name_of_file,header_in_list)
def foo():
yield(output_in_list)
foo()
output location in relative path
- └───output_csv
language.csv
Example to use yeild value to json
from inventools import tools
Name_of_file = "language"
header_in_list=['s_no','language','version']
output_in_list = ["1","python","0.1"]
@tools.write_json(Name_of_file,header_in_list)
def foo():
yield(output_in_list)
foo()
- output location in relative path
- └───output_json
language.json
Iteratable example
from inventools import tools
Name_of_file = "language"
header_in_list=['s_no','language','version']
iteratable_object_in_list = [[1,"python",0.1],[2,"java",11],[3,"kotlin",2],[4,"golang",2]]
@tools.write_csv(Name_of_file,header_in_list)
def foo():
for output_in_list in iteratable_object_in_list:
yield(output_in_list)
foo()
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
inventools-3.2.tar.gz
(2.6 kB
view details)
File details
Details for the file inventools-3.2.tar.gz.
File metadata
- Download URL: inventools-3.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8f1e54a8a433fc924f0cbc7ad2dc129eb25be73b4583f80e725fe66255ff424
|
|
| MD5 |
9229c9a709db8cf650096518e59bbb8c
|
|
| BLAKE2b-256 |
dd63240795f65adc68624f1510cc37a9f616c76ab948045a5f7d7bbd51e2c68f
|