All Projects → mherrmann → Gitignore_parser

mherrmann / Gitignore_parser

Licence: mit
A spec-compliant gitignore parser for Python 3.5+

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Labels

Projects that are alternatives of or similar to Gitignore parser

untracked
Universal way for ignoring unnecessary common files to fit your bundle
Stars: ✭ 26 (-54.39%)
Mutual labels:  gitignore
Node Ignore
🔍 node-ignore is the manager and filter for .gitignore rules, the one used by eslint, prettier and many others.
Stars: ✭ 299 (+424.56%)
Mutual labels:  gitignore
Gitignore
The largest collection of useful .gitignore templates
Stars: ✭ 839 (+1371.93%)
Mutual labels:  gitignore
gitignore.plugin.zsh
ZSH plugin for creating .gitignore files.
Stars: ✭ 44 (-22.81%)
Mutual labels:  gitignore
alfred-gitignore
Create .gitignore files using Alfred
Stars: ✭ 15 (-73.68%)
Mutual labels:  gitignore
Add Gitignore
An interactive CLI tool that adds a .gitignore to your projects.
Stars: ✭ 467 (+719.3%)
Mutual labels:  gitignore
ignore-sync
a CLI tool to build and sync .*ignore files across files and repositories
Stars: ✭ 15 (-73.68%)
Mutual labels:  gitignore
Coala Quickstart
A tool that generates an initial coala config file for you!
Stars: ✭ 47 (-17.54%)
Mutual labels:  gitignore
Joe
🏃 A .gitignore magician in your command line
Stars: ✭ 2,788 (+4791.23%)
Mutual labels:  gitignore
Initior
A command line application that let's you initialize your new projects the right way, replaces npm and yarn's init 🎆
Stars: ✭ 17 (-70.18%)
Mutual labels:  gitignore
gitignore.cli
A commandline tool to create gitignore files
Stars: ✭ 24 (-57.89%)
Mutual labels:  gitignore
mfp-gitignore
.gitignore file for a IBM MobileFirst Platform Foundation (aka Worklight) Project
Stars: ✭ 15 (-73.68%)
Mutual labels:  gitignore
Ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Stars: ✭ 28,564 (+50012.28%)
Mutual labels:  gitignore
helm-gitignore
Helm interface for generating .gitignore files
Stars: ✭ 20 (-64.91%)
Mutual labels:  gitignore
Gitignore
Create .gitignore files from gitignore.io templates
Stars: ✭ 27 (-52.63%)
Mutual labels:  gitignore
vscode-R
R Extension for Visual Studio Code
Stars: ✭ 788 (+1282.46%)
Mutual labels:  gitignore
Vscode R
R Extension for Visual Studio Code (execution, snippet, lint, R documantation, R Markdown)
Stars: ✭ 445 (+680.7%)
Mutual labels:  gitignore
Gogi
Go client for gitignore.io
Stars: ✭ 51 (-10.53%)
Mutual labels:  gitignore
Gitignore
.gitIgnore file for Salesforce or Force.com Projects
Stars: ✭ 27 (-52.63%)
Mutual labels:  gitignore
Gitignore.io
.gitignore.io is a web service designed to help you create .gitignore files for your Git repositories. The site has a graphical and command line method of creating a .gitignore for your operating system, programming language, or IDE.
Stars: ✭ 6,709 (+11670.18%)
Mutual labels:  gitignore

gitignore_parser

CI PyPI version

A spec-compliant gitignore parser for Python

Installation

pip install gitignore_parser

Usage

Suppose /home/michael/project/.gitignore contains the following:

__pycache__/
*.py[cod]

Then:

>>> from gitignore_parser import parse_gitignore
>>> matches = parse_gitignore('/home/michael/project/.gitignore')
>>> matches('/home/michael/project/main.py')
False
>>> matches('/home/michael/project/main.pyc')
True
>>> matches('/home/michael/project/dir/main.pyc')
True
>>> matches('/home/michael/project/__pycache__')
True

Motivation

I couldn't find a good library for doing the above on PyPI. There are several other libraries, but they don't seem to support all features, be it the square brackets in *.py[cod] or top-level paths /....

Contributing

I'm very open to merging PRs. But before you start working on one, please read through my guidelines for PRs. It will save us both time and unnecessary effort.

Attribution

The implementation is based on https://github.com/snark/ignorance/ by Steve Cook.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].