Skip to main content

A Python client for Taiga Rest API

Project description

ENG version

TaigaAPI Python Client

TaigaAPI is a Python client for interacting with the Taiga REST API. This library provides a simple interface for managing projects, issues, epics, user stories, and attachments within the Taiga project management platform.

Installation

To install TaigaAPI, clone the repository and install the dependencies:

git clone https://github.com/alextanker/taiga-client.git
cd taiga-client
pip install -r requirements.txt

or

pip install taiga-client

Usage

Initialization

To start using TaigaAPI, create an instance of the TaigaAPI class by providing the server IP, username, and password.

from taiga_client import TaigaAPI

taiga = TaigaAPI(serverIp="your-server-ip", username="your-username", password="your-password")

Methods

getProjectBySlug(slug: str) -> SimpleNamespace Fetches a project by its slug.

project = taiga.getProjectBySlug("project-slug")
print(project.id, project.name)

createIssue(projectID: int, subject: str, description: str, type: int, priority: int, status: int, tags: List[str] = []) -> SimpleNamespace Creates an issue in a specific project.

project = taiga.getProjectBySlug("project-slug")

issue = taiga.createIssue(projectID=project.id, subject="Bug", description="A critical bug", type=1, priority=2, status=1)
print(issue.id, issue.subject)

createEpic(projectID: int, subject: str, description: str, status: int, tags: List[str] = []) -> SimpleNamespace Creates an epic in a specific project.

project = taiga.getProjectBySlug("project-slug")

epic = taiga.createEpic(projectID=project.id, subject="New Feature", description="A new feature description", status=1)
print(epic.id, epic.subject)

createUserstory(projectID: int, subject: str, description: str, status: int, swimlane: int = -1, tags: List[str] = []) -> SimpleNamespace Creates a user story in a specific project.

project = taiga.getProjectBySlug("project-slug")

userstory = taiga.createUserstory(projectID=project.id, subject="User Story", description="User story description", status=1)
print(userstory.id, userstory.subject)

createAttachmentForIssue(projectID: int, issueID: int, attachmentPath: str, fromComment=False) -> SimpleNamespace Creates an attachment for a specific issue.

project = taiga.getProjectBySlug("project-slug")

attachment = taiga.createAttachmentForIssue(projectID=project.id, issueID=42, attachmentPath="path/to/file.png")
print(attachment.id)

getPriorityList(projectID: int) -> SimpleNamespace Returns a list of priority objects for issues in a project.

project = taiga.getProjectBySlug("project-slug")

priorities = taiga.getPriorityList(projectID=project.id)
for priority in priorities:
    print(priority.name)

getStatusIssueList(projectID: int) -> SimpleNamespace Returns a list of possible statuses for issues in a project.

statuses = taiga.getStatusIssueList(projectID=1)
for status in statuses:
    print(status.name)

createIssueComment(issueID: int, text: str) -> requests.Response Creates a comment for a specific issue.

response = taiga.createIssueComment(issueID=42, text="This is a comment.")
print(response.status_code)

More Methods

The library includes more methods for managing epics, user stories, attachments, and more. Please refer to the source code for the full list of available methods.

RU версия

TaigaAPI Python Client

TaigaAPI — это Python клиент для взаимодействия с Taiga REST API. Эта библиотека предоставляет простой интерфейс для управления проектами, задачами, эпиками, пользовательскими историями и вложениями в платформе управления проектами Taiga.

Установка

Для установки TaigaAPI клонируйте репозиторий и установите зависимости:

git clone https://github.com/alextanker/taiga-client.git
cd taiga-client
pip install -r requirements.txt

или

pip install taiga-client

Использование

Инициализация

Чтобы начать использовать TaigaAPI, создайте экземпляр класса TaigaAPI, указав IP сервера, имя пользователя и пароль.

from taiga_client import TaigaAPI

taiga = TaigaAPI(serverIp="your-server-ip", username="your-username", password="your-password")

Методы

getProjectBySlug(slug: str) -> SimpleNamespace Получает проект по его слагу.

project = taiga.getProjectBySlug("project-slug")
print(project.id, project.name)

createIssue(projectID: int, subject: str, description: str, type: int, priority: int, status: int, tags: List[str] = []) -> SimpleNamespace Создает задачу в определенном проекте.

project = taiga.getProjectBySlug("project-slug")

issue = taiga.createIssue(projectID=project.id, subject="Bug", description="A critical bug", type=1, priority=2, status=1)
print(issue.id, issue.subject)

createEpic(projectID: int, subject: str, description: str, status: int, tags: List[str] = []) -> SimpleNamespace Создает эпик в определенном проекте.

project = taiga.getProjectBySlug("project-slug")

epic = taiga.createEpic(projectID=project.id, subject="New Feature", description="A new feature description", status=1)
print(epic.id, epic.subject)

createUserstory(projectID: int, subject: str, description: str, status: int, swimlane: int = -1, tags: List[str] = []) -> SimpleNamespace Создает пользовательскую историю в определенном проекте.

project = taiga.getProjectBySlug("project-slug")

userstory = taiga.createUserstory(projectID=project.id, subject="User Story", description="User story description", status=1)
print(userstory.id, userstory.subject)

createAttachmentForIssue(projectID: int, issueID: int, attachmentPath: str, fromComment=False) -> SimpleNamespace Создает вложение для определенной задачи.

project = taiga.getProjectBySlug("project-slug")

attachment = taiga.createAttachmentForIssue(projectID=project.id, issueID=42, attachmentPath="path/to/file.png")
print(attachment.id)

getPriorityList(projectID: int) -> SimpleNamespace Возвращает список приоритетов для задач в проекте.

project = taiga.getProjectBySlug("project-slug")

priorities = taiga.getPriorityList(projectID=project.id)
for priority in priorities:
    print(priority.name)

getStatusIssueList(projectID: int) -> SimpleNamespace Возвращает список возможных статусов для задач в проекте.

statuses = taiga.getStatusIssueList(projectID=1)
for status in statuses:
    print(status.name)

createIssueComment(issueID: int, text: str) -> requests.Response Создает комментарий для определенной задачи.

response = taiga.createIssueComment(issueID=42, text="This is a comment.")
print(response.status_code)

Дополнительные Методы

Библиотека включает больше методов для управления эпиками, пользовательскими историями, вложениями и многим другим. Ознакомьтесь с исходным кодом для полного списка доступных методов.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

taiga_client-1.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

taiga_client-1.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file taiga_client-1.1.1.tar.gz.

File metadata

  • Download URL: taiga_client-1.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for taiga_client-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ee01a76e95111dca2ba05faef08a92f8b972b4528c8614cd22c0849aed74a463
MD5 43359730929113614e591c8f84c455e1
BLAKE2b-256 d6074db43c301330839c5524a2449e3dc6188db83e0a551db132ebd880c5bb52

See more details on using hashes here.

File details

Details for the file taiga_client-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: taiga_client-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for taiga_client-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f03c443bf4f551ed132cf1ee862a81b2c1ee50dda671024411b83a5c8749f85d
MD5 f27e01b4066316db9a75debfef5e93f3
BLAKE2b-256 9e030636c62e13e77a54400f2da95c53d208c74a74d03f5ad4e63223367ee01b

See more details on using hashes here.

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