Parsing named.conf in PyParsing Python3 and JSON now available

Petr Špaček pspacek at isc.org
Wed Jun 1 08:22:46 UTC 2022


On 29. 05. 22 22:37, S Egbert wrote:
> 
> oops
> 
> make that this link https://github.com/egberts/bind9_parser 
> <https://github.com/egberts/bind9_parser>
> 
> 
>> On May 29, 2022, at 4:28 PM, S Egbert <s.egbert at sbcglobal.net> wrote:
>>
>> Just a short blurb that I now make parsing named.conf easier in 
>> Pyhton3 using PyParsing module.
>>
>> Through a pythonized variable, one can also generate JSON string.
>>
>> The end-use should be obvious to those who need one, but one of my 
>> case is a large library of named.conf in pythonized form with 
>> capability to change IP, port, and topology on the fly.
>>
>> MIT License
>>
>>
>> Enjoy.
>>
>> https://github.con/egberts/bind9_parser

Very interesting piece of work, thank you for sharing!

Accidentally I was working on something similar, so far limited to 
parsing named.conf and rndc.conf grammars.

Very-much-work-in-progress can be seen here:
https://gitlab.isc.org/isc-projects/bind9/-/blob/pspacek/arm-utils/doc/misc/parsegrammar.py

I think it is a good idea to generalize the code to  consume 
https://gitlab.isc.org/isc-projects/bind9/-/blob/pspacek/arm-utils/doc/misc/options 
files as much as possible because the grammar _is_ changing, albeit 
slowly. It becomes more pressing when migrating between versions etc.

Feel free to approach me if you want to exchange ideas and code!

-- 
Petr Špaček  @  Internet Systems Consortium


More information about the bind-users mailing list