Skip to main content

.gitignore file parser

Project description

nr.gitignore

A simple .gitignore pattern parser and matcher.

Example Usage

import os
import nr.gitignore
patterns = nr.gitignore.parse()
for root, dirs, files in nr.gitignore.walk(patterns, '.'):
  # ...
import nr.gitignore
ignore = nr.gitignore.IgnoreList()
ignore.parse(['__pycache__', 'dist'])
assert ignore.match('./dist/module-1.0.0.tar.gz') == nr.gitignore.MATCH_IGNORE

Copyright © 2018 Niklas Rosenstein

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

nr.gitignore-1.0.0.tar.gz (5.3 kB view hashes)

Uploaded Source

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