Skip to main content

A tool for generating Python classes from YAML files

Project description

PyPI - Python VersionPyPI - Versionwakatime

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

MEW

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

translation_builder-1.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

translation_builder-1.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for translation_builder-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1a205564929e024b18f3b61a68ffeb11558f0ce23f423d96168e195151ddef65
MD5 3fecb8e00811bd2277f014af1b254378
BLAKE2b-256 bf8e7f2ae3a36489d06feec330f8319dcf4ae584dc64216917471177ab0a84cf

See more details on using hashes here.

File details

Details for the file translation_builder-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for translation_builder-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 faac2cbbe9d95f469186f7ce08f13fbd7eab5b56ee2e31707841464007faaf2f
MD5 7c8e2dacacb148f1917c600edadcd446
BLAKE2b-256 21ab718b33cfd068cd30f11364b17852c1e3e6ab0f7fb5eaa060af97089be423

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