Skip to main content

collection of biblical humans and their family relations

Project description

README.md Content

# jira_api_client

A Python package for interacting with the Jira REST API, providing a simple function to fetch data from Jira endpoints.

## Installation

Install the package using pip:

```bash
pip install jira_api_client

This will automatically install the required dependency (requests>=2.25.1).

Requirements

  • Python 3.6 or higher
  • Access to a Jira instance with valid credentials (username and API token)

Usage

The package provides a main function, fetch_jira_data, to retrieve data from Jira REST API endpoints.

Example: Fetch Issue Details

from jira_api.jira_client import fetch_jira_data, HTTP_SUCCESS

# Define the Jira URL, authentication, and parameters
url = "https://your-jira-instance.atlassian.net/rest/api/2/issue/JIGY-29"
auth = ("your_username", "your_api_token")  # Use your Jira username and API token
params = {"fields": "summary,status,comment,worklog"}

# Fetch data
data = fetch_jira_data(url, auth, params)

# Check if the request was successful
if data and data.get('status_code', HTTP_SUCCESS) == HTTP_SUCCESS:
    print("Issue data:", data)
else:
    print("Failed to fetch data")

Function Details

  • fetch_jira_data(url, auth, params=None):
    • Parameters:
      • url (str): The Jira REST API endpoint (e.g., /rest/api/2/issue/{issueKey}).
      • auth: A tuple of (username, password) or (username, API token) for authentication.
      • params (dict, optional): Query parameters for the API request (e.g., {"fields": "summary"}).
    • Returns:
      • dict: JSON response data if the request is successful (status code 200).
      • None: If the request fails, with an error message printed.
    • HTTP_SUCCESS: Constant for status code 200, imported as HTTP_SUCCESS.

Example: Fetch Sprint Issues

from jira_api.jira_client import fetch_jira_data, HTTP_SUCCESS

url = "https://your-jira-instance.atlassian.net/rest/agile/1.0/sprint/123/issue"
auth = ("your_username", "your_api_token")
params = {"jql": "status in (Done, Closed, Resolved)", "maxResults": 500, "fields": "key,customfield_10111"}

data = fetch_jira_data(url, auth, params)
if data:
    issues = data.get('issues', [])
    for issue in issues:
        print(f"Issue {issue['key']}: {issue.get('fields', {}).get('customfield_10111', 'No story points')}")

Version History

  • 0.1.0 (2025-04-20): Initial release with fetch_jira_data function for Jira API calls.

### Notes
- **Customization**: Replace placeholders like `your-jira-instance.atlassian.net`, `your_username`, `your_api_token`, `Your Name`, and `your.email@example.com` with actual values.
- **Examples**: The usage examples demonstrate fetching issue details and sprint issues, aligning with your `calculate_velocity.py` use case.
- **License**: Add a `LICENSE` file (e.g., MIT) if you plan to distribute the package. The `README.md` references it.
- **Version History**: Reflects the initial release date as April 20, 2025, based on our current interaction.
- **Development Section**: Includes instructions for building and uploading, useful for you and potential contributors.

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

jira_veya-0.0.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

jira_veya-0.0.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file jira_veya-0.0.2.tar.gz.

File metadata

  • Download URL: jira_veya-0.0.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for jira_veya-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ad009922c87c4b569f85c3fca25748ca57c89ce4fd174028cab609a1090c2201
MD5 13805ebe72298053e08824ac4c47619d
BLAKE2b-256 94876b916e89c05ab336faefb526d678e8ca6a96683384f82f906a84c4c6d8b5

See more details on using hashes here.

File details

Details for the file jira_veya-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: jira_veya-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for jira_veya-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebbf3a1d23fa66b50eba0fb85423a74ce4c757b6b1d4b3ca7c8b34a30f413454
MD5 4ffb2249be334eb94eb81345a5dda064
BLAKE2b-256 4033efcd7368d749bbf12cd71253643b9834a683eb925a236d42b74ceee3eb5c

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