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 details)

Uploaded Source

File details

Details for the file nr.gitignore-1.0.0.tar.gz.

File metadata

File hashes

Hashes for nr.gitignore-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f0deee7c819d8ce1ae4371fdece278908427402570fd114a2e7007a7a3989886
MD5 5896bc742581cde5af6dc1be22299585
BLAKE2b-256 d828777081d92e25f69b8d49683897917304aa89f06e719c7a13746f7e365ad9

See more details on using hashes here.

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