Skip to main content

Common Python libraries for Red Hat tools and automation

Project description

py-commons

A collection of shared Python libraries for Red Hat tools and automation.

Libraries

commons.jira

A unified JIRA client for Red Hat projects with support for both Atlassian Cloud and on-premise instances.

Features:

  • Unified authentication for Cloud (email + API token) and on-premise (username/password or token)
  • Automatic retry logic with exponential backoff
  • Common query patterns (by status, label, custom JQL)
  • Issue management (create, update, transition, labels, comments)
  • Custom field support
  • Comprehensive error handling

See jira documentation for detailed usage.

Installation

Install from PyPI:

pip install py-commons

Or install from source:

git clone https://github.com/redhat-performance/py-commons.git
cd py-commons
pip install -e .

Usage

from commons.jira import JiraClient

# Connect to Atlassian Cloud
client = JiraClient(
    server="https://yourcompany.atlassian.net",
    email="you@example.com",
    api_token="your-api-token"
)

# Query issues
issues = client.query_issues("project = MYPROJECT AND status = 'In Progress'")

# Get issues by status
bugs = client.get_issues_by_status("MYPROJECT", "Open")

# Add label to issue
client.add_label(issues[0], "needs-review")

License

See LICENSE for details.

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

rh_py_commons-0.3.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

rh_py_commons-0.3.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file rh_py_commons-0.3.0.tar.gz.

File metadata

  • Download URL: rh_py_commons-0.3.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rh_py_commons-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c858491b90077354f57e9f3208f9520518149d885b2a5c28e7f4a071159c74c1
MD5 6e9c5f130aae35a34e8784a22dc53199
BLAKE2b-256 8be040c13d778aea00c1f473811bee975b08b8b471461e4b04882081b307e11c

See more details on using hashes here.

File details

Details for the file rh_py_commons-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: rh_py_commons-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rh_py_commons-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 560840b12cd3f59a77abd4b18b6788e0361b7bd9312c1ac0d2d28f8201454170
MD5 eace8ad38025601a4b2f3f38abeb21a1
BLAKE2b-256 a5db0ba3ee838cde66e52cf715569b4e61d62c9e5bb8e14c317cdb6716b568e8

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