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.5.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.5.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rh_py_commons-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 9a66c885fa1353f9814d2630ba966b33bb9f4de8577f53debdb9bc257f700a8a
MD5 887757e879a4c2502cec0a51d34c3e2c
BLAKE2b-256 d7ddcfbc6a97106d6277894b1b77063f24f8bd3f537951d5e16c3d6517caed1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rh_py_commons-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ac4be6ee04b1a6499c26121f1fe90a5d311d6a9a0608528dd6d807f3499812f
MD5 2c82490edbf3ce04332758c825f20a22
BLAKE2b-256 a90705d23a26a0601467c65f2167a824c03dc7b75d7061871d53b14bb834ca28

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