confection
The sweetest config system for Python
Decision gist · record as of 2026-08-14
Yes. Confection is actively maintained, has no known vulnerabilities, and installs with minimal friction. It is well-suited for machine-learning and complex application configuration where you need to avoid tight coupling between configuration and function signatures. The MIT license imposes no restrictions. Install it if you are building systems where configuration complexity and versioning matter; skip it for simple flat-file or environment-variable configuration.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Registry-based function instantiation requires the catalogue package to be installed separately.
- Installation is straightforward with low friction—a pure Python wheel with only typing_extensions as a runtime dependency.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects without licensing concerns.
last release 2026-03-24 (143 days) · last repo commit 2026-03-27 · 193 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 20,544,828 downloads/mo, #1,033 on PyPI
Alternatives
Verify before relying
pip install confection
from confection import Config
config = Config({"training": {"patience": 10, "dropout": 0.2}})
# or load from disk:
# config = Config().from_disk("./config.cfg")
print(config)- Whether catalogue integration is required for all use cases or optional for registry functionality
- Performance characteristics when parsing large or deeply nested configuration files
- Backward compatibility guarantees across minor version updates
What it is and what it does
Confection solves the problem of managing complex, nested configurations in Python applications—especially machine-learning projects where hyperparameters and component settings need to be exposed without breaking intermediate function interfaces. It parses `.cfg` files using an INI-like format enhanced with JSON-typed values, dot-notation for nested sections, and cross-section variable references using `${section.key}` syntax. The package also integrates with function registries (via decorators) to instantiate configured objects with type validation.
You define configuration blocks in a `.cfg` file, load them with `Config().from_disk()`, resolve them through a registry, and receive a dictionary of initialized objects or plain settings. The system is designed to let you version functions and change defaults without breaking backward compatibility—a key concern when configuration becomes part of your API surface.
Use it for
- Define machine-learning training pipelines with shared hyperparameters across multiple components using cross-section references.
- Manage optimizer, model, and data-loader configurations for deep-learning projects without hardcoding parameters.
- Build CLI or REST API applications where configuration needs to flow through many intermediate functions without modifying their signatures.
- Version function implementations in a registry so improvements can be deployed without breaking existing configuration files.
- Parse and validate complex nested object hierarchies from configuration files with automatic type checking against function signatures.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Confection is actively maintained, has no known vulnerabilities, and installs with minimal friction. It is well-suited for machine-learning and complex application configuration where you need to avoid tight coupling between configuration and function signatures. The MIT license imposes no restrictions. Install it if you are building systems where configuration complexity and versioning matter; skip it for simple flat-file or environment-variable configuration.
Install
confection on PyPI
Before you install
Installation is straightforward with low friction—a pure Python wheel with only typing_extensions as a runtime dependency. The package is actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.10 or later. Registry-based function instantiation requires the catalogue package to be installed separately.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects without licensing concerns.
Quickstart
pip install confection
from confection import Config
config = Config({"training": {"patience": 10, "dropout": 0.2}})
# or load from disk:
# config = Config().from_disk("./config.cfg")
print(config)
Verify before relying
- Whether catalogue integration is required for all use cases or optional for registry functionality
- Performance characteristics when parsing large or deeply nested configuration files
- Backward compatibility guarantees across minor version updates
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping_extensions |
| Maintenance | Actively maintained 143 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 20,544,828 / month, #1,033 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering |
Evidence: confection-1.3.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
An agent finds packages by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language. Give your agent the search over MCP.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also config-formatter · gin-config · catalogue · INITools · commented-configparser · imperfect · draccus · configobj · ConfigUpdater · python-box