skillfed

donfig

Python package for configuring a python package

donfig v0.8.1.post1 6.0M downloads/30d#1,996 on PyPI42
Permissive license MIT Active released

What it is and what it does

Donfig is a configuration library that abstracts away the boilerplate of managing application settings across multiple sources. It originated from the dask library's configuration system and provides a Config object that can be instantiated per package to centralize settings management. The library automatically loads configuration from environment variables (prefixed with the config object's name in uppercase), YAML files in standard system locations (~/.config, /etc, sys.prefix/etc), and programmatic calls. This multi-source approach lets developers and users configure applications without modifying code, using whichever method fits their workflow.

The package is lightweight, depending only on pyyaml, and supports context managers for temporary configuration changes. It's designed to be embedded in other packages rather than used standalone, making it useful for library authors who want to offer their users flexible configuration without building a custom system.

Use it for:

  • Embed configuration management in a data science or scientific Python package without building custom config logic.
  • Allow users to override package settings via environment variables in containerized or cloud deployments.
  • Load application defaults from YAML files in standard system locations, with user overrides in home directories.
  • Provide temporary configuration changes within a code block using context managers without global state pollution.
  • Centralize package-wide settings in a single Config object accessible throughout a codebase.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Donfig provides a unified configuration system for Python packages, supporting programmatic setup, environment variables, and YAML files from standard locations.

Yes. Donfig is a lightweight, actively maintained library with no known vulnerabilities, a permissive MIT license, and low install friction. It solves a real problem—multi-source configuration management—that library authors would otherwise implement themselves. Suitable for any Python package that needs flexible user-facing configuration.

Install

donfig on PyPI

pip

pip install donfig

uv

uv add donfig

poetry

poetry add donfig

Installing donfig

Before you install

Low install friction with a single pure-Python dependency (pyyaml). Actively maintained with recent commits; last release was in 2024-05-23 and the repository remains active.

License in practice

MIT license (permissive) allows use in commercial and proprietary projects with minimal restrictions; original dask code also acknowledged under its prior license.

Quickstart

pip install donfig

from donfig import Config
config = Config('mypkg')
config.set(important_key=5)
value = config.get('important_key')

Requires Python 3.8 or later.

Verify before relying

  • Whether the package handles complex nested YAML structures or has limitations on config depth.
  • Performance characteristics when loading large configuration files or managing many config keys.
  • Thread-safety guarantees for concurrent access to the Config object.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pyyaml
Maintenance actively maintained — 813 days since the last release
Last repo commit
First released
Downloads 5,985,314/month — #1,996 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: donfig-0.8.1.post1-py3-none-any.whl

Keywords: task-scheduling, parallel, numpy, pandas, pydata

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Scientific/Engineering

Tags

python package configuration managementyaml config loaderenvironment variable configurationapplication settings managementconfig object for packagesdask-style configuration systemmulti-source config loading
configuration-managementyaml-configlibrary-utility

More Scientific/Engineering packages