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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: translation_builder-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2dc8c83abcf2ea5d861edf75e5b062ce61e2df4483f0a1f4afa37d1fc7c037df
MD5 742858bc4c54e6f78db006cbebef4e1b
BLAKE2b-256 afbfd1263b7e0e65379f5ff642b54b12e3f98bdd89e8cee97a510df7b81407a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for translation_builder-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e780707ca0baaafbcfe996461358e6b3ee399226cacdf36e7deb5ce53117851b
MD5 abd80cfa32c001f171f4a1d0c4da812e
BLAKE2b-256 238536693c58c4b046c68cfebdf7d1616e5c4bdd5eacc34d48b1240d410752ee

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