Chameleon fetcher
A small wrapper for chameleon page templates to easily fetch and render templates.
Installation
pip install chameleon_fetcher
Usage
E.g. you have in template dir my_template_dir a file simple.pt with
the following content:
<test>${template_name} ${myvar} ${some_var}</test>
You can then do:
from chameleon_fetcher import ChameleonFetcher
cf = ChameleonFetcher('my_template_dir', some_var=42)
output = cf('simple', myvar='test')
assert output == '<test>simple test 42</test>'
Please note how some_var is set "globally", while for the specific template also a
variable myvar is used.
The following parameters are accepted by ChameleonFetcher:
- template_dir: the directory where the templates are located
And optionally:
- extension: extension of the template files, defaults to '.pt'
- boolean_attributes: what boolean attributes should be supported, defaults to all valid html boolean attributes. See https://meiert.com/en/blog/boolean-attributes-of-html/
- auto_reload: if the templates should be reloaded on change, defaults to True
- **kwargs: other params you want to have available in all templates, e.g. flask=flask
For using the actual templates, check the fantastic chameleon documentation.
Metadata
Release files for chameleon-fetcher 0.0.2
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 | Actions |
|---|---|---|---|---|
| chameleon-fetcher-0.0.2.tar.gz | 14.9 kB | Without provenance | Details for chameleon-fetcher-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chameleon_fetcher-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for chameleon_fetcher-0.0.2-py3-none-any.whl |
Total release size: 30.0 kB
Release files / chameleon-fetcher-0.0.2.tar.gz
| Download URL | chameleon-fetcher-0.0.2.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7da51855b8ca87f178437d5d93b30f88b6f668014d53b98613f9aa3270caf730
|
|
BLAKE2b-256 checksum How to use checksums |
52ca5b314d82869a1456cbaea2249ef85cf1081b03791052bf5a1e22749d90e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|
Release files / chameleon_fetcher-0.0.2-py3-none-any.whl
| Download URL | chameleon_fetcher-0.0.2-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0cf142586e1257e5d37b32eb6ed3ddac1e59f90b0a05ce49aff0bc6f495baf63
|
|
BLAKE2b-256 checksum How to use checksums |
a5f77606d8868ea381cab76131201c61f757711c6291b4fb49effec7b3248e0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|
Security for chameleon-fetcher 0.0.2
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.