Skip to main content

A templating engine with a simple templating language specifically designed for type inference, allowing consumers to provide users with slots of determined types.

Project description

YATLA 📑: Yet Another Templating Language (Again!)

YATLA is a templating engine with a simple templating language specifically designed for type inference, allowing consumers to provide users with slots of determined types.

Roadmap 🗺️

  • Add numerical blocks
  • Add type inference. Go from a template -> list of typed parameters
  • Write own lexer to respect whitespace
  • Write own own parsing system
  • Add template validation (preventing non-unique identifiers...)
  • Publish as pip-installable package
  • Add foreach loops
  • Add numerical function calls
  • Improve Python interface
  • Think about object accessors

Sample Template

This sample template gives a whirlwind tour of YATLA's functionality.

This a sample template.

This line contains a {{ slot }}.

Slots can also contain mathematical expressions: {{ 3 + factor * 7 }}.
With full support for operator precedence: {{ (3 + factor) * 7 }}.

Foreach loops are also valid. For example:

This is the {{ factor }} times table:
{{ foreach num in num_list }}
    {{ factor }} * {{ num }} = {{ factor * num }}
{{ endforeach }}

There is also a standard library of mathematical functions.
Comparing {{ factor }} and {{ num }}, the largest is {{ Maximum(factor, num) }} and the smallest is {{ Minimum(factor, num) }}.
{{ RoundUp(15, 2) }} = 16, and {{ RoundDown(15, 2) }} = 14. 

From the template above, YATLA will identify the parameters in the template, and infer their types:

  • slot: string or number
  • factor: number
  • num: number
  • num_list: number array

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvement, please submit an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

YATLA is developed and maintained by Eugene Prout.

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

yatla-0.5.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

yatla-0.5.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file yatla-0.5.0.tar.gz.

File metadata

  • Download URL: yatla-0.5.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for yatla-0.5.0.tar.gz
Algorithm Hash digest
SHA256 603cadc73c7690497ff986a18fd4cf5dca6aa487b8ec091ec251dd920795d774
MD5 6b5a00f1a99cb7d531e9ec3b004ee867
BLAKE2b-256 0214138e74e9584fbed8759e43a6127a75f1090ff1aca1e362a07fce366ed903

See more details on using hashes here.

Provenance

The following attestation bundles were made for yatla-0.5.0.tar.gz:

Publisher: main.yml on eugene-prout/yatla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yatla-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: yatla-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for yatla-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8b0de5622d2a321bf054d44daa79fc33d59c0d707879b737a3f0dcd412e9bf1
MD5 387e535c2d3b9a2188fa813b923fd336
BLAKE2b-256 fa5c260da9a75773abcebffecf8d4fa3fc87f32952a928e40f52779dc7818b6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yatla-0.5.0-py3-none-any.whl:

Publisher: main.yml on eugene-prout/yatla

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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