Pytemplator aims to streamline the creation of dynamic templates. It is inspired from the excellent CookieCutter package but offers more flexibility.
Project description
Pytemplator aims to streamline the creation of dynamic templates. It supports the format from CookieCutter package but also offers the option to generate the context using Python, which in practice provides a better user experience and more flexibility.
Free software: Apache Software License 2.0
Documentation: https://arnaudblois.github.io/pytemplator/.
How to use
Install the package pytemplator using pip or poetry.
In a shell:
$ pytemplate <target>
Where <target> can be either a local path to the directory of a Pytemplator template or the url to a git repo.
There are options to specify which branch should be used for templating, the output directory and the config directory. More details can be obtained with:
$ pytemplate --help
For template developers
See this example to get an idea of an actual pytemplator template.
A typical Pytemplator template project can live either as a local directory or as a Git repo. It relies on three elements: - a templates folder where all folders and files to be templated should be placed. Under the hood, pytemplator relies on jinja2. - an initialize.py at the root level with a function “generate_context”. More details below. - a finalize.py which is run after the templating.
Contributing
All help is much appreciated and credit is always given. Please consult CONTRIBUTING.rst for details on how to assist me.
Credits
This package is inspired from the excellent CookieCutter package and audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytemplator-0.1.0a0.tar.gz
.
File metadata
- Download URL: pytemplator-0.1.0a0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1027-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa08e637805476a69a185e31dde8183a270e20902431fce7681224d5b5d515de |
|
MD5 | 428f835aa77905e97ab9d3c646669f6e |
|
BLAKE2b-256 | ee2c71cf7c4a07908410ad0d8bd1b1330f782762accbb12ede4ffde1777c9dcf |
File details
Details for the file pytemplator-0.1.0a0-py3-none-any.whl
.
File metadata
- Download URL: pytemplator-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1027-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdfb480ec32ff3e2b9cddd27a4e09d7642c50158389890cae7543df101f5357d |
|
MD5 | 5c7ee1ae1548463fc5ecae201a4619e2 |
|
BLAKE2b-256 | aaf291df346ac051f5117fec652873e6687e16e06124e295e7579f934dbac096 |