# GitHub Issues Import API Client for Python
[](https://github.com/zyv/github-issues-import/blob/main/LICENSE)
[](https://pypi.python.org/pypi/ruff)

[](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, Comment
client = 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)
Raw data
{
"_id": null,
"home_page": null,
"name": "github-issues-import",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "github, github-api, httpx, import, pydantic",
"author": null,
"author_email": "\"Yury V. Zaytsev\" <yury@shurup.com>",
"download_url": "https://files.pythonhosted.org/packages/18/1f/4101d51e0bed972d9447ed935f602f7842d3558c07bbd31960743b373d36/github_issues_import-0.4.0.tar.gz",
"platform": null,
"description": "# GitHub Issues Import API Client for Python\n\n[](https://github.com/zyv/github-issues-import/blob/main/LICENSE)\n[](https://pypi.python.org/pypi/ruff)\n\n[](https://docs.pydantic.dev/latest/contributing/#badges)\n[](https://github.com/astral-sh/ruff)\n[](https://github.com/zyv/github-issues-import/actions)\n\nModern, typesafe Python client for GitHub's unofficial API for importing issues.\n\nThis 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.\n\n## Installation\n\n```shell\n$ pip install github-issues-import\n```\n\n## Dependencies\n\n* [Pydantic V2](https://pydantic.dev)\n* [httpx](https://www.python-httpx.org)\n\n## Usage\n\n```python\nimport os\nfrom github_issues_import.client import ApiClient, HttpClient\nfrom github_issues_import.models import IssueImportRequest, Issue, Comment\n\nclient = ApiClient(http_client=HttpClient(token=os.environ[\"GITHUB_TOKEN\"]))\n\nstatus = client.import_issue(\"jonmagic\", \"i-got-issues\", IssueImportRequest(\n issue=Issue(\n title=\"My money, mo issues\",\n body=\"Required!\"\n ),\n comments=[Comment(body=\"talk talk\")],\n))\n\nresult = client.get_status(status.url)\nprint(result)\n```\n\n### Advanced usage\n\n```python\nimport os\nimport httpx\nfrom github_issues_import.client import ApiClient, HttpClient\n\n# httpx client options\nclient1 = ApiClient(http_client=HttpClient(token=os.environ[\"GITHUB_TOKEN\"], timeout=60))\n\n# own httpx-based client\nclient2 = ApiClient(http_client=httpx.Client(base_url=HttpClient.BASE_URL))\n```\n\n## Development\n\nTo release a new version and publish it to PyPI:\n\n* Bump version with `hatch` and commit\n * `hatch version minor` or `hatch version patch`\n* Create GitHub release (and tag)\n",
"bugtrack_url": null,
"license": null,
"summary": "Modern, typesafe Python client for GitHub's unofficial API for importing issues",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [
"github",
" github-api",
" httpx",
" import",
" pydantic"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "90155ed65f6f259072daca5d4fd39ec94ae7f5ab7754408c5c5b9b9239630f7c",
"md5": "964ecd67c14c6975433ac2732f1d3911",
"sha256": "725dc76b15e83c0b13a163febfa1b18c1538d2685242d5db9cdf669e65bf21ef"
},
"downloads": -1,
"filename": "github_issues_import-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "964ecd67c14c6975433ac2732f1d3911",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 5098,
"upload_time": "2025-02-21T07:11:18",
"upload_time_iso_8601": "2025-02-21T07:11:18.756845Z",
"url": "https://files.pythonhosted.org/packages/90/15/5ed65f6f259072daca5d4fd39ec94ae7f5ab7754408c5c5b9b9239630f7c/github_issues_import-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "181f4101d51e0bed972d9447ed935f602f7842d3558c07bbd31960743b373d36",
"md5": "83496174d3418c2a8a5acc477d858b0c",
"sha256": "7431a7aa46736174820f40e968f40d084493a704e34e6000c0c4ad4cd7a58247"
},
"downloads": -1,
"filename": "github_issues_import-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "83496174d3418c2a8a5acc477d858b0c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 44877,
"upload_time": "2025-02-21T07:11:20",
"upload_time_iso_8601": "2025-02-21T07:11:20.521007Z",
"url": "https://files.pythonhosted.org/packages/18/1f/4101d51e0bed972d9447ed935f602f7842d3558c07bbd31960743b373d36/github_issues_import-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-21 07:11:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "github-issues-import"
}