【问题标题】:Is it possible to access the 'Releases' Tag via PyGithub? [closed]是否可以通过 PyGithub 访问“发布”标签? [关闭]
【发布时间】:2015-09-30 12:41:19
【问题描述】:

我尝试通过 PyGithub API 导航到 Github 中特定存储库的发布标签。我只能导航到存储库,但无法进一步导航。 PyGithub API 中有命令吗?

更新

或者是否有其他 Python API 可以满足我的需求?

【问题讨论】:

标签: python api github-api pygithub


【解决方案1】:

据我所知,很多基于 python 的 github 客户端库并不支持所有 github api 端点,包括发布。但是,github3 库在其 master 分支上运行。用pip install https://github.com/sigmavirus24/github3.py/zipball/master安装它

以下是其用法的功能示例:

from github3 import GitHub
gh = GitHub()
releases = gh.repository("github", "git-lfs").iter_releases()
for release in releases:
  for asset in release.assets:
    print "Release %s: %s" % (release.name, asset.name)

【讨论】:

  • 是否有可能通过 github3 api 过滤编码语言,例如只获取用 C 或 Python 编码的存储库?
猜你喜欢
  • 2011-04-06
  • 2013-12-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-11
  • 2012-10-27
  • 2023-01-23
  • 1970-01-01
相关资源
最近更新 更多