Skip to main content
tests Documentation Status https://badge.fury.io/py/rt.svg

Rt - Python interface to Request Tracker API

Python implementation of REST API described here:
Python version compatibility:

Python

rt

2.7

< 2.0.0

>= 3.5, <3.7

>= 2.0.0, < 3.0.0

>= 3.7

>= 3.0.0, < 3.1.0

>= 3.8

>= 3.0.0, < 3.3.0

>= 3.9

>= 3.3.0, < 3.7.0

>= 3.10

>= 3.7.0

ℹ️ Note:

Please note that starting with the release of v3.7.0, this library requires Python version >= 3.10. See the Python version compatibility table above for more detailed information.

⚡ Note:

As of version 3.1.0, this library is async compatible. Usage:

import rt.rest2
import httpx2

tracker = rt.rest2.AsyncRt('http://localhost/rt/REST/2.0/', http_auth=httpx2.BasicAuth('root', 'password'))
⚠️ Warning:

Though version 3.x still supports RT REST API version 1, it contains minor breaking changes. Please see the changelog in the documentation for details.

Documentation

https://python-rt.readthedocs.io/en/latest/

Installation

Install the python-rt package using:

pip install rt

Licence

This module is distributed under the terms of GNU General Public Licence v3 and was developed by CZ.NIC Labs - research and development department of CZ.NIC association - top level domain registry for .CZ. Copy of the GNU General Public License is distributed along with this module.

Usage

An example is worth a thousand words:

>>> import rt.rest2
>>> import httpx2
>>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx2.BasicAuth('root', 'password'))
>>> map(lambda x: x['id'], tracker.search(Queue='helpdesk', Status='open'))
['1', '2', '10', '15']
>>> tracker.create_ticket(queue='helpdesk', \
... subject='Coffee (important)', content='Help I Ran Out of Coffee!')
19
>>> tracker.edit_ticket(19, Requestor='addicted@example.com')
True
>>> tracker.reply(19, content='Do you know Starbucks?')
True

Get the last important updates from a specific queue that have been updated recently:

>>> import datetime
>>> import base64
>>> import rt.rest2
>>> import httpx2
>>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx2.BasicAuth('root', 'password'))
>>> fifteen_minutes_ago = str(datetime.datetime.now() - datetime.timedelta(minutes=15))
>>> tickets = tracker.last_updated(since=fifteen_minutes_ago)
>>> for ticket in tickets:
>>>     id = ticket['id']
>>>     history = tracker.get_ticket_history(id)
>>>     last_update = list(reversed([h for h in history if h['Type'] in ('Correspond', 'Comment')]))
>>>     hid = tracker.get_transaction(last_update[0]['id'] if last_update else history[0]['id'])
>>>
>>>     attachment_id = None
>>>     for k in hid['_hyperlinks']:
>>>         if k['ref'] == 'attachment':
>>>             attachment_id = k['_url'].rsplit('/', 1)[1]
>>>             break
>>>
>>>     if attachment_id is not None:
>>>         attachment = tracker.get_attachment(attachment_id)
>>>         if attachment['Content'] is not None:
>>>             content = base64.b64decode(attachment['Content']).decode()
>>>             print(content)

Please use docstrings to see how to use different functions. They are written in ReStructuredText. You can also generate HTML documentation by running make html in doc directory (Sphinx required).

Official Site

Project site, issue tracking and git repository:

https://github.com/python-rt/python-rt

Release files for rt 3.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rt 3.8.1
File Size Uploaded
rt-3.8.1.tar.gz 61.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rt 3.8.1
File Interpreter ABI Platform
rt-3.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 117.0 kB

Release files / rt-3.8.1.tar.gz

Download URL rt-3.8.1.tar.gz
Size 61.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec184c9e0893984f978f521991cb1a179353379ef837d1dc2a727b956fdc6395
BLAKE2b-256 checksum
How to use checksums
afdafc0d013f57f1a30fc1ed2d37b45fbfcacd15e26d1b79a006e7737d556a3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / rt-3.8.1-py3-none-any.whl

Download URL rt-3.8.1-py3-none-any.whl
Size 55.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd2d955eb715a0eab1829c99b5c3449d424d90f7b48aedd90837e1a6beeab268
BLAKE2b-256 checksum
How to use checksums
00c59a8a2a3c61679ea1c0629fdca6dee1519aa48b12035d611b26e6594663d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.8.1 This release

2 release files

3.8.0

1 release file

3.7.1

1 release file

3.7.0

1 release file

3.6.1

1 release file

3.6.0

1 release file

3.5.0

1 release file

3.4.0

1 release file

3.3.9

1 release file

3.3.8

1 release file

3.3.7

1 release file

3.3.6

1 release file

3.3.5

1 release file

3.3.4

1 release file

3.3.3

1 release file

3.3.2

1 release file

3.3.1

1 release file

3.3.0

1 release file

3.2.0

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

2 release files

1.0.9

2 release files

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page