Parses nginx configuration with Pyparsing
Latest commit cb4a86f Jun 1, 2016 @fatiherikli Merge pull request #24 from pjstevns/master
fix test plus some minor improvements

Nginx Configuration Parser

An nginx configuration parser that uses Pyparsing.

You can parse a nginx configuration file with load or loads method:

>>> from nginxparser import load
>>> load(open("/etc/nginx/sites-enabled/foo.conf"))

 [['server'], [
    ['listen', '80'],
    ['server_name', ''],
    ['root', '/home/ubuntu/sites/foo/']]]]

Same as other serialization modules also you can export configuration with dump and dumps methods.

>>> from nginxparser import dumps
>>> dumps([['server'], [
            ['listen', '80'],
            ['server_name', ''],
            ['root', '/home/ubuntu/sites/foo/']]])

'server {
    listen   80;
    root /home/ubuntu/sites/foo/;