Skip to main content

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

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_issues_import-0.4.3.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_issues_import-0.4.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file github_issues_import-0.4.3.tar.gz.

File metadata

File hashes

Hashes for github_issues_import-0.4.3.tar.gz
Algorithm Hash digest
SHA256 3ba2be85cf6e163b0b54acbed42bb88305920d4f60b010de1e1369abeab5536e
MD5 5816613b5994fb042e2d88f799b03b8a
BLAKE2b-256 9d262dcd512b7aecb93a6244c81b755cd37ac69a94feca70834aa5fbc2cb6b39

See more details on using hashes here.

File details

Details for the file github_issues_import-0.4.3-py3-none-any.whl.

File metadata

File hashes

Hashes for github_issues_import-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8c79fb72b7226ec95f128fa7dcbdfe6777d607b1d1c07d14dd982d7ca8cd0f8f
MD5 f2aa8911925e6c2904b1815cace1e3eb
BLAKE2b-256 10db8f46d99121190d311ddd8d96bf7821db098d8afabe995ff40973667a50d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page