1. Structure
PyDonfig files use a hierarchical structure consisting of sections and key-value pairs.
Sections: Represented by identifiers followed by a colon (:
).
device:
Key-Value Pairs: Defined using the format key > value
.
macAddress > "00:00:00:00:00:00"
2. Comments
Comments are prefixed with //
. Anything after //
is ignored during parsing.
// This is a comment
Example PyDonfig File (config.pydl
)
// Device configuration
device:
macAddress > "00:00:00:00:00:00"
btAddress > "00:00:00:00:00:00"
// Traceroute blocking
traceroute:
block > true
6. Benefits of PyDonfig
- Human-Readable: Simple syntax for quick configuration changes.
- Lightweight: No external libraries or parsers needed.
- Extensible: Easy to modify and adapt to additional use cases.
- Seamless Integration: Works directly with Python scripts, just like standard config files.