Name | rt JSON |
Version |
3.3.3
JSON |
| download |
home_page | None |
Summary | Python interface to Request Tracker API |
upload_time | 2024-12-02 12:11:58 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | GNU General Public License v3 (GPLv3) |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
.. image:: https://codebeat.co/badges/a52cfe15-b824-435b-a594-4bf2be2fb06f
:target: https://codebeat.co/projects/github-com-python-rt-python-rt-master
:alt: codebeat badge
.. image:: https://github.com/python-rt/python-rt/actions/workflows/test_lint.yml/badge.svg
:target: https://github.com/python-rt/python-rt/actions/workflows/test_lint.yml
:alt: tests
.. image:: https://readthedocs.org/projects/python-rt/badge/?version=stable
:target: https://python-rt.readthedocs.io/en/stable/?badge=stable
:alt: Documentation Status
.. image:: https://badge.fury.io/py/rt.svg
:target: https://badge.fury.io/py/rt
==============================================
Rt - Python interface to Request Tracker API
==============================================
Python implementation of REST API described here:
- https://rt-wiki.bestpractical.com/wiki/REST
- https://docs.bestpractical.com/rt/5.0.2/RT/REST2.html
.. csv-table:: Python version compatibility:
:header: "Python", "rt"
:widths: 15, 15
"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"
ℹ️ **Note**:
Please note that starting with the release of v3.3.0, this library requires Python version >= 3.9.
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 httpx
tracker = rt.rest2.AsyncRt('http://localhost/rt/REST/2.0/', http_auth=httpx.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.
Requirements
============
This module uses following Python modules:
- requests (http://docs.python-requests.org/)
- requests-toolbelt (https://pypi.org/project/requests-toolbelt/)
- typing-extensions (depending on python version)
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 httpx
>>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx.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 httpx
>>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx.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 = c.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
Raw data
{
"_id": null,
"home_page": null,
"name": "rt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Georges Toth <georges.toth@govcert.etat.lu>",
"download_url": null,
"platform": null,
"description": ".. image:: https://codebeat.co/badges/a52cfe15-b824-435b-a594-4bf2be2fb06f\n :target: https://codebeat.co/projects/github-com-python-rt-python-rt-master\n :alt: codebeat badge\n.. image:: https://github.com/python-rt/python-rt/actions/workflows/test_lint.yml/badge.svg\n :target: https://github.com/python-rt/python-rt/actions/workflows/test_lint.yml\n :alt: tests\n.. image:: https://readthedocs.org/projects/python-rt/badge/?version=stable\n :target: https://python-rt.readthedocs.io/en/stable/?badge=stable\n :alt: Documentation Status\n.. image:: https://badge.fury.io/py/rt.svg\n :target: https://badge.fury.io/py/rt\n\n==============================================\n Rt - Python interface to Request Tracker API \n==============================================\n\nPython implementation of REST API described here:\n - https://rt-wiki.bestpractical.com/wiki/REST\n - https://docs.bestpractical.com/rt/5.0.2/RT/REST2.html\n\n.. csv-table:: Python version compatibility:\n :header: \"Python\", \"rt\"\n :widths: 15, 15\n\n \"2.7\", \"< 2.0.0\"\n \">= 3.5, <3.7\", \">= 2.0.0, < 3.0.0\"\n \">= 3.7\", \">= 3.0.0, < 3.1.0\"\n \">= 3.8\", \">= 3.0.0, < 3.3.0\"\n \">= 3.9\", \">= 3.3.0\"\n\n\u2139\ufe0f **Note**:\n Please note that starting with the release of v3.3.0, this library requires Python version >= 3.9.\n See the *Python version compatibility* table above for more detailed information.\n\n\u26a1 **Note**:\n As of version 3.1.0, this library is async compatible.\n Usage::\n\n import rt.rest2\n import httpx\n\n tracker = rt.rest2.AsyncRt('http://localhost/rt/REST/2.0/', http_auth=httpx.BasicAuth('root', 'password'))\n\n\u26a0\ufe0f **Warning**:\n Though version 3.x still supports RT REST API version 1, it contains minor breaking changes. Please see the changelog\n in the documentation for details.\n\nRequirements\n============\n\nThis module uses following Python modules:\n - requests (http://docs.python-requests.org/)\n - requests-toolbelt (https://pypi.org/project/requests-toolbelt/)\n - typing-extensions (depending on python version)\n\nDocumentation\n=============\nhttps://python-rt.readthedocs.io/en/latest/\n\nInstallation\n============\n\nInstall the python-rt package using::\n\n pip install rt\n\n\nLicence\n=======\n\nThis module is distributed under the terms of GNU General Public Licence v3\nand was developed by CZ.NIC Labs - research and development department of\nCZ.NIC association - top level domain registry for .CZ. Copy of the GNU\nGeneral Public License is distributed along with this module.\n\nUsage\n=====\n\nAn example is worth a thousand words::\n\n >>> import rt.rest2\n >>> import httpx\n >>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx.BasicAuth('root', 'password'))\n >>> map(lambda x: x['id'], tracker.search(Queue='helpdesk', Status='open'))\n ['1', '2', '10', '15']\n >>> tracker.create_ticket(queue='helpdesk', \\\n ... subject='Coffee (important)', content='Help I Ran Out of Coffee!')\n 19\n >>> tracker.edit_ticket(19, Requestor='addicted@example.com')\n True\n >>> tracker.reply(19, content='Do you know Starbucks?')\n True\n\nGet the last important updates from a specific queue that have been updated recently::\n\n >>> import datetime\n >>> import base64\n >>> import rt.rest2\n >>> import httpx\n >>> tracker = rt.rest2.Rt('http://localhost/rt/REST/2.0/', http_auth=httpx.BasicAuth('root', 'password'))\n >>> fifteen_minutes_ago = str(datetime.datetime.now() - datetime.timedelta(minutes=15))\n >>> tickets = tracker.last_updated(since=fifteen_minutes_ago)\n >>> for ticket in tickets:\n >>> id = ticket['id']\n >>> history = tracker.get_ticket_history(id)\n >>> last_update = list(reversed([h for h in history if h['Type'] in ('Correspond', 'Comment')]))\n >>> hid = tracker.get_transaction(last_update[0]['id'] if last_update else history[0]['id'])\n >>>\n >>> attachment_id = None\n >>> for k in hid['_hyperlinks']:\n >>> if k['ref'] == 'attachment':\n >>> attachment_id = k['_url'].rsplit('/', 1)[1]\n >>> break\n >>>\n >>> if attachment_id is not None:\n >>> attachment = c.get_attachment(attachment_id)\n >>> if attachment['Content'] is not None:\n >>> content = base64.b64decode(attachment['Content']).decode()\n >>> print(content)\n\n\n\t\t\nPlease use docstrings to see how to use different functions. They are written\nin ReStructuredText. You can also generate HTML documentation by running\n``make html`` in doc directory (Sphinx required).\n\nOfficial Site\n=============\n\nProject site, issue tracking and git repository:\n https://github.com/python-rt/python-rt\n",
"bugtrack_url": null,
"license": "GNU General Public License v3 (GPLv3)",
"summary": "Python interface to Request Tracker API",
"version": "3.3.3",
"project_urls": {
"Changelog": "https://github.com/python-rt/python-rt/blob/master/CHANGELOG.md",
"Documentation": "https://python-rt.readthedocs.io/",
"Homepage": "https://github.com/python-rt/python-rt",
"Source": "https://github.com/python-rt/python-rt",
"Tracker": "https://github.com/python-rt/python-rt/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a2d487011994c96ddfcf6f45535ad53fab403f45e539589bb48dde5fc8643aaa",
"md5": "de547cdbae33e65302e7b9d0cd312233",
"sha256": "a1795a620d0bf6b1a563fc10a0c44a76f8a7c54989f152799ec9555a612470ed"
},
"downloads": -1,
"filename": "rt-3.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "de547cdbae33e65302e7b9d0cd312233",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 53505,
"upload_time": "2024-12-02T12:11:58",
"upload_time_iso_8601": "2024-12-02T12:11:58.948127Z",
"url": "https://files.pythonhosted.org/packages/a2/d4/87011994c96ddfcf6f45535ad53fab403f45e539589bb48dde5fc8643aaa/rt-3.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 12:11:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "python-rt",
"github_project": "python-rt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rt"
}