Skip to main content

Automatically create GitHub issues from Python scripts.

Project description

GitHubGuard

PyPI version License

GitHubGuard is a lightweight Python package to automatically create GitHub issues from your scripts. It allows you to capture exceptions or messages in your Python code and turn them into issues in one or multiple repositories, with optional labels and assignees.


Features

  • Automatically create GitHub issues from Python scripts
  • Global configuration for token and default repository
  • Create issues in different repositories dynamically
  • Add custom title, labels, and assignees
  • Easy to import and use across multiple scripts
  • Fully compatible with Python 3.8+

Installation

Install via pip:

pip install GitHubGuard

Or if using your local development version:

pip install -e .

Usage

from GitHubGuard import config, create_issue

# Configure once
config(token="your-github-token", default_repo="username/MyRepo")

try:
    1 / 0
except Exception as e:
    create_issue(
        str(e),
        title="Critical error in script",
        labels=["bug", "urgent"],
        assignees=["username1", "username2"]
    )
  • token – Your GitHub personal access token
  • default_repo – Default repository in owner/repo format
  • title – Optional custom title (default: first 50 characters of message)
  • labels – List of labels to assign to the issue
  • assignees – List of GitHub usernames to assign the issue

You can also create issues in different repositories without changing the global configuration:

create_issue(
    "Another error occurred",
    repo="username/OtherRepo",
    labels=["enhancement"],
)

License

This project is licensed under the MIT License.


Contributing

Feel free to fork, modify, and submit pull requests. Bug reports and suggestions are welcome!

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

githubguard-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

githubguard-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file githubguard-0.1.1.tar.gz.

File metadata

  • Download URL: githubguard-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for githubguard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c7a84d7696b2cf7bfefd536a8eb8359965cb56f50da6b291495a77a9423ed977
MD5 4d62dfeec8ff9c90f99a5f50e4841e40
BLAKE2b-256 4d3fe53a2cce1810209057a3dfc4da89b127393258f92e2fdea7826f628fd197

See more details on using hashes here.

File details

Details for the file githubguard-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: githubguard-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for githubguard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d7b4307c12be1b8c1929307058ed530a2489279669785583ce71f2dc160be9f
MD5 cb5458398220c128e31532955cc6f81d
BLAKE2b-256 6849af6b504fad7b9e7fbb9917913093fb75a7b9e099b3627dd10a5d6bcd3b49

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