### Installing puppetparser with pip (Shell) Source: https://github.com/nfsaavedra/puppetparser/blob/main/README.md Command to install the puppetparser library using the pip package manager. Requires pip to be installed on the system. ```Shell pip install puppetparser ``` -------------------------------- ### Installing puppetparser with Poetry (Shell) Source: https://github.com/nfsaavedra/puppetparser/blob/main/README.md Command to install project dependencies using the Poetry dependency manager. This method requires Poetry to be installed and the repository to be cloned locally. ```Shell poetry install ``` -------------------------------- ### Parsing a Puppet file (Python) Source: https://github.com/nfsaavedra/puppetparser/blob/main/README.md Demonstrates how to use the library to parse a Puppet script file. It imports the 'parse' function (though uses 'parse_puppet' in the example) and reads the file content to pass to the parser function, which returns the parsed script object and associated comments. ```Python from puppetparser.parser import parse with open(path) as f: parsed_script, comments = parse_puppet(f.read()) ``` -------------------------------- ### Running tests (Shell) Source: https://github.com/nfsaavedra/puppetparser/blob/main/README.md Command to execute the project's unit tests. It uses Python's built-in 'unittest' module to discover and run tests located within the 'tests' directory. ```Shell python3 -m unittest discover tests ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.