rt


Namert JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttps://github.com/CZ-NIC/python-rt
SummaryPython interface to Request Tracker API
upload_time2021-04-08 11:12:17
maintainer
docs_urlNone
authorJiri Machalek
requires_python>=3.5
licenseGNU General Public License (GPL)
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
.. image:: https://travis-ci.org/CZ-NIC/python-rt.svg?branch=master
    :target: https://travis-ci.org/CZ-NIC/python-rt
.. image:: https://readthedocs.org/projects/python-rt/badge/?version=latest
    :target: https://python-rt.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

==============================================
 Rt - Python interface to Request Tracker API 
==============================================

Python implementation of REST API described here: https://rt-wiki.bestpractical.com/wiki/REST

**Note:** Please note that starting with the major release of v2.0.0, this library requires a Python version >= 3.5.
In case you still require a Python 2 version or one compatible with Python < 3.5, please use a version < 2.0.0 of this library.


REQUIREMENTS
============

This module uses following Python modules:

- requests (http://docs.python-requests.org/)

Unit-tests are implemented using:
- nose (http://nose.readthedocs.org)


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 registy 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
    >>> tracker = rt.Rt('http://localhost/rt/REST/1.0/', 'user_login', 'user_pass')
    >>> tracker.login()
    True
    >>> map(lambda x: x['id'], tracker.search(Queue='helpdesk', Status='open'))
    ['ticket/1', 'ticket/2', 'ticket/10', 'ticket/15']
    >>> tracker.create_ticket(Queue='helpdesk', \
    ... Subject='Coffee (important)', Text='Help I Ran Out of Coffee!')
    19
    >>> tracker.edit_ticket(19, Requestors='addicted@example.com')
    True
    >>> tracker.reply(19, text='Do you know Starbucks?')
    True
    >>> tracker.logout()
    True

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

    >>> import rt
    >>> tracker = rt.Rt('http://localhost/rt/REST/1.0/', http_auth=HTTPBasicAuth(os.environ['rtuser'], os.environ['rtpasswd']))
    >>> tracker.default_queue = "my-queue"
    >>> 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'][7:]
    >>>     history = tracker.get_short_history(id)
    >>>     last_update = list(reversed([h for h in history if h[1].startswith('Correspondence added') or h[1].startswith('Comments added')]))
    >>>     hid = tracker.get_history(id, last_update[0][0] if last_update else history[0][0])[0]
    >>>     print("http://localhost/rt/Ticket/Display.html?id=%s" % id)
    >>>     print(hid['Content'])
    >>>     print("\n")


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 and issue tracking:
    https://github.com/CZ-NIC/python-rt

Git repository:
    git://github.com/CZ-NIC/python-rt.git    




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CZ-NIC/python-rt",
    "name": "rt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jiri Machalek",
    "author_email": "edvard.rejthar@nic.cz",
    "download_url": "https://files.pythonhosted.org/packages/ce/bb/bd1f03a8ecaa05bfbacb3ebd8e0da6ba8713899992ca376b04884a4df452/rt-2.1.1.tar.gz",
    "platform": "",
    "description": "\n.. image:: https://travis-ci.org/CZ-NIC/python-rt.svg?branch=master\n    :target: https://travis-ci.org/CZ-NIC/python-rt\n.. image:: https://readthedocs.org/projects/python-rt/badge/?version=latest\n    :target: https://python-rt.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n==============================================\n Rt - Python interface to Request Tracker API \n==============================================\n\nPython implementation of REST API described here: https://rt-wiki.bestpractical.com/wiki/REST\n\n**Note:** Please note that starting with the major release of v2.0.0, this library requires a Python version >= 3.5.\nIn case you still require a Python 2 version or one compatible with Python < 3.5, please use a version < 2.0.0 of this library.\n\n\nREQUIREMENTS\n============\n\nThis module uses following Python modules:\n\n- requests (http://docs.python-requests.org/)\n\nUnit-tests are implemented using:\n- nose (http://nose.readthedocs.org)\n\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 registy 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\n    >>> tracker = rt.Rt('http://localhost/rt/REST/1.0/', 'user_login', 'user_pass')\n    >>> tracker.login()\n    True\n    >>> map(lambda x: x['id'], tracker.search(Queue='helpdesk', Status='open'))\n    ['ticket/1', 'ticket/2', 'ticket/10', 'ticket/15']\n    >>> tracker.create_ticket(Queue='helpdesk', \\\n    ... Subject='Coffee (important)', Text='Help I Ran Out of Coffee!')\n    19\n    >>> tracker.edit_ticket(19, Requestors='addicted@example.com')\n    True\n    >>> tracker.reply(19, text='Do you know Starbucks?')\n    True\n    >>> tracker.logout()\n    True\n\nGet the last important updates from a specific queue that have been updated recently::\n\n    >>> import rt\n    >>> tracker = rt.Rt('http://localhost/rt/REST/1.0/', http_auth=HTTPBasicAuth(os.environ['rtuser'], os.environ['rtpasswd']))\n    >>> tracker.default_queue = \"my-queue\"\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'][7:]\n    >>>     history = tracker.get_short_history(id)\n    >>>     last_update = list(reversed([h for h in history if h[1].startswith('Correspondence added') or h[1].startswith('Comments added')]))\n    >>>     hid = tracker.get_history(id, last_update[0][0] if last_update else history[0][0])[0]\n    >>>     print(\"http://localhost/rt/Ticket/Display.html?id=%s\" % id)\n    >>>     print(hid['Content'])\n    >>>     print(\"\\n\")\n\n\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 and issue tracking:\n    https://github.com/CZ-NIC/python-rt\n\nGit repository:\n    git://github.com/CZ-NIC/python-rt.git    \n\n\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License (GPL)",
    "summary": "Python interface to Request Tracker API",
    "version": "2.1.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "d573bfa2a0c3cbc5485b91be51ec6d4e",
                "sha256": "2affb740986e9f0a334c52fd9fd1fd3a88b0a3fcdf09252d88f791164ae3de2e"
            },
            "downloads": -1,
            "filename": "rt-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d573bfa2a0c3cbc5485b91be51ec6d4e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 30467,
            "upload_time": "2021-04-08T11:12:16",
            "upload_time_iso_8601": "2021-04-08T11:12:16.044281Z",
            "url": "https://files.pythonhosted.org/packages/fb/d4/37898f95d5f4e8a181bbe85c12eed6ed9286b0672326578b39c44037207a/rt-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "8f9590a0948c746fdd0687c9d651c3bf",
                "sha256": "976b39a87fb09cd9f33937bd2d00b529011681a2bee31c97cc8f1fd99240be4f"
            },
            "downloads": -1,
            "filename": "rt-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8f9590a0948c746fdd0687c9d651c3bf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 40904,
            "upload_time": "2021-04-08T11:12:17",
            "upload_time_iso_8601": "2021-04-08T11:12:17.035537Z",
            "url": "https://files.pythonhosted.org/packages/ce/bb/bd1f03a8ecaa05bfbacb3ebd8e0da6ba8713899992ca376b04884a4df452/rt-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-04-08 11:12:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "CZ-NIC",
    "error": "Could not fetch GitHub repository",
    "lcname": "rt"
}
        
Elapsed time: 0.33281s