Skip to content

matt-manes/tomfoolery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages