Skip to main content

Jinja2 templating based on environment variables.

Project description

Simple command line template renderer using Jinja2.

This will parse the current environment into a dictionary tree where each key is split along underscores or camelcase and each element is added a sub-dictionary.

For example:

DATABASE_ONE_URL=mysql:3306
DATABASE_ONE_NAME=one
databaseTwoUrl=mysql2:3306
databaseTwoName=two
AUTH_LDAP=true

Would result in:

{
    'database': {
        'one': {
            'url': 'mysql1:3306,
            'name': 'one'
        },
        'two': {
            'url': mysql2:3306,
            'name': 'two'
        }
    },
    'auth':
        'ldap': 'true'
}
$ j2tmpl template.jinja
$ j2tmpl templatedir/
$ j2tmpl --help

See the GitHub README for more details.

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

j2tmpl-0.0.7.tar.gz (7.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page