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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translation_builder-1.0.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file translation_builder-1.0.4.tar.gz.

File metadata

  • Download URL: translation_builder-1.0.4.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for translation_builder-1.0.4.tar.gz
Algorithm Hash digest
SHA256 6a65c690f567c69ba40f182d40e4d0bbd7e51c40a2eed2fc4c3218f41063d1b6
MD5 2e0a064585e01438aa1267a1c1ca8983
BLAKE2b-256 a628cf16fd518509fd93a77349b983efcc1e889b51ece828bcbfe1830c88c329

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for translation_builder-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9453db2dc66d27fe67601d12bbaf472006fdb2695108a85c97bdf5c3debae7a2
MD5 324a43806a167989ff5a364257335fe3
BLAKE2b-256 3bb53b796867c18fc118519039f7c5068f2d99346951c30554c635f58cb38ae9

See more details on using hashes here.

Supported by

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