Skip to main content

A client library for accessing YouTrack REST API

Project description

youtrack-rest-client 0.1.2

A client library for accessing YouTrack REST API

⚠️This SDK generated using 2021.3 OpenAPI version by custom openapi-python-client which is under development. It may have some bugs. Use with caution.⚠️

If you find a bug or want to request a new feature, please create an issue in YouTrack.

Usage

First, create a client:

from youtrack_rest_client import Client

client = Client(
    hub_base_url="https://hub.jetbrains.com/api/rest",
    youtrack_base_url="https://youtrack.jetbrains.com/api"
)

If the endpoints you're going to hit require authentication, use AuthenticatedClient instead:

from youtrack_rest_client import AuthenticatedClient

client = AuthenticatedClient(
    hub_base_url="https://hub.jetbrains.com/api/rest",
    youtrack_base_url="https://youtrack.jetbrains.com/api",
    token=os.getenv("YOUTRACK_TOKEN")
)

Now call your endpoint and use your models:

from youtrack_rest_client.models import MyDataModel
from youtrack_rest_client.api.my_tag import get_my_data_model
from youtrack_rest_client.types import Response

my_data: MyDataModel = get_my_data_model.sync(client=client)
# or if you need more info (e.g. status_code)
response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)

Or do the same thing with an async version:

from youtrack_rest_client.models import MyDataModel
from youtrack_rest_client.api.my_tag import get_my_data_model
from youtrack_rest_client.types import Response

my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)

Things to know:

  1. Every path/method combo becomes a Python module with four functions:
    1. sync: Blocking request that returns parsed data (if successful) or None
    2. sync_detailed: Blocking request that always returns a Request, optionally with parsed set if the request was successful.
    3. asyncio: Like sync but the async instead of blocking
    4. asyncio_detailed: Like sync_detailed by async instead of blocking
  2. All path/query params, and bodies become method arguments.
  3. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
  4. Any endpoint which did not have a tag will be in youtrack_rest_client.api.default

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-rest-client-0.1.2.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

youtrack_rest_client-0.1.2-py3-none-any.whl (401.5 kB view details)

Uploaded Python 3

File details

Details for the file youtrack-rest-client-0.1.2.tar.gz.

File metadata

  • Download URL: youtrack-rest-client-0.1.2.tar.gz
  • Upload date:
  • Size: 94.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.6 Windows/10

File hashes

Hashes for youtrack-rest-client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9f28de670221b28aa1dca4eb6279b611913be583553f8625ff4ded8abbf28ea7
MD5 212eb156dbcabbb67b904bc0e58737d5
BLAKE2b-256 05f122c23e944f8708c29f969f47123fe8a2295c27bf0be7a31a0074047535ef

See more details on using hashes here.

File details

Details for the file youtrack_rest_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for youtrack_rest_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c181d1796edc6bcbc497026105359560e4b5cbc0b37d9efe9dc4d1ccf0e12ae
MD5 3a9055acf9f8f5afd13a781a99d6fcef
BLAKE2b-256 7bea2aba55cf1f8f4c74ed5c2d4628f386ce8d0cbe3cb61e548ec09879c7b62c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page