Python library and CLI tool for converting data to different Python data classes
Project description
data2model
Python library and CLI tool (in the nearest future) for generating different Python data classes from data.
Supported data formats:
- CSV
Supported data classes:
Requirements
- Python 3.8+
Installation
pip install data2model
Usage
import asyncio
import pathlib
from data_to_model import ModelGenerator
files = [
{"input": pathlib.Path("example.csv"), "output": pathlib.Path("example.py")},
]
async def model_generator(input_file: pathlib.Path, output_file: pathlib.Path):
mg = ModelGenerator(input_file)
model = await mg.get_model()
await model.save(output_file)
async def main():
tasks = [model_generator(i["input"], i["output"]) for i in files]
await asyncio.gather(*tasks)
if __name__ == "__main__":
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
data2model-0.1.0b0.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for data2model-0.1.0b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d19c02791078a521e79701830d0b82bc3dc4d2cfc6075facf7933f2dfaaa8e |
|
MD5 | f1dbab7cce1702e4496d07c5ba60e93e |
|
BLAKE2b-256 | dd942e1fd82a7ccba9be2170ae8fc41d5e3ad44c9a321ae3ca3cbd3e61dab815 |