skillfed

libconf

A pure-Python libconfig reader/writer with permissive license

libconf v2.0.1 167.9K downloads/30d#10,459 on PyPI28
Permissive license MIT Abandoned released

What it is and what it does

Libconf is a pure-Python reader and writer for libconfig format files, which are configuration files commonly used in C/C++ projects. It provides four main methods—load(), loads(), dump(), and dumps()—modeled directly after Python's json module, making it familiar to Python developers. The library parses libconfig syntax into Python dictionaries and tuples, allowing access to configuration values via both dictionary indexing and attribute notation.

The package handles the nuances of libconfig's type system, including the distinction between 32-bit and 64-bit integers, and between lists (Python tuples) and arrays (Python lists). It supports character encoding with escape sequence handling and provides wrapper classes (LibconfInt64, LibconfList, LibconfArray) for fine-grained control over output formatting when writing configuration files back to disk.

Use it for:

  • Parse configuration files from C/C++ applications into Python for programmatic access or modification
  • Generate libconfig-formatted configuration files from Python data structures for use by C/C++ programs
  • Migrate or convert libconfig files between different systems or applications that use the format
  • Read and validate libconfig settings in Python-based deployment or configuration management tools

Worth the install?

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

Reads and writes configuration files in libconfig format, a format commonly used in C/C++ projects, with an API modeled after Python's json module.

Yes, if you need to work with libconfig format files and can accept that the package is no longer maintained. The library is stable, has no dependencies, installs cleanly, and carries no known vulnerabilities. However, any bugs or compatibility issues with future Python or libconfig versions will not be addressed.

Install

libconf on PyPI

pip

pip install libconf

uv

uv add libconf

poetry

poetry add libconf

Installing libconf

Before you install

Installation is straightforward with no runtime dependencies. However, the package has been abandoned since its last release on 2019-11-21, with no maintenance activity since.

License in practice

Licensed under MIT (permissive), so there are no restrictions on commercial or proprietary use.

Quickstart

import libconf

# Read a libconfig file
with open('example.cfg') as f:
    config = libconf.load(f)

# Access values via indexing or attributes
print(config['window']['title'])
print(config.window.title)

# Write configuration
output = libconf.dumps({'size': [10, 15], 'flag': True})
print(output)

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the latest tested version)
  • Current compatibility with modern libconfig C library versions and any breaking changes in the libconfig format since 2019-11-21

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,458 days since the last release
Last repo commit
First released
Downloads 167,934/month — #10,459 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: libconf-2.0.1-py2.py3-none-any.whl

Keywords: libconfig, configuration, parser, library

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries :: Python Modules

Tags

libconfig format parserconfiguration file reader writerc++ config file pythonlibconfig python libraryparse libconfig files
config-parserlibconfig

More Python Modules packages