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.1b0.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for data2model-0.1.1b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e15b326391bf3f7d318ce80418778bb03132157d11ca5aeec0cf31c6f6e2ba |
|
MD5 | 090789a71f22032dce17b68271c47a75 |
|
BLAKE2b-256 | 1a9cdd4238061de84f2a7770c2ea04949161a880bb5c576d255e42c3094c0e10 |