Skip to main content

'config loader for json and yml files'

Project description

configmelt

Introduction

The ConfigMeld package simplifies configuration handling by providing a class to manage JSON or YAML configurations. This class allows for easy loading, accessing, and manipulation of configuration attributes.

Installation

To install configmelt, simply use pip:

pip install configmelt

Features:

  • Loading Configurations: Load configurations from JSON or YAML files.
  • Accessing Configurations: Access configuration attributes as object properties.
  • Flexible Representation: Manage configurations in an object-oriented manner.
  • Environmental Integration: Easily convert configurations to environment variables.
  • Schema Generation: Generate JSON schema based on existing configurations.

Usage

  1. Initializing ConfigMeld:
from configmeld import ConfigMeld

# Initialize ConfigMeld with attributes
config = ConfigMeld(foo='bar', nested={'key': 'value'})

# Access configuration attributes
print(config.foo)  # Output: 'bar'
  1. Loading Configurations from Files:
# Load configurations from a JSON/YAML file
path_to_config = 'path/to/config.json'
loaded_config = ConfigMeld.load_config_from_file(path_to_config)

# Access loaded configurations
print(loaded_config.attribute_name)
  1. schema Generation:
# Generate JSON schema based on existing configurations
schema = loaded_config.generate_schema()
print(schema)

Documentation

The Sphinx-generated documentation for configmelt can be found here.

Contribution

Feel free to contribute by submitting issues here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

configmelt-1.0.3-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

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