PyBacklogPy

0.12 · abandoned · verified Mon Apr 13

PyBacklogPy is a Python client library designed for interacting with the Backlog API v2. The library is currently at version 0.12. However, its official GitHub repository was archived on October 31, 2024, rendering it read-only and indicating that the library is no longer actively maintained or receiving updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to configure PyBacklogPy using environment variables for the Backlog Space ID and API Key, and how to initialize an API client (e.g., for Issues). It includes a placeholder for making an actual API call, which would require valid project information and error handling for production use.

import os
from pybacklogpy.BacklogConfigure import BacklogConfigure
from pybacklogpy.Issue import Issue

# Configure API access using environment variables
space_id = os.environ.get('BACKLOG_SPACE_ID', 'your_backlog_space_id')
api_key = os.environ.get('BACKLOG_API_KEY', 'your_backlog_api_key')

if space_id == 'your_backlog_space_id' or api_key == 'your_backlog_api_key':
    print("Please set BACKLOG_SPACE_ID and BACKLOG_API_KEY environment variables or replace placeholders.")
else:
    config = BacklogConfigure(space_id=space_id, api_key=api_key)

    # Example: Initialize Issue API client
    issue_api = Issue(config)

    # Example: Try to get a list of issues (this might require project_id_or_key)
    # Note: Replace 'PROJECT_KEY' with an actual project key in your Backlog instance
    try:
        # Attempt to fetch issues. This often requires a project or other filters.
        # For simplicity, this example just attempts to call a method.
        # A real-world use case would involve valid parameters.
        # print("Attempting to get issues...")
        # response = issue_api.get_issue_list(project_id_or_key='PROJECT_KEY')
        # if response.ok:
        #     print("Successfully connected to Backlog API.")
        #     print(f"First 5 issues: {response.json()[:5]}")
        # else:
        #     print(f"Error connecting to Backlog API: {response.status_code} - {response.text}")
        print("PyBacklogPy configured successfully. You can now use 'issue_api' for calls.")
    except Exception as e:
        print(f"An error occurred during API call setup: {e}")

view raw JSON →