Skip to main content

Hierarchical python configuration with files, environment variables, command-line arguments.

See GitHub for detailed documentation.

Example

from pconf import Pconf
import json

"""
Setup pconf config source hierarchy as:
  1. Environment variables
  2. A JSON file located at 'path/to/config.json'
"""
Pconf.env()
Pconf.file('path/to/config.json', encoding='json')

# Get all the config values parsed from the sources
config = Pconf.get()

# Just print everything nicely
print json.dumps(config, sort_keys=True, indent=4)

Run the above script:

pip install pconf
python example.py

The output should be something like this:

{
    "HOSTNAME": "bb30700d22d8",
    "TERM": "xterm",
    "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "PWD": "/",
    "SHLVL": "1",
    "HOME": "/root",
    "no_proxy": "*.local, 169.254/16",
    "_": "/usr/bin/env",
    "example": {
        "another": "stuff",
        "key": "value"
    }
}

Metadata

Release files for pconf 1.12.0

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

Source distribution (sdist)

Source distribution for pconf 1.12.0
File Size Uploaded
pconf-1.12.0.tar.gz 11.7 kB Details

Built distribution (wheel)

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

Total release size: 19.5 kB

Release files / pconf-1.12.0.tar.gz

Download URL pconf-1.12.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a372f829c255edca5903379ba91402a4374b359c998069b50e1d0c97d9900e2c
BLAKE2b-256 checksum
How to use checksums
74a7837a156810f796dedd1862f9d10b1d9e63ae1ca075ddd6caa42197736a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / pconf-1.12.0-py3-none-any.whl

Download URL pconf-1.12.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73d8f1bffa4e4875aef1588ba304aac75379aa8468c6308d33204a9d90340c10
BLAKE2b-256 checksum
How to use checksums
76164f726f85e80f9e52223daf0861e09cc398c5d5f3763ddd8fe346c6c1d338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

1.12.0 This release

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.1

2 release files

1.8.0

2 release files

1.7.2

2 release files

1.7.1

1 release file

1.7.0

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.4.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.2.0

1 release file

1.0.1

6 release files

1.0.0

0.5.0

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