Skip to main content

A python package for managing YAML configuration

Project description

pyconfman2

pyconfman2 is designed to handle schema configurations by loading properties from a dictionary or a YAML configuration file. It provides methods for adding, getting, and removing properties from the schema.

Installation

python -m pip install pyconfman2

Usage

Basic

In it's most basic form, a Schema can be created which will load a local "config.yaml" or "config.yml" file present.

>>> from pyconfman2 import Schema
>>> config = Schema.ConfigSchema()
>>> print(config)
{}

Provide a default config

>>> from pyconfman2 import Schema
>>> config=Schema.ConfigSchema({"foo": "bar"})
>>> print(config)
{'foo': 'bar'}

Specify the default config file to load

>>> from pyconfman2 import Schema
>>> config=Schema.ConfigSchema(default_config="default_config.yaml")
>>> print(config)
{'foo': 'bar', 'zoo': {'jar': ['car', 'far']}}

Specify the config file to load

>>> from pyconfman2 import Schema
>>> config=Schema.ConfigSchema(default_config="default_config.yaml", filepath="another_config.yaml")
>>> print(config)
{'foo': 'overwritten_by_another_config', 'zoo': {'jar': ['car', 'far']}}

Schema Loading breakdown

  1. Load the hard-coded defaults
  2. Load (and override) using the "default config" file if present
  3. Load (and override) using the config file if present

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

pyconfman2-0.1.10.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

pyconfman2-0.1.10-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pyconfman2-0.1.10.tar.gz.

File metadata

  • Download URL: pyconfman2-0.1.10.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyconfman2-0.1.10.tar.gz
Algorithm Hash digest
SHA256 491ead9fad6ddaf26fd5df7e471f8d47be71c60fd440a969f04e6d5ab3ec468e
MD5 0dc88aebc319fbf2be3750e6ac9c5992
BLAKE2b-256 32da4e9faf557ac7ea9707a022fcffa6a3de7bf50bc6fac51dfc9bb0fb159f19

See more details on using hashes here.

File details

Details for the file pyconfman2-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: pyconfman2-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyconfman2-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a5aa75a42f8c4a5f4fe6abfe4beb12fd458badcc3b74dfb102e6a4d1749f1e6e
MD5 38970bc7bc03324776a00691bd4c5585
BLAKE2b-256 46c19dd1b5d5a0a8035b62d5db8b7aadaead6e9a14dd38a29e029476216905a9

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