gin-config
Gin-Config: A lightweight configuration library for Python
What it is and what it does
Gin is a configuration framework built on dependency injection principles that lets you externalize function and class parameters into config files rather than hardcoding them. You decorate functions with @gin.configurable, then supply values via a simple config syntax in files or on the command line. This is especially useful for machine learning experiments where you have many nested parameters that change frequently between runs.
The package has no runtime dependencies and installs cleanly. It's designed to reduce boilerplate around configuration management and parameter passing, making it easier to experiment with different settings without modifying code. The framework is particularly well-suited for projects with complex, hierarchical parameter structures.
Use it for:
- Configure machine learning model hyperparameters from external config files for experiments
- Manage nested configuration for complex applications without writing factory or parameter-plumbing code
- Run the same script with different parameter sets by changing only the config file, not the code
- Share reproducible experiment configurations across team members by version-controlling config files
- Simplify parameter handling by reading structured configuration from files instead of manual argument parsing
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Gin provides a lightweight configuration framework that lets you decorate Python functions and classes to accept parameter values from config files or command-line arguments, eliminating the need for manual configuration object management.
Yes, if you run machine learning experiments or manage complex nested configurations. Gin eliminates boilerplate and makes experiments reproducible and shareable. The permissive Apache 2.0 license and zero runtime dependencies make adoption low-risk. The stable maintenance status is appropriate for a mature configuration library. Install it if parameter management is a pain point in your workflow.
Install
gin-config on PyPI
pip
pip install gin-configuv
uv add gin-configpoetry
poetry add gin-configInstalling gin-config
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with recent commits, though the latest release dates to 2021-11-03, suggesting the project may be in a stable maintenance phase rather than active development.
License in practice
Gin is licensed under Apache 2.0, a permissive license that allows commercial and private use with minimal restrictions, making it safe to adopt in most projects.
Quickstart
pip install gin-config
import gin
@gin.configurable
def train(learning_rate=None, batch_size=None):
pass
gin.parse_config_file('config.gin')
train()
Verify before relying
- Whether the package supports modern Python versions beyond 3.7 (classifiers list only up to 3.7)
- Current maintenance status and whether the 2021 release date indicates active development or stable maintenance mode
- Specific example parameter values for typical machine learning configurations
Package facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,745 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 578,677/month — #5,922 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gin_config-0.5.0-py3-none-any.whl
Keywords: gin-config, gin, python, configuration, machine, learning
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fiddleFiddle is a Python-first configuration library…
permissive · top 5,000 on PyPI
prefigureManages run configurations for machine learning…
permissive · top 15,000 on PyPI
confectionConfection is a configuration system for Python…
permissive · top 5,000 on PyPI
in-n-outLightweight dependency injection framework…
permissive · top 15,000 on PyPI
makefunDynamically creates Python functions at runtime…
permissive · top 5,000 on PyPI
picoboxPicobox is a lightweight dependency injection…
permissive · top 15,000 on PyPI
argbindArgBind binds function and class arguments to…
permissive · top 15,000 on PyPI
decopatchDecopatch simplifies writing decorators in…
permissive · top 5,000 on PyPI
simple-diA strictly typed dependency injection library…
permissive · top 15,000 on PyPI
tensorflow-serving-apiProvides Python client APIs to communicate with…
permissive · top 5,000 on PyPI