skillfed

kconfiglib

A flexible Python Kconfig implementation

kconfiglib v14.1.0 1.4M downloads/30d#3,985 on PyPI514
Permissive license ISC DORMANT released

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 kconfiglib

uv

uv add kconfiglib

poetry

poetry add kconfiglib

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Operating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Build ToolsTopic :: System :: Operating System Kernels :: Linux

Tags

kconfig parser pythonkernel configuration managementmenuconfig terminal interfacekbuild configuration toolembedded system configkconfig implementationconfiguration file generation
kconfig-parserembedded-systemsbuild-automation

More Build Tools packages