Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add comments support #27

Merged
merged 3 commits into from
Sep 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: add basic usage example and installation guide to README.md
  • Loading branch information
danfimov committed Sep 30, 2023
commit e82fddb162fbca8cf9be7568ad8437e82678d91e
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,59 @@ Async Yandex Tracker Client based on aiohttp and pydantic (v2)
[![Code linter: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Linters](https://github.com/danfimov/ya_tracker_client/actions/workflows/code-check.yml/badge.svg)](https://github.com/danfimov/ya_tracker_client/actions/workflows/code-check.yml)

---

API docs: https://cloud.yandex.com/en/docs/tracker/about-api

## Installation

```shell
pip install ya_tracker_clint
```

## Usage

```python
import os
from asyncio import run

from dotenv import load_dotenv

from ya_tracker_client import YaTrackerClient


load_dotenv()
# from registered application at Yandex OAuth - https://oauth.yandex.ru/
API_TOKEN = os.getenv("API_TOKEN")
# from admin panel at Yandex Tracker - https://tracker.yandex.ru/admin/orgs
API_ORGANISATION_ID = os.getenv("API_ORGANISATION_ID")


async def main() -> None:
# init client
client = YaTrackerClient(
organisation_id=API_ORGANISATION_ID,
oauth_token=API_TOKEN,
)

# create issue
new_issue = await client.create_issue('New issue', 'TRACKER-QUEUE')

# get issue
issue = await client.get_issue('KEY-1')

# update issue (just pass kwargs)
issue = await client.edit_issue('KEY-1', description='Hello World')

# don't forget to close tracker on app shutdown
await client.stop()


if __name__ == "__main__":
run(main())
```


## Explanations about naming

- All `self` properties renamed to `url` cause it's incompatible with Python;
Expand Down
Loading