将github存储库问题导出到标记文件:https://github.com/mattduck/gh2md。

gh2md的Python项目详细描述


PyPITravis

将github存储库的问题转储到单个标记文件中。

还有许多其他项目处理github问题导出 (例如offline-issues),但我不能 找到一个将所有问题、注释和元数据写入一个可读的 文件。

示例导出

导出的文件示例包含在examples directory中。

默认行为是导出所有问题并打开prs。关闭的prs将被忽略。

用法

pope/ob-go运行导出,提示登录mygithubuser

gh2md pope/ob-go ob-go.md --login mygithubuser

sarabander/sicp运行导出,传入令牌:

gh2md sarabander/sicp sicp.md --token myAPItoken

paulirish/git-open运行导出,从环境中提取令牌:

export GITHUB_ACCESS_TOKEN=myAPItoken
gh2md paulirish/git-open git-open.md

shezadkhan137/required运行导出,从文件中提取令牌:

echo myAPItoken > ~/.github-token
gh2md shezadkhan137/required required.md

完全帮助:

$ gh2md -h
usage: gh2md [-h] [-l LOGIN_USER] [-t TOKEN] repo outpath

Export Github repository issues and comments into a single
markdown file. https://github.com/mattduck/gh2md.

Credentials are resolved in the following order:

- The --login flag always takes precedence and will prompt for this user.
- The --token flag.
- A `GITHUB_ACCESS_TOKEN` environment variable.
- An API token stored in `~/.github-token`.

positional arguments:
repo                  Github repo to export, in format "owner/repo_name".
outpath               Path to write exported issues.

optional arguments:
-h, --help            show this help message and exit
-l LOGIN_USER, --login LOGIN_USER
                        Prompt to login as this Github user. If provided, this
                        takes precedence over any token found in the
                        environment. If not provided and no token is found,
                        you will be prompted to login as the repository owner.
-t TOKEN, --token TOKEN
                        Automatically login with this Github API token. If
                        --login is provided, this is ignored.

安装

pip install gh2md。或者,克隆存储库并运行make install

待办事项

  • 提高绩效。当前使用pygithub获取问题很慢-i 假设可以批量获取大部分数据。
  • 添加标志以切换图像的包含。
  • 添加arg以控制导出的数据-打开/关闭,问题/prs。
  • 支持2FA登录-当前如果在您的帐户上启用了2FA,则必须设置 访问令牌。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
orm如何在Java中实现规范化映射?   java以编程方式修改Xtext生成的Mwe2工作流   java正在覆盖外部文件中的现有数据,如何停止?   java在ANTLR BNF语法符号中epsilon的等价物是什么?   java如何使用Hibernate@Anyrelated注释?   代码生成生成java类并在运行时加载它   java Maven无法在本地jar文件中收集依赖项   java NetBeans IDE 8.2不显示错误消息   java Selenium web驱动程序找不到元素   java如何修复“拒绝访问属性”invoke“”的权限?   JavaApacheJClouds,从比日期更早的blob中删除blob的最佳方法   java如何比较和排序树集中的项目?   使用JavaSpring和无头/解耦CMS   java使用swagercodegen在不同的类中生成端点   Java外部Keylistener没有响应