Skip to main content

Venomics-API-Client

PyPI version fury.io PyPI pyversions PyPI license

The official API client and utilities to manage a Venomics instance written in Python.

Installation

To install it you will need Python 3.6 or above. We recommend that you use a virtual environment.

pip install --upgrade venomics-client

This command will update venomics-client if you have already installed it.

API Authentication

All the API calls support authentication with an API key. Venomics has two types of API keys:

  • User API Key: has the same permissions as the user who owns it. Can be found on a user profile page.

  • Query API Key: has access only to the query and its results. Can be found on the query page.

  • Whenever possible we recommend using a Query API key

Getting Started

from venomics_client import VenomicsAPIClient

# Create API client instance
"""
    :args:
    API_KEY
    VENOMICS_HOST (optional): `https://www.venomics.xyz/` by default
"""
venomics = VenomicsAPIClient(API_KEY)

API REFERENCE

Common Endpoints

Below is an incomplete list of Venomics's API endpoints as of V9. These may change in future versions of Venomics.

Each endpoint is appended to your Venomics base URL. For example:

  • https://www.venomics.xyz/<slug>

Queries

/queries

  • GET: Returns a paginated array of query objects.

    • Includes the most recent query_result_id for non-parameterized queries.
     venomics.queries()
    
  • POST: Create a new query object

/queries/<id>

  • GET: Returns an individual query object

    venomics.get_query(query_id="")
    
  • POST: Edit an existing query object.

  • DELETE: Archive this query.

/queries/<id>/results

  • GET: Get a cached result for this query ID.

    • Only works for non parameterized queries. If you attempt to GET results for a parameterized query you'll receive the error: no cached result found for this query. See POST instructions for this endpoint to get results for parameterized queries.
  • POST: Initiates a new query execution or returns a cached result.

    • The API prefers to return a cached result. If a cached result is not available then a new execution job begins and the job object is returned. To bypass a stale cache, include a max_age key which is an integer number of seconds. If the cached result is older than max_age, the cache is ignored and a new execution begins. If you set max_age to 0 this guarantees a new execution.
    • If passing parameters, they must be included in the JSON request body as a parameters object.

Here's an example JSON object including different parameter types:

{ 
    "parameters": {
    	"number_param": 100,
    	"date_param": "2020-01-01",
    	"date_range_param": {
    		"start": "2020-01-01",
    		"end": "2020-12-31"
    		}
    	},
      "max_age": 1800
    }
}

Jobs

/jobs/<job_id>

  • GET: Returns a query task result (job)
    • Possible statuses:
      • 1 == PENDING (waiting to be executed)
      • 2 == STARTED (executing)
      • 3 == SUCCESS
      • 4 == FAILURE
      • 5 == CANCELLED
    • When status is success, the job will include a query_result_id

Query Results

/query_results/<query_result_id>

  • GET: Returns a query result
    • Appending a filetype of .csv or .json to this request will return a downloadable file. If you append your api_key in the query string, this link will work for non-logged-in users.

Dashboards

/dashboards

  • GET: Returns a paginated array of dashboard objects.

     venomics.dashboards()
    
  • POST: Create a new dashboard object

/dashboards/<dashboard_slug>

  • GET: Returns an individual dashboard object.

     venomics.get_dashboard(id="")
    
  • DELETE: Archive this dashboard

/dashboards/<dashboard_id>

  • POST: Edit an existing dashboard object.

Example scripts

With venomics-client installed you will have access to several example CLI scripts within your terminal.

gdpr-scrub                  Search for a string term in  your Venomics queries
                            and query results. The script returns a list of
                            URLs in your instance that contain references to
                            the search term you provide
find-tables                 Search the text of queries against a data source
                            to see which table names are used in queries of
                            that source. This script relies on regex that is
                            tested against ANSI SQL.
clone-dashboard-and-queries Completely duplicate a dashboard by copying all 
                            its queries and visualizations.
export-queries              Export all the queries of your Venomics instance
                            as text files.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for venomics-client 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for venomics-client 0.1.1
File Size Uploaded Provenance Actions
venomics-client-0.1.1.tar.gz 9.9 kB Without provenance Details for venomics-client-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for venomics-client 0.1.1
File Interpreter ABI Platform Actions
venomics_client-0.1.1-py3-none-any.whl Python 3 none any Details for venomics_client-0.1.1-py3-none-any.whl

Total release size: 17.9 kB

Release files / venomics-client-0.1.1.tar.gz

Download URL venomics-client-0.1.1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e18910d2edc8b2ae422a7078d988211af47f6bbc0218a3134d83a616cbc1cae1
BLAKE2b-256 checksum
How to use checksums
f410f70d0cb5319fbc4d083759f64c3fbbf6c23090101732334245566423557e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release files / venomics_client-0.1.1-py3-none-any.whl

Download URL venomics_client-0.1.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22099f85a5d834cc860b411c6fdeee29181887cc872d29087e9a0fc261ab136f
BLAKE2b-256 checksum
How to use checksums
61d4c5ce16fd0c09891b811163802c4944d7deb3bafa0149c32a3df518411d6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Security for venomics-client 0.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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page