A simple YAML-based configuration loader for Python
Project description
PyamlConf
A simple YAML-based configuration loader for Python
Mustache
bala bala..... see demo
Install
pip install pyamlconf
Demo
create yaml file on local path: tests/config.yaml
db:
url: mysql://{{.host}}:3306
host: 127.0.0.1
name: dbtest
pwd: 123456
pool:
size: 100
maxidle: 10
desc: "db.url = {{ db.url }}; db.name = {{ .name }}; db.pool = {{.pool}} "
create tests/test.py, like:
from pyamlconf.config import PyamlConfig
config = PyamlConfig('tests/config.yaml')
print(config.get('db.url'))
print(config.get('db.desc'))
python tests/test.py
output:
mysql://127.0.0.1:3306
db.url = mysql://127.0.0.1:3306; db.name = dbtest; db.pool = {'size': 100, 'maxidle': 10}
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
pyamlconf-0.0.1.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyamlconf-0.0.1.tar.gz.
File metadata
- Download URL: pyamlconf-0.0.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1c39ce7165557b7c20e83d347b036e19094bd398c8b6e077329f4e4c52bc0ca
|
|
| MD5 |
5eed83262805381ddbbd92a86e38b479
|
|
| BLAKE2b-256 |
ad72e4b101ad51d66500ebcb391986cbe7e40be2971c10965f280e8743a23e93
|
File details
Details for the file pyamlconf-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pyamlconf-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f7e6806b511329cc32ba621b4ea15af0bf0a24d0acae7b48c5b4e24f506503
|
|
| MD5 |
f6d8739491d796d5ee6b918875e8639c
|
|
| BLAKE2b-256 |
70f9d1202e8fb14bc920b444138c3dd6b606fa43c4751ffa2305994c39fb7a8d
|