Skip to main content

A Python library for filtering files and directories based on patterns.

Project description

ignorify

ignorify is a Python library that provides functionality similar to .gitignore for filtering files and directories based on patterns.

License PyPI Version Documentation GitHub Issues Contributors

Installation

You can install the ignorify library using pip:

pip install ignorify

Features

  • Filter files and directories based on patterns.
  • Support for both library usage and command-line interface (CLI).

Usage

Library Usage

Here's a simple example of how to use the ignorify library in your Python script:

from ignorify.ignorify import Ignorify

def main():
    custom_ignore_file = ".myignore"  # Change to your desired ignore file name
    ignorify = Ignorify(ignore_file=custom_ignore_file)
    filtered_items = ignorify.filter()

if __name__ == "__main__":
    main()

Command-Line Interface (CLI)

You can also use the ignorify library from the command line. To filter files and directories using the CLI, run the following command:

ignorify-cli --root <root_path> --ignore-file <ignore_file>

Replace <root_path> with the desired root path for filtering (default is the current directory), and <ignore_file> with the name of the ignore file (default is .gitignore).

For example, to filter files in the current directory using an ignore file named .myignore, you can use the following command:

ignorify-cli --ignore-file .myignore

Documentation

You can find more detailed information and usage examples in the official documentation.

Testing

You can run the tests using the following command:

python -m unittest discover tests

Contributing

Contributions are welcome! If you have ideas, suggestions, or bug reports, please open an issue or submit a pull request.

License

This project is licensed under GPLv3 - see the LICENSE file for details.

Contact

If you have any questions or feedback, feel free to reach out to me at jaer.q@protonmail.com.

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

ignorify-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file ignorify-0.1.0.tar.gz.

File metadata

  • Download URL: ignorify-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for ignorify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b940ffad1b85d9ce144f3ace5968241b4f5505f25b6c11168b5b9f19d5bb3c20
MD5 c7c71ec9f9c6b6d3407a28f3caf01cea
BLAKE2b-256 3f29b7c466dd53cb3791a9a621a86304cf49921dab54bff9e860b79bd6ee5531

See more details on using hashes here.

Supported by

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