Skip to main content

Kepware Configuration API SDK for Python

PyPI version

This is a package SDK to create Python modules to conduct operations with the Kepware Configuration API. This package is designed to work with all versions of Kepware that support the Configuration API including Thingworx Kepware Server (TKS), Thingworx Kepware Edge (TKE) and KEPServerEX (KEP).

Prerequisites

The client libraries are supported on Python 3.6 or later. All HTTP communication is handled by the urllib Python standard library.

Features

  • Supports both HTTP and HTTPS connections with certificate validation options

SDK allows for GET, ADD, DELETE, and MODIFY functions for the following Kepware configuration objects:

Features TKS/KEP TKE
Project Properties
(Get and Modify Only)
Y Y
Connectivity
(Channel, Devices, Tags, Tag Groups)
Y Y
IoT Gateway
(Agents, IoT Items)
Y Y
Datalogger
(Log Groups, Items, Mapping, Triggers, Reset Mapping Service)
Y Y
Administration
(User Groups, Users, UA Endpoints, Local License Server)
Y* Y

Note (*) - UA Endpoints and Local License Server supported for Kepware Edge only

Driver specific features:

Driver Features
GE Ethernet Global Data Exchanges, Ranges and Name Resolutions

Methods to read the following logs:

Logs TKS/KEP TKE
Event Log Y Y
API Transaction Log Y Y

Configuration API Services implemented:

Services TKS/KEP TKE
TagGeneration
(for supported drivers)
Y Y
ReinitializeRuntime Y* Y

Note (*) - Reinitialize service was implemented for Kepware Server v6.8+

Generic REST methods are provided to use for functions not developed in SDK package. These are found in the Server Class in connection.py

Known Limitations

  • Other property configuration for more complex drivers with objects besides channels, devices, tags and tag groups are not explicitly defined
  • Other supported plug-ins (EFM Exporter, Scheduler, etc) are not defined
  • When using hostnames (not IP addresses) for connections, delays may occur under certain network configurations as the connection may attempt IPv6 connections first. IPv6 is not supported by Kepware servers at this time.

Installation

Package can be installed with pip using the following:

    pip install kepconfig

Key Concepts

NOTE: Samples can also be found in the samples folder.

Create server connection

import kepconfig.connection

server = connection.server(host = '127.0.0.1', port = 57412, user = 'Administrator', pw = '')

# For HTTPS connections:
server = connection.server(host = '127.0.0.1', port = 57412, user = 'Administrator', pw = '', https=True)

For certificate validation, the SDK uses the OS/systems trusted CA certificate store. The connection uses the "create_default_context()" function as part of urllib as described at the following links:

For Windows OSes, the Kepware server's instance certificate can be loaded into the hosts "Trusted Root Certificate Authorities" store.

Create an object

Objects such as channels or devices can be created either singularly or with children included.

Ex: Add Single channel

from kepconfig.connectivity import channel

channel_data = {"common.ALLTYPES_NAME": "Channel1","servermain.MULTIPLE_TYPES_DEVICE_DRIVER": "Simulator"}
result = channel.add_channel(server,channel_data)

Ex: Add Multiple tags

from kepconfig.connectivity import tag

tag_info = [
    {
            "common.ALLTYPES_NAME": "Temp",
            "servermain.TAG_ADDRESS": "R0"
    },
    {
            "common.ALLTYPES_NAME": "Temp2",
            "servermain.TAG_ADDRESS": "R1"
    }
]
tag_path = '{}.{}.{}'.format(ch_name, dev_name, tag_group_path)
result = tag.add_tag(server, tag_path, tag_info))

Need More Information

Visit:

Release files for kepconfig 1.1.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 kepconfig 1.1.0
File Size Uploaded
kepconfig-1.1.0.tar.gz 23.9 kB Details

Built distribution (wheel)

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

Total release size: 67.1 kB

Release files / kepconfig-1.1.0.tar.gz

Download URL kepconfig-1.1.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
06d4bff7037abbfe273c495d9ac9b0c163b4403f2293a702e8ba5ec79beab443
BLAKE2b-256 checksum
How to use checksums
08c64c12bb11471471e8a0159ebdcfbe077341680461d7d92c1bbb5608f265cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release files / kepconfig-1.1.0-py3-none-any.whl

Download URL kepconfig-1.1.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f94d0c005c1df91ce157b7841d90f80f413f7380092ccf6d886068888daf7185
BLAKE2b-256 checksum
How to use checksums
08da1a91c59030205ae724ab97d00c70c55a8f68fcf4421527e9e782f4d03517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release history Release notifications | RSS feed

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

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