CLI to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files)
Project description
tomfoolery
Tool to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files).
Primarily aimed at configuration type files.
Installation
Install with:
pip install tomfoolery
Usage
Given the following file (venue.toml
):
Running the command
tomfoolery venue.toml
will produce this file (venue.py
):
which can then be used:
>from venue import Venue >venue = Venue.load() >print(venue.address.city) 'Chicago' >venue.calendar.start_month = "March" >venue.dump()
Current Caveats
- Only works with
.toml
and.json
files. - All keys must be valid Python variable names.
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
tomfoolery-1.1.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for tomfoolery-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf42279c5ae0260db3fc0fe4a10ae42232d6a1004635755b3c05079f120b6c0a |
|
MD5 | 588c5e63492c3e8c5e198e0434ac9456 |
|
BLAKE2b-256 | caaea3dbd1865dc15d2559161db8aa3f63c32a808e792afe0d885a5b340a0d6d |