Mercurial > iscconf
changeset 34:996ba15ad080
Add a readme file
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Wed, 25 Mar 2015 14:20:52 +0100 |
| parents | 4157bd3df4aa |
| children | 868316dfaa29 |
| files | README.rst |
| diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.rst Wed Mar 25 14:20:52 2015 +0100 @@ -0,0 +1,23 @@ +ISCConf +******* + +ISCConf is a library for parsing ISC configuration files, such as ``dhcp.conf`` +or ``named.conf``. It was written, because the existing libraries couldn't +handle some of the constructs that can be commonly encountered in such files in +practice. I took a pragmatic approach, and added things that are not strictly +in the specification, such as unquoted MAC or IP addresses. The goal was to +have something that can parse our own ``dhcp.conf`` file. + + +Usage +===== + +There is only one function, ``parse``, that takes a single argument, the string +to be parsed, and returns a data structure consisting of nested lists and +dictionaries, representing the parsed data. + +Example:: + import iscconf + + with open("dhcpd.conf", "r") as f: + data = iscconf.parse(f.read())
