A tool for generating Python classes from YAML files
Project description
INFO
This is a simple library providing the ability to generate a Python file from a YML
file. It's make easy to use the data from the original file, for example for translation files.
Installation
The library is available on PyPi, so you can install it in the standard way:
Windows
pip install translation-builder
Ubuntu/macOS
pip3 install translation-builder
Example
YML file example
good-translation:
cool: "No!"
one-more-cool:
- 1
- 2
- 3
File generation
g-translation --file my_file.yml --py_result ./my_directory/
Usage in your code
from my_directory import my_file_tg
print(my_file_tg.Root.good_translation.cool)
print(my_file_tg.Root.good_translation.one_more_cool[1])
Result
No!
2
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file translation_builder-1.0.1.tar.gz
.
File metadata
- Download URL: translation_builder-1.0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a205564929e024b18f3b61a68ffeb11558f0ce23f423d96168e195151ddef65 |
|
MD5 | 3fecb8e00811bd2277f014af1b254378 |
|
BLAKE2b-256 | bf8e7f2ae3a36489d06feec330f8319dcf4ae584dc64216917471177ab0a84cf |
File details
Details for the file translation_builder-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: translation_builder-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faac2cbbe9d95f469186f7ce08f13fbd7eab5b56ee2e31707841464007faaf2f |
|
MD5 | 7c8e2dacacb148f1917c600edadcd446 |
|
BLAKE2b-256 | 21ab718b33cfd068cd30f11364b17852c1e3e6ab0f7fb5eaa060af97089be423 |