Skip to main content

A simple configuration module

Project description

configureout

Configureout is a lightweight Python module designed to simplify the process of loading and accessing configuration data from JSON files. It provides a simple and intuitive interface for managing configuration settings within your Python applications.

Features

  • Easy Configuration Loading: Configureout allows you to load configuration settings from JSON files with just a few lines of code.
  • Nested Configuration Support: Easily access nested configuration settings using dot notation.
  • Flexible and Extensible: The module can be easily extended to suit your specific needs, allowing for customization and flexibility.
  • Pythonic Interface: Configureout provides a Pythonic interface for accessing configuration settings, making it easy to integrate into your projects.

Installation

You can install configureout via pip:

pip install configureout

Usage

from configureout import Config

# Load configuration from a JSON file
config = Config("config.json")

# Access configuration settings
print(config.setting_name)
print(config.section.subsection.another_setting)

Example

Consider the following JSON configuration file ('config.json'):

{
  "database": {
    "host": "localhost",
    "port": 5432,
    "username": "user",
    "password": "password"
  },
  "logging": {
    "level": "info",
    "file_path": "/var/log/app.log"
  }
}

With configureout, you can easily load and access these settings in your Python code:

from configureout import Config

config = Config("config.json")

# Access database host
print(config.database.host)

# Access logging level
print(config.logging.level)

License

This project is licensed under the MIT License

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

configureout-1.5.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file configureout-1.5.tar.gz.

File metadata

  • Download URL: configureout-1.5.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for configureout-1.5.tar.gz
Algorithm Hash digest
SHA256 a01246d050fd73dc73db0ba957806416fb13b84f7a3f0a6a979c3817e2c12898
MD5 0b5952b22d5b72ff6513d6a63bd5548f
BLAKE2b-256 2fcbb3ab4145da386c6187d4c0320019b77b67eaf0353375c4875705c27b45e6

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