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.0.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.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: githubguard-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3b25be2c990a7bef9126b8921a6e82158ce03cdeeef23121d95c438554e9c163
MD5 03e2affb292f31d6d903a726c3f1d291
BLAKE2b-256 899510c9b00f00335c062e5a806dfc47e7de2d20602de83174c0f23c90e7d379

See more details on using hashes here.

File details

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

File metadata

  • Download URL: githubguard-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6983aae7ecb8185919f5782dbba8ac24b06c8e419b0861bd2f93628835fcec3
MD5 7f6ee1681205d27f84f2c7de22b9681f
BLAKE2b-256 a6cf44791bdefe078920c4313cfbe85928c7bb16369b0778db8f785ae1b723c0

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