Skip to main content

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.0.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

tomfoolery-1.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file tomfoolery-1.1.0.tar.gz.

File metadata

  • Download URL: tomfoolery-1.1.0.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for tomfoolery-1.1.0.tar.gz
Algorithm Hash digest
SHA256 24b18ccad0b063ab76b1ddea2deeccc6afca4970d8d133faacf799d21cab72f8
MD5 988cca0005f3f284618194b646ad9b98
BLAKE2b-256 16aab2e098bfa26f473f86b980fdb6d58ec07463cb6a5bb9fbc60c3889c82486

See more details on using hashes here.

File details

Details for the file tomfoolery-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tomfoolery-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for tomfoolery-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 293d9b1a62b8ccc5e5f00a8cf49262b6a77c6c69bf4febfb19a6591800b1f68b
MD5 98f50dc1e4c83eb28cda634368fb8a00
BLAKE2b-256 9b3133ef2d4c7b8ec01615955ae2e8222af6e9df2d5616e3554cde61dd6165d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page