Skip to content

Modern, typesafe Python client for GitHub's unofficial API for importing issues

License

Notifications You must be signed in to change notification settings

zyv/github-issues-import

Repository files navigation

GitHub Issues Import API Client for Python

PyPI License PyPI project Python versions Pydantic v2 Ruff CI

Modern, typesafe Python client for GitHub's unofficial API for importing issues.

This package is based on the API description by jonmagic. Unlike the official REST or GraphQL APIs, this API allows you to keep the timestamps of the imported issues and comments.

Installation

$ pip install github-issues-import

Dependencies

Usage

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

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)

About

Modern, typesafe Python client for GitHub's unofficial API for importing issues

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages