Skip to main content

No project description provided

Project description

queryzen

This is the canonical queryzen client (Python).d

  • Features: 100% coverage and thorough testing.
  • Compatability with backend is directly tested and can be enforced at runtime.
  • Pythonic Ask for forgiveness (what were the initials?) and type safe API, checked with mypi.
  • 100% use of docstrings and documentation [link documentation].

Example

from querzen import QueryZen

qz = QueryZen()

# Default collection is 'main' and version is 'latest'
some_zen = qz.create("my_zen", query='select * from sys.summits where country == :country and height > :height')
print(some_zen)

# Create a Zen that has two parameters, 'country' and 'height', the character ':' is used to specify parameters.
# if no default parameters are specified, they are m
zen = qz.create(
    name="mountains",
    collection="production",
    query="select * from sys.summits where country == :country and height > :height",
    default = {
        'country': 'United States',
        'height': 0
    },
    version=32,
    description="Gets all summits from a given country and height, defaults to all summits from United States",
)

print(zen == qz.get("mountains", collection="production")) # if no version is specified, it returns the created.
# True


# Run with default values.
result = qz.run(
    zen
) # Execution is blocked, it is run synchronously.

print(result.has_data)
print()

# Run with parameters.
result = qz.run(
    zen,
    country='Spain',
    height=1200
)

print(result.as_table())
print(zen.executions.oldest.as_table())

API

Main classes are QueryZen, Zen and ZenExecutions.

QueryZen.get
QueryZen.create
QueryZen.get_or_create
QueryZen.delete
QueryZen.filter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

queryzen-0.0.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

queryzen-0.0.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file queryzen-0.0.1.tar.gz.

File metadata

  • Download URL: queryzen-0.0.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.3

File hashes

Hashes for queryzen-0.0.1.tar.gz
Algorithm Hash digest
SHA256 df75c4007ec37309005efe831d76f00b699c09198ef886d7878262edd8603725
MD5 884b5e321b63fe4c1fc118f214105ef0
BLAKE2b-256 e720e25347e169219911d106e577b1c713e4b97a5e92df690d88100b038c890c

See more details on using hashes here.

File details

Details for the file queryzen-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: queryzen-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.3

File hashes

Hashes for queryzen-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc6c201a3edcaf76402e9d617c0cfe298a312fae04fbef5215fbe5a04bc78a51
MD5 815e51a061ce84046ac28fda6bb40712
BLAKE2b-256 27892814037cc4b2bc22fc04a8921e0c7e1178da18c4598e3cff663e97985c23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page