Skip to main content

A parser from Puppet to an object model

Project description

puppetparser

puppetparser is a Python library to parse Puppet scripts. This parser allows the transformation of a Puppet script into an object model that represents the constructs of the Puppet DSL language.

Installation

To install run:

pip install puppetparser

Or clone the GitHub repository and run:

poetry install

Usage

from puppetparser.parser import parse

with open(path) as f:
    parsed_script, comments = parse_puppet(f.read())

Tests

To run the tests:

python3 -m unittest discover tests

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

puppetparser-0.2.12.tar.gz (23.5 kB view hashes)

Uploaded Source

Built Distribution

puppetparser-0.2.12-py3-none-any.whl (24.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page