{"id":19632477,"url":"https://github.com/metwork-framework/jinja2_getenv_extension","last_synced_at":"2025-04-28T06:33:44.473Z","repository":{"id":33303541,"uuid":"153252013","full_name":"metwork-framework/jinja2_getenv_extension","owner":"metwork-framework","description":"a jinja2 extension to access to system environment variables","archived":false,"fork":false,"pushed_at":"2024-11-25T11:54:26.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T07:06:32.533Z","etag":null,"topics":["autoreadme","github-actions","integration-level-3","jinja2","jinja2-extension"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metwork-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-10-16T08:40:38.000Z","updated_at":"2024-11-25T11:54:30.000Z","dependencies_parsed_at":"2023-12-01T14:44:33.964Z","dependency_job_id":null,"html_url":"https://github.com/metwork-framework/jinja2_getenv_extension","commit_stats":{"total_commits":66,"total_committers":7,"mean_commits":9.428571428571429,"dds":0.7272727272727273,"last_synced_commit":"66bf4582c4cdb7a4d34b0e4f617dfc1af35af0e7"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fjinja2_getenv_extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fjinja2_getenv_extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fjinja2_getenv_extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metwork-framework%2Fjinja2_getenv_extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metwork-framework","download_url":"https://codeload.github.com/metwork-framework/jinja2_getenv_extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251266317,"owners_count":21561809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoreadme","github-actions","integration-level-3","jinja2","jinja2-extension"],"created_at":"2024-11-11T12:14:13.596Z","updated_at":"2025-04-28T06:33:41.151Z","avatar_url":"https://github.com/metwork-framework.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jinja2_getenv_extension\n\n[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md)\n\n**Status (master branch)**\n\n[![GitHub CI](https://github.com/metwork-framework/jinja2_getenv_extension/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/metwork-framework/jinja2_getenv_extension/actions?query=workflow%3ACI+branch%3Amaster)\n[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg)\n\n\n\n\n## What is it ?\n\nThis is a [jinja2](http://jinja.pocoo.org/) extension to access to system\nenvironment variables. It is usefull if you have dynamically generated\nvariable names.\n\n## Syntax\n\nThe syntax is `{{ 'ENV_VAR'|getenv }}` to access to the `ENV_VAR` environment\nvariable. Don't forget the quotes around `ENV_VAR` !\n\nIf you want to provide a default value to avoid an exception if the corresponding\nenvironment variable does not exist, you can use the following syntax:\n`{{ 'ENV_VAR'|getenv('default_value') }}`.\n\n## Examples\n\n```python\n\nfrom jinja2 import Template, Environment\n\n# We load the extension in a jinja2 Environment\nenv = Environment(extensions=[\"jinja2_getenv_extension.GetenvExtension\"])\n\n# For the example, we use a template from a simple string\ntemplate = env.from_string(\"the value of HOME environment variable is: \"\n                           \"{{ 'HOME'|getenv }}\")\nresult = template.render()\n\n# [...]\n```\n\n\n\n\n\n\n## Contributing guide\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n\n\n## Code of Conduct\n\nSee [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file.\n\n\n\n## Sponsors\n\n*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)*\n\n[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetwork-framework%2Fjinja2_getenv_extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetwork-framework%2Fjinja2_getenv_extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetwork-framework%2Fjinja2_getenv_extension/lists"}