https://github.com/zyv/github-issues-import
Modern, typesafe Python client for GitHub's unofficial API for importing issues
https://github.com/zyv/github-issues-import
github github-api github-issues-migrate httpx pydantic
Last synced: about 2 months ago
JSON representation
Modern, typesafe Python client for GitHub's unofficial API for importing issues
- Host: GitHub
- URL: https://github.com/zyv/github-issues-import
- Owner: zyv
- License: mit
- Created: 2025-02-07T17:03:10.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-04-01T08:44:40.000Z (about 2 months ago)
- Last Synced: 2025-04-01T09:04:05.232Z (about 2 months ago)
- Topics: github, github-api, github-issues-migrate, httpx, pydantic
- Language: Python
- Homepage:
- Size: 98.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Issues Import API Client for Python
[](https://github.com/zyv/github-issues-import/blob/main/LICENSE)
[](https://pypi.python.org/pypi/github-issues-import)

[](https://docs.pydantic.dev/latest/contributing/#badges)
[](https://github.com/astral-sh/ruff)
[](https://github.com/zyv/github-issues-import/actions)Modern, typesafe Python client for GitHub's unofficial API for importing issues.
This package is based on the [API description](https://gist.github.com/jonmagic/5282384165e0f86ef105) by [jonmagic](https://github.com/jonmagic). Unlike the official REST or GraphQL APIs, this API allows you to keep the timestamps of the imported issues and comments.
## Installation
```shell
$ pip install github-issues-import
```## Dependencies
* [Pydantic V2](https://pydantic.dev)
* [httpx](https://www.python-httpx.org)## Usage
```python
import os
from github_issues_import.client import ApiClient, HttpClient
from github_issues_import.models import IssueImportRequest, Issue, Commentclient = ApiClient(http_client=HttpClient(token=os.environ["GITHUB_TOKEN"]))
status = client.import_issue("jonmagic", "i-got-issues", IssueImportRequest(
issue=Issue(
title="My money, mo issues",
body="Required!"
),
comments=[Comment(body="talk talk")],
))result = client.get_status(status.url)
print(result)
```### Advanced usage
```python
import os
import httpx
from github_issues_import.client import ApiClient, HttpClient# httpx client options
client1 = ApiClient(http_client=HttpClient(token=os.environ["GITHUB_TOKEN"], timeout=60))# own httpx-based client
client2 = ApiClient(http_client=httpx.Client(base_url=HttpClient.BASE_URL))
```## Development
To release a new version and publish it to PyPI:
* Bump version with `hatch` and commit
* `hatch version minor` or `hatch version patch`
* Create GitHub release (and tag)