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.
  • treadful@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 months ago

    Dulwich is decent. Has some good porcelain functions. But it’s organized kind of weird. I sort of recall it’s the only one that isn’t a wrapper on the git CLI?

    Anyway, they all kind of suck in my experience.