Fetch all GitHub issues for a repository and save them as JSON
Install this tool using pip
:
pip install fetch-github-issues
To fetch all issues from a GitHub repository:
fetch-github-issues owner/repo --all
Or for just specific issues:
fetch-github-issues owner/repo 1 2 3
Other options:
--key xxx
: GitHub API key - will use theGITHUB_TOKEN
environment variable if this is not set.--output path/to/dir
: Output directory to save JSON. Default is the current directory.
For more help, run:
fetch-github-issues --help
You can also use:
python -m fetch_github_issues --help
Issues will be saved in files called 1.json
and 2.json
and so on, where the filename is the issue number.
Each file will look like this:
{
"issue": {
"GitHub API issue representation": "..."
},
"comments": [
{
"GitHub API comment representation": "..."
}
]
}
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd fetch-github-issues
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest