skillfed

typed-config

Typed, extensible, dependency free configuration reader for Python projects for multiple config sources and working well in IDEs for great autocomplete performance.

typed-config v2.0.3 84.8K downloads/30d#13,973 on PyPI25
Permissive license MIT DORMANT released

What it is and what it does

typed-config is a configuration reader that maps environment variables and INI files into typed Python classes, enabling IDE autocomplete and type checking on config values. You define your configuration schema as decorated classes with typed keys, then add one or more config sources (environment, INI file, etc.) in priority order. The package reads values lazily on first access and caches them, or you can call read() upfront to fail fast if required values are missing.

The core design emphasizes type information: by specifying a cast function on each key, you get both runtime parsing and IDE type hints. It supports hierarchical configs via group_key, custom section and key names, optional parameters, and defaults. There are no runtime dependencies for Python 3.8+, though Python 3.6–3.7 requires typing_extensions.

Use it for:

  • Load database credentials from environment variables with fallback to a shared INI file, with type-safe access in your application code.
  • Define a multi-level config hierarchy (database, algorithm, logging) as nested classes and read from multiple sources with clear precedence.
  • Validate and parse config values at startup with read() to catch missing required settings before the app starts serving requests.
  • Use IDE autocomplete to discover available config keys while writing application code, avoiding string-based lookups.
  • Build a 12-factor-app-compliant configuration system that prioritizes environment variables over checked-in defaults.

Worth the install?

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

Reads typed configuration from multiple sources (environment variables, INI files) with IDE autocomplete support and zero runtime dependencies.

Yes. typed-config is a solid, low-friction choice for applications that need typed configuration with IDE support and multi-source fallback. The zero runtime dependencies, MIT license, and stable API make it safe to adopt. Dormant maintenance is not a concern given the package's narrow, well-defined scope and lack of known vulnerabilities. Install it if you want type-safe config without heavy frameworks.

Install

typed-config on PyPI

pip

pip install typed-config

uv

uv add typed-config

poetry

poetry add typed-config

Installing typed-config

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant (last release 2024-04-02, 864 days ago), but the repository remains active and the package is stable enough for production use.

License in practice

MIT license is permissive; you can use this package freely in commercial and open-source projects without restriction.

Quickstart

pip install typed-config

# config.py
from typedconfig import Config, key, section
from typedconfig.source import EnvironmentConfigSource

@section('database')
class AppConfig(Config):
    host = key(cast=str)
    port = key(cast=int)

config = AppConfig()
config.add_source(EnvironmentConfigSource())
config.read()

# main.py
from config import config
print(config.host, config.port)

Python 3.6 or above required; Python 3.6–3.7 also requires typing_extensions (not automatically installed).

Verify before relying

  • Whether typing_extensions is automatically installed for Python 3.6–3.7 or requires manual setup
  • Performance characteristics when reading from network-based config sources
  • Whether hierarchical config supports arbitrary nesting depth or has practical limits

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6.0)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 864 days since the last release
Last repo commit
First released
Downloads 84,788/month — #13,973 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: typed_config-2.0.3-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTyping :: Typed

Tags

typed configuration readerconfig management with type hintsenvironment and file configIDE autocomplete configmulti-source configurationPython config parsingstructured config classes
configuration-managementtype-hintsenvironment-variables

More Software Development packages