kon3gor / TTD

Toml to Python DTO converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is simple af script to generate Python data classes from TOML file.

Usage

To create Python data classes from some TOML file you can just call:

python . config.toml config.py

This will produce new file (or override existing one) called config.py with gnerated calasses.

If you want to simplify usage of generated classes you can also create factories for them:

python . config.toml config.py -f

This call will generate a speacial static method from_dict for each class. You can also add -s / --safe flag in order to make from_dict safier by using get with deafult instead of simple get:

python . config.toml config.py -f -s

Binary

You can also create an executable by simply running bin.sh script. Resulting binary is called ttd and you can find it in dist directory.

About

Toml to Python DTO converter


Languages

Language:Python 99.2%Language:Shell 0.8%