Skip to main content

YouTrack SDK

Project description

YouTrack REST API Client

A client library for accessing YouTrack REST API.

This is a fork of moneymeets/youtrack-sdk with several enhancements.

Key Changes from Original

This fork includes the following improvements over the original repository:

  • AsyncClient Implementation: Full async/await support with AsyncClient for non-blocking I/O operations
  • Project Custom Fields API: New get_project_custom_fields() method to retrieve custom field definitions for projects
  • Migrated to UV: Switched from Poetry to UV for dependency management
  • Enhanced Testing: Migrated test suite from unittest to Pytest with async test support
  • Modern Python: Updated to require Python 3.13+ with improved type hints and linting
  • Improved Code Quality: Enhanced linting with Ruff and type checking with Pyright

Usage

Synchronous Client

from datetime import date
from youtrack_sdk import Client
from youtrack_sdk.entities import (
    DateIssueCustomField,
    EnumBundleElement,
    Issue,
    Tag,
    Project,
    SingleEnumIssueCustomField,
    SingleUserIssueCustomField,
    StateBundleElement,
    StateIssueCustomField,
    User,
)

with Client(base_url="https://dummy.myjetbrains.com/youtrack", token="dummy") as client:
    result = client.create_issue(
        issue=Issue(
            project=Project(id="0-0"),
            summary="Created from YouTrack SDK",
            description="Description **text**.",
            tags=[
                Tag(id="6-0"),
            ],
            custom_fields=[
                StateIssueCustomField(
                    name="State",
                    value=StateBundleElement(
                        name="In Progress",
                    ),
                ),
                SingleUserIssueCustomField(
                    name="Assignee",
                    value=User(
                        ring_id="00000000-a31c-4174-bb27-abd3387df67a",
                    ),
                ),
                SingleEnumIssueCustomField(
                    name="Type",
                    value=EnumBundleElement(
                        name="Bug",
                    ),
                ),
                DateIssueCustomField(
                    name="Due Date",
                    value=date(2005, 12, 31),
                ),
            ],
        ),
    )

Async Client

import asyncio
from youtrack_sdk import AsyncClient
from youtrack_sdk.entities import Project

async def main():
    async with AsyncClient(base_url="https://dummy.myjetbrains.com/youtrack", token="dummy") as client:
        projects = await client.get_projects()
        for project in projects:
            print(f"Project: {project.name}")

asyncio.run(main())

Fetching Project Custom Fields

from youtrack_sdk import Client

with Client(base_url="https://dummy.myjetbrains.com/youtrack", token="dummy") as client:
    custom_fields = client.get_project_custom_fields(project_id="0-0")

    for field in custom_fields:
        print(f"Field: {field.field.name}, Type: {type(field).__name__}")

See examples/list_project_custom_fields.py for a complete example.

Note

  • You should prefer to use internal entity IDs everywhere. Some methods accept readable issue IDs (e.g. HD-99) but it's not supported everywhere.

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

youtrack_python-0.1.1.tar.gz (54.9 kB view details)

Uploaded Source

Built Distribution

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

youtrack_python-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file youtrack_python-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for youtrack_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 77131d018120970a5341053735d3696ca9189476534495673ff1a874d89f5f9b
MD5 c44322c4520c0920eede9983495ff6bc
BLAKE2b-256 4ea6224ea66668a49a9f47c26dfb432dd57e711cfb8fbf2e46f839b9028bb813

See more details on using hashes here.

Provenance

The following attestation bundles were made for youtrack_python-0.1.1.tar.gz:

Publisher: release.yml on ninjaneers-team/youtrack-sdk

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

File details

Details for the file youtrack_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for youtrack_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98d3feeb920bffbee2f014948b282107701078b03817f6175a1dd8c26ff8bc81
MD5 2d7ed81a6370155ade0987924e18dffd
BLAKE2b-256 90c7c51693c9503f36688139b066bf9f33d0c40dcb178b046570c3ab9ba28bad

See more details on using hashes here.

Provenance

The following attestation bundles were made for youtrack_python-0.1.1-py3-none-any.whl:

Publisher: release.yml on ninjaneers-team/youtrack-sdk

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