Skip to main content

Python client for the Redmine REST API with sync and async support

Project description

Redmine Client

Python client for the Redmine REST API with synchronous and asynchronous support.

Features

  • Synchronous and asynchronous client
  • Full type hints with Pydantic models
  • Custom fields support
  • Automatic pagination
  • Context manager support

Installation

pip install redmine-client

Or for development:

pip install -e ".[dev]"

Usage

Synchronous

from redmine_client import RedmineClient

with RedmineClient("https://redmine.example.com", "your-api-key") as client:
    # Get all open issues assigned to me
    issues = client.get_issues(assigned_to_id="me", status_id="open")

    for issue in issues:
        print(f"#{issue.id}: {issue.subject}")

    # Update issue with custom field
    client.update_issue(
        issue_id=123,
        custom_fields=[{"id": 42, "value": "2026-KW03-KW04"}]
    )

Asynchronous

from redmine_client import AsyncRedmineClient

async with AsyncRedmineClient("https://redmine.example.com", "your-api-key") as client:
    issues = await client.get_issues(assigned_to_id="me", status_id="open")

    for issue in issues:
        print(f"#{issue.id}: {issue.subject}")

API

Issues

# Get issues
issues = client.get_issues(
    project_id="myproject",      # Optional: filter by project
    assigned_to_id="me",         # Optional: filter by assignee
    status_id="open",            # Optional: "open", "closed", "*", or ID
    tracker_id=1,                # Optional: Bug, Feature, etc.
)

# Get single issue
issue = client.get_issue(123, include_journals=True)

# Create issue
new_issue = client.create_issue(
    project_id="myproject",
    subject="New feature",
    description="Description...",
    tracker_id=2,
    custom_fields=[{"id": 42, "value": "Sprint value"}]
)

# Update issue
client.update_issue(
    issue_id=123,
    subject="New subject",
    notes="Add a comment",
    custom_fields=[{"id": 42, "value": "New value"}]
)

# Add comment
client.add_issue_note(123, "My comment")

Custom Fields

# Get all custom fields (requires admin rights)
fields = client.get_custom_fields()

# Get issue custom fields only
issue_fields = client.get_issue_custom_fields()

# Find custom field by name
sprint_field = client.find_custom_field_by_name("Sprint")

# Read custom field value from issue
issue = client.get_issue(123)
sprint = issue.get_custom_field("Sprint")

Projects

projects = client.get_projects(include_closed=False)
project = client.get_project("myproject")

Users

current_user = client.get_current_user()
users = client.get_users(status=1)  # 1 = active
user = client.get_user(42)

Enumerations

trackers = client.get_trackers()
statuses = client.get_issue_statuses()
priorities = client.get_issue_priorities()
activities = client.get_time_entry_activities()

Models

All responses are returned as Pydantic models:

  • RedmineIssue - Issue/Ticket
  • RedmineProject - Project
  • RedmineUser - User
  • RedmineTimeEntry - Time entry
  • RedmineCustomField - Custom field value
  • RedmineCustomFieldDefinition - Custom field definition

Error Handling

from redmine_client import (
    RedmineError,
    RedmineAuthenticationError,
    RedmineNotFoundError,
    RedmineValidationError,
)

try:
    issue = client.get_issue(99999)
except RedmineNotFoundError:
    print("Issue not found")
except RedmineAuthenticationError:
    print("Invalid API key")
except RedmineValidationError as e:
    print(f"Validation error: {e.response}")
except RedmineError as e:
    print(f"Redmine error: {e}")

License

MIT

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

redmine_client-0.2.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

redmine_client-0.2.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file redmine_client-0.2.0.tar.gz.

File metadata

  • Download URL: redmine_client-0.2.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for redmine_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 87619ae4f7ad95f57c1c6271940d366c0d0d8c2caacffeddd9b12013e6159e86
MD5 cd9be60c6cfa2bd77d51676573762713
BLAKE2b-256 e1dfee4b036830f934b7e8dd8d89e51723981239a51a7c36853ced090404f86f

See more details on using hashes here.

Provenance

The following attestation bundles were made for redmine_client-0.2.0.tar.gz:

Publisher: publish.yml on dkd-dobberkau/python-redmine-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file redmine_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: redmine_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for redmine_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9d5acceb58e29dd17ba180d405ed01ab27d481b797ef3739ce25ba947a0f7f3
MD5 914c3f06d4aa26f3c853a4f6c15e4e5c
BLAKE2b-256 5bb8e5112a50e6281fc5eab51618394a3e6a0e8d8557a017ae9a97036d0940a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for redmine_client-0.2.0-py3-none-any.whl:

Publisher: publish.yml on dkd-dobberkau/python-redmine-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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