inmation API Client
This API client can only be used with the new inmation Web API server.
Install
Install with pip install inmation-api-client.
Dependencies
- websockets, will be installed automatically when installing with
pip.
Documentation
Visit the api client documentation page on the inmation's docs website for various usage examples and more.
How to use it
Advanced authentication options
-
authority can be inmation, ad (Active Directory - domain account), machine (local account)
-
username can be provided in 'User Principal Name' or 'Down-Level Logon Name'
source: https://docs.microsoft.com/en-us/windows/desktop/secauthn/user-name-formats
auth authentication and authorization fields:
options = {
'auth': {
'username': '',
'password': '',
'authority': 'inmation | ad | machine',
'grant_type': 'password',
'include_claims': ['email', 'family_name', 'given_name', 'middle_name', 'phone_number']
},
'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'
}
include_claims can only be used in combination with authority set to ad. The token will not be returned
to the client but passed via the req argument into ExecFunction implementation.
Note: check Web API version which authorization options its supports.
Example Active Directory authentication:
options = {
'auth': {
'username': 'user@domain.com',
'password': 'secret',
'authority': 'ad',
'grant_type': 'password'
}
}
Example Bearer token authentication:
options = {
'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'
}
Example Basic authentication:
options = {
'authorization': 'Basic dXNlcm5hbWU6cGFzc3dvcmQ='
}
Connect and Read example
from inmation_api_client import Client, Options, Item
def create_client():
options = Options({
'auth': {
'username': 'user@domain.com',
'password': 'secret',
'authority': 'ad',
'grant_type': 'password'
}
})
client = Client()
client.Connect('127.0.0.1', 8002, options)
def connection_changed(conn_info):
print('Connection state: {}, authenticated: {}'.format(conn_info.state_string, conn_info.authenticated))
client.OnConnectionChanged(connection_changed)
def on_error(err):
if err:
print("Error: {}".format(err.message))
client.OnError(on_error)
return client
def main():
items_path = "/System/Core/"
# Make sure you have some items with historical data
items = [Item(items_path + i) for i in ['Item01', 'Item02', 'Item03']]
client = create_client()
# Read values syncroniously
response = client.Read(items)
print(response['data'])
if __name__ == '__main__':
main()
inmation
inmation is a vendor-independent industrial system-integration specialist. Dedicated to modern technologies such as OPC UA (Unified Architecture) and document-oriented schema-less repositories, inmation opens up new horizons for enterprise real-time data management.
More information on inmation.com
License
MIT
Metadata
Release files for inmation-api-client 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inmation-api-client-0.11.0.tar.gz | 24.6 kB | Without provenance | Details for inmation-api-client-0.11.0.tar.gz |
Release files / inmation-api-client-0.11.0.tar.gz
| Download URL | inmation-api-client-0.11.0.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40d23aa8dd055e32eaef8aa115d09ae1bd6bffee7b9f8538c6d443f735e61762
|
|
BLAKE2b-256 checksum How to use checksums |
6fe74103ff0082a2b6a4e1d33b88e989db368a7e7a3b753c49927bada5b3278c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for inmation-api-client 0.11.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.