最适合 Github API v3 的 Python 库 [英] Most suitable python library for Github API v3

查看:27
本文介绍了最适合 Github API v3 的 Python 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找适合我的 Github APIv3 的 Python 库.

I am looking for a python library for the Github APIv3 suitable for me.

我发现了(python-github3)://developer.github.com/v3/libraries/" rel="noreferrer">GH API 文档.在 ipython 中玩了一两个小时后,我发现探索/使用它真的很不直观.我又看了一些,发现至少有相当多的人试图编写这样一个库.看起来更有前途的(一目了然)是 PyGithub另一个 python-github3,显然与第一个不同.

I found one library (python-github3) mentioned in the GH API docs. After playing around with it in ipython for an hour or two, I found it really unintuitive to explore/work with. I looked some more, and found there's quite a number of people at least attempting to write such a library. The more promising-looking (at a glance) are PyGithub and another python-github3, which apparently is different from the first one.

在接下来的几天里,我在一个又一个图书馆中连续试用图书馆之前,我想问 SO 社区是否有一个公认的、明确的、明显的图书馆选择?

我不喜欢第一个库的是(对我来说)获取数据的不直观方式 - 有些东西作为属性获得,有些作为方法的返回值获得,返回值是一些复杂的对象必须分页和迭代等等.

What I didn't like about the first library was the (to me) unintuitive way to get at data - some things you get as attributes, some you get as return value of a method, that return value is some complicated object which has to be paged and iterated through, etc.

在这方面,PyGithub 乍一看似乎更有吸引力——清楚地向下钻取对象层次结构,然后到达包含您想要的属性的属性:

In that regard, PyGithub looks more attractive at first glance - clearly drill down through an object hierarchy, and then arrive at the attribute containing what you want:

用于 g.get_user().get_repos() 中的 repo:打印 repo.name

那么,有什么智慧珍珠可以分享吗?我知道我没有足够的技能来快速判断图书馆的质量,这就是我转向 SO 社区的原因.

So, any pearls of wisdom to share? I know I don't have skills enough to quickly judge library quality, which is why I'm turning to the SO community.

顺便说一句,我最终使用了 PyGithub.它运行良好,作者非常乐于接受反馈和错误报告.:-)

edit: fwiw, I ended up using PyGithub. It works well, and the author is really receptive for feedback and bug reports. :-)

推荐答案

最后,我最终使用了 PyGithub.它运行良好,作者非常乐于接受反馈和错误报告.:-)

In the end, I ended up using PyGithub. It works well, and the author is really receptive for feedback and bug reports. :-)

(根据我对原始问题的编辑改编,以获得更好的可见性)

这篇关于最适合 Github API v3 的 Python 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆