pytexl
The Python library of Texl: renders text templates with Swan
expressions, loads documents from local files and over HTTP(S), and lets
templates call your Python functions, async ones included.
pip install maturin
maturin build --release -m pytexl/Cargo.toml # builds a wheel into target/wheels
pip install target/wheels/pytexl-*.whl
import asyncio
import pytexl
engine = pytexl.Engine({"user": {"name": "Ada"}})
print(asyncio.run(engine.render("Hello <% user.name %>!"))) # Hello Ada!
See the Python API reference.
The docstrings of the pytexl package document the same API.
Layout
| Path | Contents |
|---|---|
src/ |
The native module pytexl._pytexl (PyO3), on top of texl-core |
python/pytexl/ |
The Python package: Engine, Context, Document, the loaders |
tests/ |
The Python unit tests, their fixtures, and the cargo test that runs them |
Tests
cargo test -p pytexl --test python # builds the module and runs the Python tests
The cargo test needs python3 (3.10 or later) with its development files; it
is skipped, with a message, if Python is missing. Set PYTEXL_PYTHON to pick
an interpreter. In a virtual environment with the package installed
(maturin develop), run the tests directly:
python -m unittest discover -s pytexl/tests -v
License
Metadata
Release files for pytexl 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytexl-0.1.0.tar.gz | 131.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytexl-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 767.0 kB
Release files / pytexl-0.1.0.tar.gz
| Download URL | pytexl-0.1.0.tar.gz |
|---|---|
| Size | 131.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
248b4535ba9017bb7f766d396cc78db7fe3401df59f5081884e0bd2df2e51ee8
|
|
BLAKE2b-256 checksum How to use checksums |
4357e4ab970210e34e72b63cbe0c3a1bbb03fe5987864e8a02bb795e3661651d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / pytexl-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pytexl-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 636.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2a2d890736ee7343e094ec9a886b7e13ac99af97afe4bca568905d60a6ff3341
|
|
BLAKE2b-256 checksum How to use checksums |
20bcd5d33151bff6712911796daac6dba1a7fd5c3cac8350559b13f4b7cb4a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Security for pytexl 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.