Skip to main content

Taiga python API

Project description

Build Status Codecov.io Status Latest Version Supported Python versions License Downloads

A module for using the Taiga REST API.

Install

pip install python-taiga

Contribute to python-taiga

  • If you want to contribute to python-taiga with small fixes or updates please open a PR on Github

  • If you want to start working on a big feature please let’s discuss it together, opening a new issue

  • If you want to contribute to python-taiga’s documentation use the generate_docs.sh script to build the official documentation and send a PR (We use sphinx http://sphinx-doc.org/)

Getting Started

Getting started with the Taiga API couldn’t be easier. Create a TaigaAPI and you’re ready to go.

API Credentials

The TaigaAPI needs your Taiga credentials. You can pass these directly to the auth method (see the code below).

from taiga import TaigaAPI

api = TaigaAPI()

api.auth(
    username='user',
    password='psw'
)

Alternately, you can pass a token to the constructor TaigaAPI constructor.

from taiga import TaigaAPI

api = TaigaAPI(token='mytoken')

You can also specify a different host if you use Taiga somewhere else

from taiga import TaigaAPI

api = TaigaAPI(
    host='http://taiga.my.host.org'
)

Get projects, user stories, task and issues

You can get projects, user stories, tasks and issues using the primary key or using slug/ref

new_project = api.projects.get_by_slug('nephila')
print (new_project.get_issue_by_ref(1036))
print (new_project.get_userstory_by_ref(1111))
print (new_project.get_task_by_ref(1112))

Create a project

new_project = api.projects.create('TEST PROJECT', 'TESTING API')

Create a new user story

userstory = new_project.add_user_story(
    'New Story', description='Blablablabla'
)

You can also create a milestone and pass it to a story

jan_feb_milestone = new_project.add_milestone(
    'MILESTONE 1', '2015-01-26', '2015-02-26'
)

userstory = new_project.add_user_story(
    'New Story', description='Blablablabla',
    milestone=jan_feb_milestone.id
)

To add a task to your user story just run

userstory.add_task(
    'New Task 2',
    new_project.task_statuses[0].id
)

Create an issue

newissue = new_project.add_issue(
    'New Issue',
    new_project.priorities.get(name='High').id,
    new_project.issue_statuses.get(name='New').id,
    new_project.issue_types.get(name='Bug').id,
    new_project.severities.get(name='Minor').id,
    description='Bug #5'
)

Create a custom attribute

new_project.add_issue_attribute(
    'Device', description='(iPad, iPod, iPhone, Desktop, etc.)'
)
newissue.set_attribute('1', 'Desktop')

List elements

projects = api.projects.list()
stories = api.user_stories.list()

You can also specify filters

tasks = api.tasks.list(project=1)

Attach a file

You can attach files to issues, user stories and tasks

newissue.attach('README.md', description='Read the README in Issue')

Play with instances

Instances can have actions, for example you can star a project just calling

new_project = api.projects.create('TEST PROJECT', 'TESTING API')
new_project.star()

Any instance can be updated and deleted

new_project.name = 'New name for my project'
new_project.update()
new_project.delete()

History

You can access the history of issues, tasks, userstories and wiki pages:

history = api.history.user_story.get(user_story.id)

We’re working on documentation, you can find a complete example in demo.py.

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

python-taiga-0.8.2.tar.gz (21.8 kB view details)

Uploaded Source

File details

Details for the file python-taiga-0.8.2.tar.gz.

File metadata

File hashes

Hashes for python-taiga-0.8.2.tar.gz
Algorithm Hash digest
SHA256 2ffa060af27cae29c154dcca6e391165e05eb7c423a36e1ebb4b9f0b1017ee61
MD5 8b5ba1001bb27b8ce5ac2feca67733d2
BLAKE2b-256 75479bc4ac89796a29d3de5fffbfb56cbf7a094c90ba1bce17b944fda84ce5dd

See more details on using hashes here.

Provenance

Supported by

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