https://github.com/lkummer/container-env
Python library for environment based configuration.
https://github.com/lkummer/container-env
Last synced: 10 months ago
JSON representation
Python library for environment based configuration.
- Host: GitHub
- URL: https://github.com/lkummer/container-env
- Owner: LKummer
- License: mit
- Created: 2020-06-26T19:36:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-30T21:22:28.000Z (almost 6 years ago)
- Last Synced: 2025-08-30T16:18:58.428Z (10 months ago)
- Language: Python
- Homepage: https://lkummer.github.io/container-env/
- Size: 606 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Container Env
Environment variables are the _easiest_ way to manage options in containers.
Especially when using Docker Swarm or Kubernetes.
Container Env makes it _easy_ to create applications with environment based
configuration.
*[Visit the website](https://lkummer.github.io/container-env/)* for more information.
## Motivation
Container Env encourages proper handling of secrets. It strives to:
* Make any option usable with secrets.
* Work easily with any kind of secrets.
* Be simple to integrate with Django, Flask and others.
* Provide a high quality solution.
## Usage
**[See the quick start guide](https://lkummer.github.io/container-env/guide/quickstart/)
for more details.**
Install from PyPI:
```s
$ pip install container_env
```
Import and use the [`get_environment()`](https://lkummer.github.io/container-env/guide/api/#get_environment)
function:
```python
from container_env import get_environment
# Look for DATABASE_USER and DATABASE_USER_FILE environment variables.
get_environment("DATABASE_USER", default="postgres")
# If DATABASE_USER exists it's value is returned.
# If DATABASE_USER_FILE exists and points to a file, the content of the
# file is returned.
# If neither exist, "postgres" is returned.
```
*[See the documentation](https://lkummer.github.io/container-env/guide/)*
to learn more about Container Env.
## Contributing
Please [check existing issues](https://github.com/LKummer/container-env/issues)
before opening a new one.
[See the development guide](https://lkummer.github.io/container-env/guide/development/)
to learn about the development setup.