### Install ripgrepy Package Source: https://github.com/securisec/ripgrepy/blob/master/README.md Installs the ripgrepy Python package using pip. This command ensures you have the library available for use in your Python projects. ```Shell pip install ripgrepy ``` -------------------------------- ### Instantiate Ripgrepy Class Source: https://github.com/securisec/ripgrepy/blob/master/README.md Demonstrates how to create an instance of the Ripgrepy class, specifying the search pattern and the directory to search within. The class takes the regex pattern and the target folder path as arguments. ```Python from ripgrepy import Ripgrepy # The Ripgrepy class takes two arguments. The regex to search for and the folder path to search in rg = Ripgrepy('he[l]{2}o', '/some/path/to/files') ``` -------------------------------- ### Chain Ripgrepy Methods and Run Source: https://github.com/securisec/ripgrepy/blob/master/README.md Shows how to chain ripgrep options using method calls on the Ripgrepy instance, followed by the `run()` method and an output formatter. Options like `--with-filename` and `--line-number` can be applied programmatically. ```Python rg.with_filename().line_number()...run().as_string # the same can be executed using the rg shorthands rg.H().n().run().as_string ``` -------------------------------- ### Equivalent Ripgrep Command Source: https://github.com/securisec/ripgrepy/blob/master/README.md Illustrates the equivalent ripgrep command-line execution for the chained Python method calls. This highlights the direct mapping between the Python interface and the underlying ripgrep functionality. ```Shell rg --with-filename --line-number "he[l]{2}o" /path/to/some/files ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.