21
What Git library to choose? (discuss.tchncs.de)
submitted 1 month ago by [email protected] to c/[email protected]

I happen to write a lot of python code dealing with git repositories. Currently I am calling the git command line tool from python and interpret the output.

This solution really doesn't scale well. Can you recommend a python library that wraps git functionality?

I have found three:

  • GitPython: Seems to work well, but it is in maintenance mode, unlikely to be improved. It also does not have any type hints making working with it annoying.
  • pygit2: Seems well supported and has type hints. But it also seems very low level and pretty tedious to use.
  • dulwich: Looks very promising feature wise but I'm unsure how well it is supported. It seems like an ambitious project being largely done by just one person.
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 4 points 1 month ago

I read through the docs of pygit2, how is it too low level compared to using direct console output?

if you need complex workflows, couldn't they be built over the convenience of the library?

[-] [email protected] 5 points 1 month ago

Maybe pygit2 is indeed the way to go. When I looked into it a while back it looked very low level like it only implemented the git plumbing. But maybe I looked at the wrong part of the docs, because it doesn't look too bad.

this post was submitted on 07 Jun 2024
21 points (88.9% liked)

Python

5976 readers
9 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS