Validaus Python Module
Project description
Validaus Python Module
This is a Python wrapper around Validaus API calls. See below for examples. The code below can also be dynamically generated for you in the Code Integration tab of the Validaus UI.
Instantiate Validaus
from validaus import Validaus
vd = Validaus(
validausURL='http://localhost:4001',
app="my-app-id",
apiKey="13252a7a-d933-4aaa-a9a5-7b480f0c3223"
)
Pull Mode (i.e. "Build Health" in the UI)
Use the code below to run a regression test on multiple facts, and get a full validation report from Validaus. This is most suitable to integrate into your CI.
# First, get all Facts that this App is subscribed to
facts = vd.getFacts(metric="my-metric-id")
# Next, run your own code here.
# Plug the params for each fact into your code,
# and save the resulting value. You'll submit
# these to Validaus in the final step.
# Finally, stream all Facts to Validaus with your code's values.
# Validaus will return an object with information on your
# data accuracy across all subscribed playbooks.
resp = vd.validateFacts(
metric="my-metric-id",
facts=[
{
"paramValues": [
{ "name": "b", "value": YOUR_PARAM_NUMERIC_VALUE },
{ "name": "a", "value": YOUR_PARAM_NUMERIC_VALUE }
],
"value": YOUR_FACT_NUMERIC_VALUE
},
{
"paramValues": [
{ "name": "b", "value": YOUR_PARAM_NUMERIC_VALUE },
{ "name": "a", "value": YOUR_PARAM_NUMERIC_VALUE }
],
"value": YOUR_FACT_NUMERIC_VALUE
}
]
)
Push Mode (i.e. "Live Health" in the UI)
In Push mode, stream a Fact to Validaus in any environment, and receive reports and alerts about any errors. This is most suitable for catching live errors, typically in production.
# Stream a Fact to Validaus - put this code snippet in the part
# of your code that is producing the data you want to validate.
vd.publishFact(
metric="my-metric-id",
fact={
"paramValues": [
{ "name": "b", "value": YOUR_PARAM_NUMERIC_VALUE },
{ "name": "a", "value": YOUR_PARAM_NUMERIC_VALUE }
],
"value": YOUR_FACT_NUMERIC_VALUE
}
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file validaus-0.1.6.tar.gz.
File metadata
- Download URL: validaus-0.1.6.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6ebcaa1db48ae3f01bd2e294c46042b67ad948af66db7a0515cfa63bba8a82
|
|
| MD5 |
40b92b71697f9e9dfa07b4a86e6bb464
|
|
| BLAKE2b-256 |
da387c1b538bab896a2993aa71744638d28fdadb42b6947cd61ab4c8bc7f83d0
|
File details
Details for the file validaus-0.1.6-py3-none-any.whl.
File metadata
- Download URL: validaus-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc38c92e184bece30f209d22e787feabd8dffe1aca795392b3141f3c3884be65
|
|
| MD5 |
8abf3dd4bda9a5003b7413c3b4661cda
|
|
| BLAKE2b-256 |
472273dd8208afb60ae9cb63a6e85fa7acac98557ac170aa722ae0c24de02db3
|