Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyamlconf-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

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

Hashes for pyamlconf-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d1c39ce7165557b7c20e83d347b036e19094bd398c8b6e077329f4e4c52bc0ca
MD5 5eed83262805381ddbbd92a86e38b479
BLAKE2b-256 ad72e4b101ad51d66500ebcb391986cbe7e40be2971c10965f280e8743a23e93

See more details on using hashes here.

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

Hashes for pyamlconf-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f7e6806b511329cc32ba621b4ea15af0bf0a24d0acae7b48c5b4e24f506503
MD5 f6d8739491d796d5ee6b918875e8639c
BLAKE2b-256 70f9d1202e8fb14bc920b444138c3dd6b606fa43c4751ffa2305994c39fb7a8d

See more details on using hashes here.

Supported by

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