{"id":27624379,"url":"https://github.com/dd-dockyard/git-check-ignore","last_synced_at":"2026-04-30T09:34:48.282Z","repository":{"id":289284951,"uuid":"970361220","full_name":"dd-dockyard/git-check-ignore","owner":"dd-dockyard","description":"A Python wrapper around `git` to check filenames against `.gitignore` files","archived":false,"fork":false,"pushed_at":"2025-04-22T16:58:36.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-11T08:50:15.545Z","etag":null,"topics":["git","gitignore","python","python3"],"latest_commit_sha":null,"homepage":"https://dd-dockyard.github.io/git-check-ignore/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dd-dockyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-21T22:36:31.000Z","updated_at":"2025-04-22T16:55:59.000Z","dependencies_parsed_at":"2025-04-22T14:34:39.143Z","dependency_job_id":null,"html_url":"https://github.com/dd-dockyard/git-check-ignore","commit_stats":null,"previous_names":["dd-dockyard/git-check-ignore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dd-dockyard/git-check-ignore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dd-dockyard%2Fgit-check-ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dd-dockyard%2Fgit-check-ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dd-dockyard%2Fgit-check-ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dd-dockyard%2Fgit-check-ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dd-dockyard","download_url":"https://codeload.github.com/dd-dockyard/git-check-ignore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dd-dockyard%2Fgit-check-ignore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","gitignore","python","python3"],"created_at":"2025-04-23T11:38:04.738Z","updated_at":"2026-04-30T09:34:48.266Z","avatar_url":"https://github.com/dd-dockyard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-check-ignore\n\nThis is a wrapper around git's [`check-ignore`](https://git-scm.com/docs/git-check-ignore)\ncommand.\n\nIt can be used to determine if a particular pathname would be ignored by a repository's\n`.gitignore` files. It shells out to `git` to accomplish this. This has the\ndisadvantage that you must have `git` installed and available on your PATH, but has the\nadvantage that this module's results will always agree with `git`'s.\n\n[![Test, build, and publish](https://github.com/dd-dockyard/git-check-ignore/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/dd-dockyard/git-check-ignore/actions/workflows/publish.yml)\n\n## Installation\n\n`git-check-ignore` can be [installed from PyPI](https://pypi.org/project/git-check-ignore/):\n\n```sh\npip install git-check-ignore\n```\n\n## Documentation\n\nDocumentation can be found at \u003chttps://dd-dockyard.github.io/git-check-ignore/\u003e\n\nThe source code can be found at \u003chttps://github.com/dd-dockyard/git-check-ignore\u003e\n\n## Example Usage\n\nThe `ignored_pathnames` and `not_ignored_pathnames` functions are the simplest way to use this module.\nGiven a list of names, they iterate through the names that would or would not be ignored by `git`:\n\n```python\nfrom git_check_ignore import ignored_pathnames, not_ignored_pathnames\n\nfor ignored in ignored_pathnames(\"README.md\", \"foo.py\", \"bar.py\"):\n    print(f\"{ignored} is ignored\")\n\nfor not_ignored in not_ignored_pathnames(\"README.md\", \"foo.py\", \"bar.py\"):\n    print(f\"{not_ignored} is not ignored\")\n```\n\nThe `ignored_paths` and `not_ignored_paths` functions are the same, but return [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) objects:\n\n```python\nfrom git_check_ignore import ignored_pathnames, not_ignored_pathnames\n\nfor ignored in ignored_paths(\"README.md\", \"foo.py\", \"bar.py\"):\n    if ignored.exists():\n        print(f\"{ignored} is ignored and exists\")\n\nfor not_ignored in not_ignored_paths(\"README.md\", \"foo.py\", \"bar.py\"):\n    if not_ignored.exists():\n        print(f\"{not_ignored} is not ignored and exists\")\n```\n\nThe `git_check_ignore` function provides the most information, and allows you to determine which `.gitignore` pattern matched a particular pathname:\n\n```python\nfrom git_check_ignore import git_check_ignore\n\nfor r in git_check_ignore(\"README.md\", \"foo.py\", \"bar.py\"):\n    if r.ignored:\n        print(f\"{r.pathname} is ignored\")\n    if r.match:\n        print(f\"matched {r.match.pattern} at line {r.match.linenum} of {r.match.source}\")\n```\n\n## License\n\nThis software is provided under the terms of the [AGPL 3.0](https://www.gnu.org/licenses/agpl-3.0.txt) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdd-dockyard%2Fgit-check-ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdd-dockyard%2Fgit-check-ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdd-dockyard%2Fgit-check-ignore/lists"}