An easy way to manage environment specific configuration
Project description
## Yamz
An easy way to manage environment specific configuration in Python using PyYAML.
### Requirements
- Python >=3.6
- PyYAML==3.13
### Why Yamz?
All the other names I managed to think of were already taken, so... here we are.
### How to use
- `pip install yamz`
- Configure your environment in `settings.yaml`
- I recommend using environments names such as: `production`, `development`, etc.,
Note: `global` environment settings will be available in all environments
- If you would like to include variables from your environment, make sure to add a `$` prefix (`$HOME`) and Yamz will make sure it's included.
```yaml
global:
TEST: some_test
production:
HOME: $HOME
MYSQL_DB_HOST: 1.2.3.4
MYSQL_DB_PASS: $MYSQL_DB_PASS
```
```python
import os
from yamz import Environment
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path = os.path.join(base, 'settings.yaml')
env = Environment(path)
prod_env = env.load("production")
prod_env.MYSQL_DB_HOST
```
An easy way to manage environment specific configuration in Python using PyYAML.
### Requirements
- Python >=3.6
- PyYAML==3.13
### Why Yamz?
All the other names I managed to think of were already taken, so... here we are.
### How to use
- `pip install yamz`
- Configure your environment in `settings.yaml`
- I recommend using environments names such as: `production`, `development`, etc.,
Note: `global` environment settings will be available in all environments
- If you would like to include variables from your environment, make sure to add a `$` prefix (`$HOME`) and Yamz will make sure it's included.
```yaml
global:
TEST: some_test
production:
HOME: $HOME
MYSQL_DB_HOST: 1.2.3.4
MYSQL_DB_PASS: $MYSQL_DB_PASS
```
```python
import os
from yamz import Environment
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path = os.path.join(base, 'settings.yaml')
env = Environment(path)
prod_env = env.load("production")
prod_env.MYSQL_DB_HOST
```
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
yamz-0.0.4.tar.gz
(2.4 kB
view details)
File details
Details for the file yamz-0.0.4.tar.gz.
File metadata
- Download URL: yamz-0.0.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
738ea0b94e8d7a99abd7ec5d3085d13de4e8427311d655db192fa16a3b53a3c4
|
|
| MD5 |
cce1cd4dafbf9f75a05496682afbf551
|
|
| BLAKE2b-256 |
986ea50768906e18f4e38b22ba737cc9403c04efb533037d62d9fae9528300e7
|