anyconfig
Library provides common APIs to load and dump configuration files in various formats
What it is and what it does
anyconfig is a Python library that abstracts away the differences between configuration file formats, letting you load, dump, and merge configs using a single set of functions regardless of whether the source is JSON, YAML, TOML, INI, or other formats. It detects format automatically from file extensions or accepts explicit format hints. The library also supports Jinja2 template rendering during load (useful for parameterized configs), JSON schema validation, schema generation from loaded data, and querying results with JMESPath expressions.
The main use case is simplifying application configuration handling: instead of writing separate parsers for each format your app might encounter, you call anyconfig.load() once and get back a dict-like object. It handles merging multiple config files, ignoring missing files, and applying templates—all without requiring you to know or care about the underlying format. A CLI tool (anyconfig_cli) is also provided for command-line config conversion and validation.
Use it for:
- Convert configuration files between formats (JSON to YAML, TOML to INI) without writing custom parsers.
- Merge environment-specific config overlays (base.yml + production.yml + secrets.json) into a single dict.
- Render parameterized configuration templates with Jinja2 before loading, e.g., injecting environment variables.
- Validate loaded configuration against a JSON schema to catch errors early.
- Query nested configuration values using JMESPath expressions without manual dict traversal.
- Generate a JSON schema from a sample config file for documentation or validation of future configs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Loads, dumps, and merges configuration files in multiple formats (JSON, YAML, TOML, INI, etc.) through a unified API, with optional template rendering, schema validation, and query support.
Yes. Zero runtime dependencies, actively maintained, MIT licensed, and supports modern Python versions (3.9–3.13). Use it if you need to handle multiple config formats uniformly or want template rendering and validation baked in. No known security issues. The only caveat is verifying which format parsers are included by default vs. optional.
Install
anyconfig on PyPI
pip
pip install anyconfiguv
uv add anyconfigpoetry
poetry add anyconfigInstalling anyconfig
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance—last commit 2026-08-11, released 3 days ago. Supports Python 3.9 through 3.13.
License in practice
MIT licensed (permissive). No restrictions on commercial use, modification, or redistribution; attribution required.
Quickstart
pip install anyconfig
import anyconfig
# Load config, auto-detect format by extension
conf = anyconfig.load("/path/to/config.yml")
# Load and merge multiple files
conf = anyconfig.load(["/etc/app.json", "/etc/app.local.json"])
# Load with template rendering
conf = anyconfig.load("/path/to/config.yml", ac_template=True, ac_context={"env": "prod"})
Verify before relying
- Which configuration formats (JSON, YAML, TOML, INI, etc.) are supported out-of-the-box vs. requiring optional dependencies.
- Whether optional dependencies for format support (e.g., PyYAML for YAML) are listed separately or bundled.
- Performance characteristics when loading or merging large configuration files.
- Exact behavior and limitations of the JMESPath query feature mentioned in the description.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 544,904/month — #6,079 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: anyconfig-0.16.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
j2clij2cli is a command-line tool that renders…
permissive · top 5,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI
dynamic-yamlAdds dynamic string interpolation to YAML…
permissive · top 15,000 on PyPI
HiYaPyCoLoads and merges multiple YAML configuration…
copyleft · top 15,000 on PyPI
fhconfparserReads configuration files in INI, TOML, or JSON…
permissive · top 15,000 on PyPI
pyymlEmbeds Python expressions directly in YAML…
permissive · top 15,000 on PyPI
parse-errorsWraps parse and validation errors from JSON,…
permissive · top 15,000 on PyPI
crossplaneParses NGINX configuration files into JSON and…
permissive · top 5,000 on PyPI
config-parserMerges configuration from YAML/JSON files,…
agpl · top 5,000 on PyPI
dynaconfDynaconf manages application configuration…
permissive · top 5,000 on PyPI