# pygit2 — card for AI agents

Python bindings for libgit2 to programmatically interact with Git repositories.

Category: Dev workflow and config · PyPI package `pygit2` · latest version 1.20.1 (checked 2026-11-01)
Install: `pip install pygit2`
License: GPLv2 with linking exception (copyleft)

In your own product (generator, app, hosted service): **conditions**. Strong copyleft: a product you distribute with it must be released under the same license, with its source.

## Warnings
- The license is copyleft (GPLv2 with linking exception): read it before shipping closed-source software or a hosted service.

## Numbers (AgentGid data)
- Gid Score: 37.6 (#3420 of all tools, 245 of 299 in its category)
- Downloads last week: 1,138,809 (as of 2026-11-24), -2.3% over 4 weeks
- GitHub stars: 1,737 (as of 2026-11-24)
- Last push: 2026-11-06

## Often used with
aiohttp 100.0%, AnyIO 100.0%, attrs 100.0%, Beautiful Soup 100.0%, cachetools 100.0%, CFFI 100.0%

## Checked alternatives (same job)
- GitPython: https://agentgid.com/tools/gitpython/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/pygit2/
- Homepage: https://github.com/libgit2/pygit2
- Repository: https://github.com/libgit2/pygit2

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
