-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,45 @@ | ||
# Python GitHub Issues Import API Client | ||
# GitHub Issues Import API Client for Python | ||
|
||
[](https://github.com/zyv/github-issues-import/blob/main/LICENSE)<!-- | ||
[](https://pypi.python.org/pypi/ruff) | ||
[](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 | ||
from github_issues_import.models import IssueImportRequest, Issue, Comment | ||
|
||
client = ApiClient(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) | ||
``` |