venra
Venra provides a simple, high-level api for vespa.ai.
Venra targets subsets of Vespa's query, document, and system apis. It aims to encapsulate the complexity of dealing with the Vespa http interfaces, response behaviors, and json responses for common client tasks.
Venra is well suited for web backends, command line tools, and enrichment programs which need to retrieve, process, and update documents.
import venra
qdata = {}
qdata["yql"] = "select * from sources awesome_docs;"
response = venra.query.search(qdata)
docs = venra.query.extract_docs(response)
for r, doc in enumerate(docs):
print(f"rank: {r} >> {doc.some_id} title: {doc.title}")
Note: This library is under active development and the api could change in the future.
Installation
$ pip install venra
Usage
Basic Query:
import venra
# Build query
qdata = {}
qdata["yql"] = "select * from sources baz;"
# Run query
response = venra.query.search(qdata)
# Extract results via helpers
metrics = venra.query.extract_metrics(response)
docs = venra.query.extract_docs(response)
User Query and Grouping:
from pprint import pprint
from venra import config as vconfig
from venra import query as vquery
# Configure
user_query = "machine learning"
vconfig.vespa_host_app = "http://localhost:8080"
# Build query including a grouping
qdata = {}
qdata["yql"] = "select post_id, post_date from sources baz where userQuery()"
qdata["yql"] += f" | all(group(time.date(post_date)) order(-max(post_date)) max(32) each(output(count())) as(day_counts) );"
qdata["hits"] = 10
qdata["timeout"] = "3300ms"
qdata["model.queryString"] = user_query
qdata["model.type"] = "weakAnd"
qdata["presentation.summary"] = "full"
qdata["presentation.timing"] = "true"
# Run query
response = vquery.search(qdata)
# Extract results via helpers
metrics = vquery.extract_metrics(response)
groups = vquery.extract_groups(response)
myfacet = vquery.extract_group_pairs(groups, "day_counts", "count()")
docs = vquery.extract_docs(response)
# Query results ready for use in app
pprint(metrics)
pprint(myfacet)
pprint(docs)
Release files for venra 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| venra-0.1.8.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| venra-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:20.1 kB
Release files / venra-0.1.8.tar.gz
| Download URL | venra-0.1.8.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b680e29213d5be2588ea03d511608a634ea1b3d6b7602e91fceff39a2a759312
|
|
BLAKE2b-256 checksum How to use checksums |
f4a96ec45d684f7e83123e232469e68f9a8602ec22030af60d60b3d61cd99dce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.
Transparency logRelease files / venra-0.1.8-py3-none-any.whl
| Download URL | venra-0.1.8-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66852ab32253349ef1d8df040ef2fb7b3128cbef2ec43e87d7673c42ae90c66b
|
|
BLAKE2b-256 checksum How to use checksums |
c5f4ac056fc21db0fde4db66c3ac436f19edd7b97308b72d6cb5b9885dd54634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.
Transparency log