将github存储库问题导出到标记文件:https://github.com/mattduck/gh2md。
gh2md的Python项目详细描述
将github存储库的问题转储到单个标记文件中。
还有许多其他项目处理github问题导出 (例如offline-issues),但我不能 找到一个将所有问题、注释和元数据写入一个可读的 文件。
用法
为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,则必须设置 访问令牌。