Skip to content

Commit 4536565

Browse files
committed
docs: convert README to markdown, add ChangeLog and .gitignore
- Convert README to README.md with proper markdown formatting - Add ChangeLog.md for release notes - Add .gitignore to exclude build artifacts
1 parent 83cb4c7 commit 4536565

4 files changed

Lines changed: 137 additions & 58 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ pylibconfig.egg-info
33
*.bak
44
*.swp
55
*.pyc
6+
build/
7+
dist/
8+
*.so
9+
*.conf
10+
*.deb
11+
build_*/

ChangeLog.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# ChangeLog
2+
3+
## [0.2.1] — 2026-05-16
4+
5+
### Fixed
6+
- Fix version guards for multi-version libconfig compatibility (1.1.x ~ 1.8.x)
7+
- Fix `isString()` implementation to use `getType()` instead of non-existent API
8+
9+
## [0.2.0] — 2026-05-15
10+
11+
### Added
12+
- Upgrade to support libconfig 1.1.x ~ 1.8.x
13+
- Export `Setting` class with full API
14+
- Add type-safe lookup methods (`lookupInt`, `lookupString`, `lookupFloat`, `lookupBool`, `lookupInt64`)
15+
- Add options API (`setOption`, `getOption`, `setOptions`, `getOptions`)
16+
- Add format control (`setDefaultFormat`, `getDefaultFormat`)
17+
- Add `setFloatPrecision`, `setTabWidth`, `setAutoConvert`, `clear`
18+
- Export type/format/option constants
19+
- Add GitHub Actions CI/CD workflows
20+
21+
### Changed
22+
- Use `setValue` with Python type introspection dispatching
23+
24+
### Fixed
25+
- Fix `children()` shadowed declaration
26+
- Fix `setValue` type dispatch for unsigned int
27+
- Fix `add*` methods with empty path (use root setting)
28+
29+
## [0.0.4] — 2016-02-28
30+
31+
### Added
32+
- Add `addList` support
33+
34+
## [0.0.3] — 2015-08-15
35+
36+
### Added
37+
- Add `readString()` support with libconfig version checking
38+
39+
## [0.0.2] — 2014-06-10
40+
41+
### Fixed
42+
- Fix boost_python library detection (default to libraries if not found)
43+
- Fix Linux Mint 16 + Python 2.7 compatibility
44+
- Fix Fedora 20 build
45+
46+
## [0.0.1] — 2010-04-16
47+
48+
### Added
49+
- Initial release
50+
- Basic `Config` bindings via Boost.Python
51+
- Read/write/add/setValue/value operations
52+
- DEB and RPM packaging

README

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# python-libconfig
2+
3+
Python bindings to the C++ library libconfig (1.1.x ~ 1.8.x)
4+
5+
## Installation
6+
7+
First install libconfig and its development files.
8+
9+
**Fedora/RHEL:**
10+
11+
```sh
12+
dnf install libconfig libconfig-devel python3-devel boost-devel gcc-c++
13+
```
14+
15+
**Debian/Ubuntu:**
16+
17+
```sh
18+
apt-get install libconfig++-dev python3-dev libboost-python-dev g++
19+
```
20+
21+
**openSUSE:**
22+
23+
```sh
24+
zypper install libconfig-devel python3-devel boost-devel gcc-c++
25+
```
26+
(available in the Packman repository)
27+
28+
On other platforms, compile libconfig from source:
29+
30+
```sh
31+
wget http://www.hyperrealm.com/libconfig/libconfig-1.8.2.tar.gz
32+
tar -zxf libconfig-1.8.2.tar.gz
33+
cd libconfig-1.8.2
34+
export MYPREFIX=/usr
35+
# or if you lack privileges for making system-wide changes:
36+
# export MYPREFIX=$HOME/local
37+
./configure --prefix=$MYPREFIX
38+
make
39+
make install
40+
```
41+
42+
To install this module, run the following commands:
43+
44+
```sh
45+
python3 setup.py build
46+
python3 setup.py install
47+
```
48+
49+
## Usage
50+
51+
```python
52+
from pylibconfig import Config, TYPE_INT, TYPE_STRING, FORMAT_HEX
53+
54+
cfg = Config()
55+
cfg.readFile("example.cfg")
56+
57+
# Lookup with type-safe defaults
58+
name = cfg.lookupString("name", "unknown")
59+
port = cfg.lookupInt("port", 8080)
60+
61+
# Setting objects
62+
root = cfg.getRoot()
63+
setting = cfg.lookup("server.host")
64+
print(setting.getName(), setting.getType(), setting.getPath())
65+
66+
# Options (libconfig 1.8+)
67+
from pylibconfig import OPTION_FSYNC
68+
cfg.setOption(OPTION_FSYNC, True)
69+
70+
# Format control
71+
from pylibconfig import FORMAT_HEX
72+
cfg.setDefaultFormat(FORMAT_HEX)
73+
```
74+
75+
## Copyright and Licence
76+
77+
Copyright (C) 2010-2026 Cnangel
78+
79+
This program is released under the following license: bsd

0 commit comments

Comments
 (0)