skillfed

gin-config

Gin-Config: A lightweight configuration library for Python

gin-config v0.5.0 578.7K downloads/30d#5,922 on PyPI2,154
Permissive license Apache 2.0 Active released

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-config

uv

uv add gin-config

poetry

poetry add gin-config

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

python configuration frameworkdependency injection configfunction parameter configurationmachine learning experiment configgin config decoratorconfig file parameter injectionexperiment hyperparameter management
configuration-managementdependency-injectionml-experiments

More Software Development packages