--- id: donfig version: "0.8.1.post1" license: MIT license_treatment: permissive maintenance: active --- # donfig — Python package for configuring a python package License: permissive · Maintenance: active · Downloads: 6.0M/mo ## 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 above — 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 pip install donfig uv add donfig 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_current - Install friction: low - Maintenance: active - Downloads: 6.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python package configuration management, yaml config loader, environment variable configuration, application settings management, config object for packages, dask-style configuration system, multi-source config loading, configuration-management, yaml-config, library-utility [View on SkillFed](https://skillfed.io/packages/donfig) · [View on PyPI](https://pypi.org/project/donfig/)