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
.tomland.jsonfiles. - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tomfoolery-1.1.1.tar.gz.
File metadata
- Download URL: tomfoolery-1.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0646ac8940994f08958e2b1c2e863d824f09e445285209b9fc60179fb1d396c8
|
|
| MD5 |
b7efb22a77d3c32f88e24ac5ea926d56
|
|
| BLAKE2b-256 |
1c93ea2b0d01a4da0db21d0e04574e8ad5eef8c345da3c11413613171759f35f
|
File details
Details for the file tomfoolery-1.1.1-py3-none-any.whl.
File metadata
- Download URL: tomfoolery-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf42279c5ae0260db3fc0fe4a10ae42232d6a1004635755b3c05079f120b6c0a
|
|
| MD5 |
588c5e63492c3e8c5e198e0434ac9456
|
|
| BLAKE2b-256 |
caaea3dbd1865dc15d2559161db8aa3f63c32a808e792afe0d885a5b340a0d6d
|