Skip to main content

ManageConfig

PyPI Python License

Tiny, practical config loader that turns JSON and YAML into dot-access objects. Designed for scripts, CLIs, and small services that want clean config access without a heavy dependency tree.

Highlights

  • Dot access for nested config values (conf.db.host)
  • JSON and YAML support with a single API
  • Lightweight, no magic beyond clean attribute access
  • Friendly to scripts and small apps

Install

pip install manageconfig

Quickstart

from manageconfig import Config

conf = Config.load_from_yml("config.yml")

print(conf.string2)
print(conf.string1)

# Prints "localhost"
print(conf.mysqldatabase.hostname)

# i == 3013
i = conf.mysqldatabase.port + 1

Use Cases

  • Project settings loaded once and reused across modules
  • Local dev secrets and per-environment configuration
  • Lightweight config handling in CLI tools

Example Config (YAML)

# comment syntax

# basic syntax - key and value separated by colon and space before the value
key: value

# Scalar data types
integerValue: 1                     # integer value
floatingValue: 1                     # floating value

stringValue: "456"                  # string with double quotes
stringValue: 'abc'                   # string with single quotes
stringValue: wer                     # string without quotes

booleanValue: true                   # boolean values - true or false

# Multiline string with literal block syntax - preserved new lines
string1: |
  Line1
  line2
  "line3"
  line4

# Multiline strings with folded block syntax - new lines are not preserved,
# leading and trailing spaces are ignored
string2: >
  Line1
  line2
  "line3"
  line4

# Collection sequence data types
arraylist:
  - One
  - two
  - Three

arraylist2: [one, two , three]

mysqldatabase:
  hostname: localhost
  port: 3012
  username: root
  password: root

JSON Support

Use Config.load_from_json("config.json").

API

  • Config.load_from_yml(path) loads YAML into a dot-access object
  • Config.load_from_json(path) loads JSON into a dot-access object

Testing

tox

Release files for manageconfig 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manageconfig 1.1.2
File Size Uploaded
manageconfig-1.1.2.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manageconfig 1.1.2
File Interpreter ABI Platform
manageconfig-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / manageconfig-1.1.2.tar.gz

Download URL manageconfig-1.1.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
44932cf260c2d359342e81792ed6e0b6b5db402aba030767bf4fe5e2078703dd
BLAKE2b-256 checksum
How to use checksums
82486f1b7a6be2fb05a72e399ba4a4cc17fd992582294c4270fe27307f5ba560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / manageconfig-1.1.2-py3-none-any.whl

Download URL manageconfig-1.1.2-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c48edbd7a3cd6a09d05a2f06999c088660723dc73f9b9e93cf12a83ffac9403
BLAKE2b-256 checksum
How to use checksums
bf9c4170dd804f2942396aab6cb4015b1cbcd67e9eac2caac59460c2d4267f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page