skillfed

anyconfig

Library provides common APIs to load and dump configuration files in various formats

anyconfig v0.16.0 544.9K downloads/30d#6,079 on PyPI288
Permissive license MIT Active released

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 anyconfig

uv

uv add anyconfig

poetry

poetry add anyconfig

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: MarkupTopic :: Utilities

Tags

multi-format config file loaderyaml json ini toml parserconfiguration file mergeconfig validation schematemplate-based config renderingjinja2 config templatesconfiguration query jmespath
config-managementmulti-formatschema-validation

More Python Modules packages