jinjaconfig
A jinja2 renderer receiving a JSON string from commandline. Useful for generating config files in deployment environments.
Installation
Install jinja config
pip install jinjaconfig
Install from sources
pip install git+https://bitbucket.org/luisfernando/jinjaconfig.git
Usage
usage: jinjaconfig [-h] --values [values] [file] A jinja2 renderer receiving arguments from commandline. Useful for generating config files in deployment enviroments positional arguments: file template to parse optional arguments: -h, --help show this help message and exit --values [values] json encoded values
Basic Use
Pass arguments from command line
jinjaconfig example.conf --values="{"celery":{"task":"mytask","path":"/home/x/Env/myenv/bin/celery"}, "num_procs":2,"user":"user","workdir":"/home/x/app/app/","logs":{"error":"/home/x/app/logs/err.log", "log":"/home/x/app/logs/log.log"}}"Pass arguments from a file (*NIX, Bash) and output to file
jinjaconfig example.conf --values="`cat arguments.json`" > result.conf
example.conf
; ==================================
; configuration example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
command={{ celery.path }} worker -A {{ celery.task }}
directory={{ workdir }}
user={{ user }}
numprocs={{ num_procs }}
stdout_logfile={{ logs.log }}
stderr_logfile={{ logs.error }}
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
arguments.json
{
"celery" : {
"task" : "mytask",
"path" : "/home/x/Env/myenv/bin/celery"
},
"num_procs" : 2,
"user" : "user",
"workdir" : "/home/x/app/app/",
"logs" : {
"error" : "/home/x/app/logs/err.log",
"log" : "/home/x/app/logs/log.log"
}
}
Metadata
Release files for jinjaconfig 0.1.1
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 |
|---|---|---|---|---|
| jinjaconfig-0.1.1.tar.gz | 3.4 kB | Without provenance | Details for jinjaconfig-0.1.1.tar.gz |
Release files / jinjaconfig-0.1.1.tar.gz
| Download URL | jinjaconfig-0.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f9b32dedd773a02180457e94c77fe416c11001b4e7f3f1134405a0b9117ad60
|
|
BLAKE2b-256 checksum How to use checksums |
f2b4234762b1f63c12bf0dfc1c15e526f17d92c49a5d16be3e53c2c2273c8cfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jinjaconfig 0.1.1
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.