RT Query
Abstract
Simplifies query interface for Request Tracker’s rest-api lib RT Library. Main query interface has been take from Django Framework project
Requirements
Python 3.4+
RT Library (it’s not dependency itself, but it uses in examples)
Usage
import rt
client = rt.Rt('http://localhost/rt/REST/1.0/',
basic_auth=('user', 'password'))
assert client.login()
#: rt filtering does not support `in` operation, so interface looks similar
#: to django querying, but it sticks to its limits.
query = Q(Subject__contains='[improvements]') | Q(Subject__contains='[enhancements]')
query &= Q(Queue='development', Status='sprint', Owner='User',
Priority__gt=80)
result = client.search(Queue=rt.ALL_QUEUES, raw_query=query.resolve())
print(result)
[{
"id": "ticket/471147",
"Queue": "development",
"Owner": "User",
"Creator": "User",
"Subject": "[improvements] Implement Requests Tracker simple querying",
"Status": "sprint",
"Priority": "99",
"InitialPriority": "40",
"FinalPriority": "40",
"Requestors": [
"user@example.org.fake"
],
"Created": "Thu Nov 02 19:26:40 2017",
"Starts": "Not set",
"Started": "Thu Nov 02 19:27:12 2017",
"Due": "Not set",
"Resolved": "Not set",
"Told": "Not set",
"LastUpdated": "Thu Nov 09 17:20:33 2017",
"TimeEstimated": "180 minutes",
"TimeWorked": "0",
"TimeLeft": "0",
"CF.{Tags}": "extra",
"CF.{Code Review}": "",
"CF.{Difficulty}": ""
}]
Extra functionality
In addition to existent rtquery.Q you can also try to use utils.query builder which is simple dsl to make Q objects from user input (argument parser for example)
from rtquery.utils import query
qset = query("Queue = development & Status = sprint & Owner ~ user")
result = client.search(Queue=rt.ALL_QUEUES, raw_query=query.resolve())
# ...
Metadata
Release files for rtquery 0.10.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rtquery-0.10.1.tar.gz | 16.1 kB | Without provenance | Details for rtquery-0.10.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rtquery-0.10.1-py3-none-any.whl | Python 3 | none | any | Details for rtquery-0.10.1-py3-none-any.whl |
Total release size: 37.7 kB
Release files / rtquery-0.10.1.tar.gz
| Download URL | rtquery-0.10.1.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f06c81f88c7e3b7c1be7822d54c4cc3f8a6c2898841ad0c7ab12b288ad2b68a
|
|
BLAKE2b-256 checksum How to use checksums |
f5deb0860d1b0e63bf750e1e98ebd7c7e4f553715f99c68768b041a265d61c8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / rtquery-0.10.1-py3-none-any.whl
| Download URL | rtquery-0.10.1-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dafba266bf8e3f335b9668c9c4072655e28f8790fbc052d3127e829f74fb937
|
|
BLAKE2b-256 checksum How to use checksums |
579798c9262992ad897e6bade25843b2ebc04176c7dde01b4f784525dbd6b6ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rtquery 0.10.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.