A client library for accessing YouTrack REST API
Project description
youtrack-rest-client 0.1.3
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:
- Every path/method combo becomes a Python module with four functions:
sync
: Blocking request that returns parsed data (if successful) orNone
sync_detailed
: Blocking request that always returns aRequest
, optionally withparsed
set if the request was successful.asyncio
: Likesync
but the async instead of blockingasyncio_detailed
: Likesync_detailed
by async instead of blocking
- All path/query params, and bodies become method arguments.
- If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
- 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.3.tar.gz
(93.5 kB
view hashes)
Built Distribution
Close
Hashes for youtrack-rest-client-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1cb671504812f7d53a7c15382f12380ce61d2772a351653d185f2d0f58f89e8 |
|
MD5 | ade01399c0711f9df4aef2b73d807f91 |
|
BLAKE2b-256 | b43633a82e01b6e3aeee9ce12c1dc28ef2a3e68480c5ba52d3591c4327e0efd6 |
Close
Hashes for youtrack_rest_client-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2647f411ccb7dbe2876c5ae43eaa624cdd9f587415b5b9657d0fbd05afeae7 |
|
MD5 | 4206c923f017d4aa15446bb5140d5fff |
|
BLAKE2b-256 | a89fcf15deb4aeedaaa2b20a36252e09d683443a07096a7c5d2569ce6ef3fd4a |