Vantiq Python Execution Connector
The Vantiq Python Execution Connector is a Python package that provides the ability to execute Python code as directed by a Vantiq server
Installation
The connector is installed from the PyPI repo. To install this into your system, use
pip install vantiqPythonExecConnector
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 Python Execution Connector requires Python version 3.10 or better.
Quick Start
Connector Configuration
You will need valid credentials on a Vantiq server in the form of an 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 information required is placed in a server.config file in the serverConfig directory below the working directory from which the connector will be run. The format is as follows:
targetServer = ...
authToken = ...
sources = ...
An example file might be
targetServer = https://dev.vantiq.com
authToken = _cDWBfZLNO9FkXd-twjwKnVIBZSGwns35nF4nQFV_ps=
sources = pythonSource
As outlined in the vantiqconnectorsdk, there is also the option of providing extra keyword arguments that will be used to make connections to Vantiq. These will be used both for the vantiqconnectorsdk connection as well any "regular" Vantiq connections used. These are use, for example, for reading documents containing Python code.
To make use of this capability, include the connectKWArgs property in your config file.
A special case is use for disabling SSL verification (often used in development environments). To do this, use the
argument disableSslVerification. This sets up both the connector's websocket connection and the auxiliary
Vantiq connection to skip SSL verification. Doing so, internally, requires some Python code not directly
representable in JSON. The following example shows how this is done.
targetServer = https://dev.vantiq.com
authToken = _cDWBfZLNO9FkXd-twjwKnVIBZSGwns35nF4nQFV_ps=
sources = pythonSource
connectKWArgs={ "disableSslVerification": true }
For users who may not want to write the authToken property to a file because of its sensitive nature, set the environment variable CONNECTOR_AUTH_TOKEN to its value. If the authToken is specified in the server.config document, that value will take precedence.
Otherwise, if the authToken is not set in the configuration file, the system will retrieve whatever value is provided in the environment variable.
Note that this token will not work -- you will need to create your own within a VANTIQ installation
You should also provide an appropriate logger.ini file in the same directory.
An example file is provided at src/test/resources/logger.ini in this project's github repository.
Running the Connector
Once you have the connector configuration (serverConfig/server.config) and logging configuration (serverConfig/logger.ini) files set up, you can run the connector using the command
vantiqPythonExecConnector
On startup, the connector will connect to the configured Vantiq server awaiting calls to run Python code. No other interaction is necessary.
Documentation
For the full documentation on the SDK, see the documentation available at the github repository. This README file provides the basics; more detailed information is available in docs/Usage.md.
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:
# Python project values
TestVantiqServer=<Vantiq server url>
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 and License
Copyright © 2022 Vantiq, Inc. Code released under the MIT license.
The MIT License (MIT)
Copyright (c) 2022 Vantiq, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for vantiqPythonExecConnector 1.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vantiqpythonexecconnector-1.3.4.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vantiqpythonexecconnector-1.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.2 kB
Release files / vantiqpythonexecconnector-1.3.4.tar.gz
| Download URL | vantiqpythonexecconnector-1.3.4.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79705632fec2364338d102a2b2d4607e522c59ca3312f321a52321a260e8ee36
|
|
BLAKE2b-256 checksum How to use checksums |
072f30a2e3f83306413821309633499ea769c18b2b3290b9d074b2525b17ebc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / vantiqpythonexecconnector-1.3.4-py3-none-any.whl
| Download URL | vantiqpythonexecconnector-1.3.4-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d6c90d5e08ab07e68ed689a2bc0cd76d8e19c688f6d14756efb029d49a45e43
|
|
BLAKE2b-256 checksum How to use checksums |
2a965e12aad2ff5667ec9f56b510064fe4b098f1a2ddf23a73c4dd5e55705f55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|