最近有一个有趣的项目想法,想利用 GitHub API,所以我四处寻找 Python 包装器。在 GitHub 库页面上,我找到了 github3.py
看了他们的文档后
我收到一条错误消息AttributeError: 'GitHub' object has no attribute 'me'
,来自此代码示例
from github3 import login
gh = login('sigmavirus24', password='<password>')
sigmavirus24 = gh.me()
# <User [sigmavirus24:Ian Cordasco]>
print(sigmavirus24.name)
# Ian Cordasco
print(sigmavirus24.login)
# sigmavirus24
print(sigmavirus24.followers_count)
# 4`
我在文档中遗漏了什么吗?还是文档没有更新?
我该如何解决这个问题?我尝试运行dir(gh)
以查看登录对象的属性,但这并没有告诉我太多,并且尝试使用Python 2.7.11
, 和Python 3.4.3
.