Skip to main content

Vantiq SDK for Python

The Vantiq Python SDK is a Python package that provides an API into a Vantiq system from Python applications. The SDK connects to a Vantiq system using the Vantiq REST API.

Installation

The SDK is installed from the PyPI repo. To install this into your system, use

    pip install vantiqsdk

Note: depending on your local environment, you may need to use pip3 instead of pip, or whatever is appropriate to install into your virtual environment.

The Vantiq SDK for Python requires Python version 3.10 or better. It is built using asyncio, aiohttp, and websockets. In the documentation that follows, methods marked as Async must be awaited. For more information about asyncio and await, please see the Python asyncio documentation).

Quick Start

You will need valid credentials on a Vantiq server in the form of a username and password or access token. If you have a private Vantiq server, contact your administrator for credentials. If you wish to use the Vantiq public cloud, contact support@vantiq.com.

The first step is to create an instance of the Vantiq SDK providing the URL of the Vantiq server to connect:

from vantiqsdk import Vantiq, VantiqResources, VantiqResponse
import vantiqsdk

server: str = "https://dev.vantiq.com"

vantiq: Vantiq = Vantiq(server)

where server is the full URL for the Vantiq server to connect to, such as https://dev.vantiq.com/. An optional second argument is the version of the API to connect to. If not specified, this defaults to the latest version, currently 1. At this point, the Vantiq instance has not yet connected to the server.
To establish a connection to the server, use the authenticate method, e.g.,

username = "joe@user"
password = "my-secr3t-passw0rd!#!"

await vantiq.authenticate(username, password)

The username and password are the same credentials used to log into the system. Note the username and password are not stored either in-memory or persistently after this authentication call. After successfully authenticating with the system, the Vantiq instance stores an in-memory access token that subsequent API calls will use.

Now, you are able to perform any SDK calls to the Vantiq server. The async methods on the SDK classes can be immediately awaited to run in, effectively, a synchronous fashion, or they can return an Awaitable that can be awaited later.

vr: VantiqResponse = await vantiq.select(VantiqResources.TYPES)

Alternatively,

to_await = vantiq.select(VantiqResources.TYPES)
...
vr: VantiqResponse = await to_await

In either case, the response to the operation is available in the VantiqResponse instance.

Documentation

For the full documentation on the SDK, see the SDK API Reference.

Developers

The project is set up as a gradle project. To run the tests, use

./gradlew test

or

gradlew.bat test

in a windows environment.

The tests run will run a mocked version. To execute tests against a live server, define the following gradle properties in your ~/.gradle/gradle.properties file:

# Python project values
TestVantiqServer=<Vantiq server url> # Only do the base URL. Ex http://localhost:8080/
TestAccessToken=<access token from that Vantiq system>
TestVantiqUsername=<Vantiq user name>
TestVantiqPassword=<Password for that Vantiq user>

Alternatively, when running directly, use the following environment variables:

VANTIQ_URL <Vantiq erver url>
VANTIQ_ACCESS_TOKEN <Access token from that Vantiq system>
VANTIQ_USERNAME <Vantiq user name>
VANTIQ_PASSWORD <Password for that Vantiq user>

Copyright © 2022 Vantiq, Inc. Code released under the MIT license.

Metadata

Release files for vantiqsdk 1.6.0

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

Source distribution (sdist)

Source distribution for vantiqsdk 1.6.0
File Size Uploaded Provenance
vantiqsdk-1.6.0.tar.gz 21.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for vantiqsdk 1.6.0
File Interpreter ABI Platform
vantiqsdk-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / vantiqsdk-1.6.0.tar.gz

Download URL vantiqsdk-1.6.0.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c9daf9c8774cf5405e2ae372e008c34d0494a612d125c5eb56d4a8f6cb2e9ae6
BLAKE2b-256 checksum
How to use checksums
c258d8b06c550ebb61eb7ff0856502c83855c8d7217a1e9d8389eb8abdb336c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / vantiqsdk-1.6.0-py3-none-any.whl

Download URL vantiqsdk-1.6.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
043e62fd781337e9689389032413f5975e3acd23e8c627087a290f8555a07143
BLAKE2b-256 checksum
How to use checksums
4e6f6fccff4abba1f4d9b1950354b4a531d01fa7fbd472d16226e3a8fa5e8104
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Security for vantiqsdk 1.6.0

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

1.6.0 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