kconfiglib
A flexible Python Kconfig implementation
What it is and what it does
Kconfiglib is a complete Kconfig parser and implementation written in pure Python, designed to replace or supplement the C-based Kconfig tools used in Linux kernel builds and embedded systems projects. It parses Kconfig files, evaluates configuration dependencies and constraints, and provides both programmatic access via its library API and interactive command-line interfaces (menuconfig, guiconfig) for editing configurations. The library supports the Kconfig preprocessor syntax, environment variable expansion, and generates C headers from configuration selections—making it suitable for build automation, documentation generation, and embedded system configuration workflows.
The package is self-contained with no third-party dependencies, runs on Python 2.7 and 3.2+, and is used in production by major projects like Zephyr RTOS, ESP-IDF, and ACRN. It includes a suite of command-line utilities (oldconfig, defconfig, allnoconfig, genconfig, setconfig, and others) that mirror the behavior of traditional Kconfig tools, allowing developers to script configuration workflows or integrate Kconfig handling into custom build systems.
Use it for:
- Parse and programmatically query Kconfig files in embedded firmware projects to extract symbol definitions and dependencies.
- Generate C configuration headers at build time from Kconfig selections using the genconfig utility.
- Provide an interactive terminal or GUI menuconfig interface for end-users to configure embedded systems or kernel options.
- Automate configuration management in CI/CD pipelines by setting or validating Kconfig symbols via the setconfig or oldconfig utilities.
- Generate Kconfig cross-reference documentation by leveraging the library's robust parser instead of brittle ad-hoc text parsing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Kconfiglib is a Python implementation of the Kconfig configuration language used in Linux kernel builds and embedded systems, providing both a library API and command-line tools for parsing, generating, and interactively editing Kconfig files.
Yes, if you work with Kconfig files in embedded systems, kernel builds, or projects using Zephyr, esp-idf, or similar frameworks. The package is production-stable, dependency-free, and widely trusted. No, if you require active maintenance or compatibility guarantees with the latest kernel versions—the last release was January 2020 and maintenance is dormant. For most use cases, the stable feature set and lack of dependencies make it a safe choice despite the age.
Install
kconfiglib on PyPI
pip
pip install kconfiglibuv
uv add kconfiglibpoetry
poetry add kconfiglibInstalling kconfiglib
Before you install
Low friction: pure Python with no runtime dependencies. Dormant maintenance (last release January 2020, last commit September 2023), but the package is marked Production/Stable and widely used by established projects like Zephyr, esp-idf, and ACRN, suggesting it is feature-complete rather than abandoned.
License in practice
ISC license is permissive and poses no restrictions on commercial or proprietary use. You may use, modify, and distribute this package freely with minimal obligations.
Quickstart
pip install kconfiglib
import kconfiglib
kconf = kconfiglib.Kconfig('path/to/Kconfig')
for symbol in kconf.defined_symbols:
print(symbol.name, symbol.str_value)
For terminal menuconfig on Windows, windows-curses must be installed separately (no longer bundled); on other platforms, curses is typically available in the standard library.
Verify before relying
- Whether the dormant maintenance status (2+ years since last release) affects compatibility with recent Linux kernel versions or modern Python environments.
- Current test coverage and whether the package is actively tested against Python 3.9+.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=2.7,!=3.0.*,!=3.1.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,387 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,376,652/month — #3,985 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kconfiglib-14.1.0-py2.py3-none-any.whl
Keywords: kconfig, kbuild, menuconfig, configuration-management
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
esp-idf-kconfigProvides kconfig language support and IDE…
permissive · top 5,000 on PyPI
kernelsLoads optimized compute kernels from Hugging…
permissive · top 5,000 on PyPI
esp-coredumpRetrieves and analyzes core dumps from ESP32…
permissive · top 5,000 on PyPI
sglang-kernelsglang-kernel provides optimized CUDA compute…
permissive · top 15,000 on PyPI
pyobjc-framework-KernelManagementProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
cpm-kernelsProvides CUDA kernels optimized for CPM,…
permissive · top 15,000 on PyPI
pyconfiguratorParses command-line arguments and INI…
permissive · top 15,000 on PyPI
jupyter-kernel-gatewayJupyter Kernel Gateway is a web server that…
permissive · top 5,000 on PyPI
metakernelMetaKernel is a base class for building custom…
permissive · top 15,000 on PyPI
kcidb-iokcidb-io validates and manipulates Linux Kernel…
copyleft · top 15,000 on PyPI