queuery_client_python
Queuery Redshift HTTP API Client for Python
Installation
pip install queuery-client
Usage
Prerequisites
Set the following envronment variables to connect Queuery server:
QUEUERY_TOKEN: Specify Queuery access tokenQUEUERY_TOKEN_SECRET: Specify Queuery secret access tokenQUEUERY_ENDPOINT: Specify a Queuery endpoint URL via environment variables if you don't set theendpointargument ofQueueryClientin you code
Basic Usage
from queuery_client import QueueryClient
client = QueueryClient(endpoint="https://queuery.example.com")
response = client.run("select column_a, column_b from the_great_table")
# (a) iterate `response` naively
for elems in response:
print(response)
# (b) invoke `read()` to fetch all records
print(response.read())
# (c) invoke `read()` with `use_pandas=True` (returns `pandas.DataFrame`)
print(response.read(use_pandas=True))
Type Cast
By default, QueueryClient returns all values as str regardless of their definitions on Redshift.
You can use the enable_cast option to automatically convert types of the returned values into appropreate ones based on their definitions.
from queuery_client import QueueryClient
client = QueueryClient(
endpoint="https://queuery.example.com",
enable_cast=True, # Cast types of the returned values automatically!
)
sql = "select 1, 1.0, 'hoge', true, date '2021-01-01', timestamp '2021-01-01', null"
response = client.run(sql)
response.read() # => [[1, 1.0, 'hoge', True, datetime.date(2021, 1, 1), datetime.datetime(2021, 1, 1, 0, 0), None]]
Metadata
Release files for queuery-client 1.1.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 |
|---|---|---|---|---|
| queuery_client-1.1.1.tar.gz | 6.9 kB | Without provenance | Details for queuery_client-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| queuery_client-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for queuery_client-1.1.1-py3-none-any.whl |
Total release size: 15.0 kB
Release files / queuery_client-1.1.1.tar.gz
| Download URL | queuery_client-1.1.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df5aaeee163b7959a57f7c1e81c2da2dff16cce4fe911313f01ecf32494aba21
|
|
BLAKE2b-256 checksum How to use checksums |
49b9b497e150d582bbd3a4a1774911607da0cc14fc1f952522ff6809a837b282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.1 Linux/6.5.0-1025-azure
|
Release files / queuery_client-1.1.1-py3-none-any.whl
| Download URL | queuery_client-1.1.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1b22be83e6636b8e99d0ae484fdd68b41f5a612063864766dd1ae186b2d2734
|
|
BLAKE2b-256 checksum How to use checksums |
4a7f1a7642ff991ea74891ca7e96818d5c78d97ba60bfd4bc90f27dd9bf67be2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.1 Linux/6.5.0-1025-azure
|
Security for queuery-client 1.1.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.