Skip to main content

A professional library for PI AF SDK integration

Project description

piafsdkconnect

A professional Python library for PI AF SDK integration (.NET based).

Installation

pip install piafsdkconnect

Usage

Using .env file

Create a .env file in your project root with the following variables:

PI_SERVER_NAME=YourPIServerName
PI_SDK_PATH=C:\Program Files (x86)\PIPC\AF\PublicAssemblies\4.0  # Optional, defaults to this path
PI_USERNAME=YourUsername  # Optional, for PI User/Windows Auth
PI_PASSWORD=YourPassword  # Optional
from piafsdkconnect import get_service
service = get_service()

Functions Provided

  • get_current_value(tag_name: str): Fetch the current value for a given PI tag.
  • get_recorded_values(tag_name: str, start_time: str, end_time: str): Fetch historical (recorded) values for a time range.
  • write_value(tag_name: str, value: Any, timestamp: Any = None): Write or replace a value for a PI tag.
  • search_tags(query: str): Search for PI tags based on a query pattern.
  • get_asset_servers(): List available PI AF System (Asset Server) names.
  • get_organizations(asset_server: str): List AF Databases (Organizations) on a specific Asset Server.
  • test_connection(): Verify the connection status to the PI Server.
  • disconnect(): Explicitly close the connection.

Passing credentials directly

from piafsdkconnect import get_service

service = get_service(
    server_name="192.168.1.115",
    username="Administrator",
    password="YourPassword",
    sdk_path=r"C:\Program Files (x86)\PIPC\AF\PublicAssemblies\4.0"  # Optional
)

def main():
    val = service.get_current_value("YourTagName")
    print(val)

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piafsdkconnect-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piafsdkconnect-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file piafsdkconnect-0.1.0.tar.gz.

File metadata

  • Download URL: piafsdkconnect-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for piafsdkconnect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ba82c69c0708e1e7f2a55246c9cd83ece6eedd185a5fdfc6e4ddfd84d0ce8de
MD5 bcd08868e632ebcbd5a97e6b6d2e3bd1
BLAKE2b-256 2b94499f34f6ad103cfbb43ace2afd4b658bb8907d6a02b413610890034f5743

See more details on using hashes here.

File details

Details for the file piafsdkconnect-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: piafsdkconnect-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for piafsdkconnect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9478754a7b8dc459cb0b3da24dfa24d5c715cb69f3e6a402b5b19df1e0ca6c1
MD5 a45f8fe153d2bb648acd81fedaee6017
BLAKE2b-256 32357f10d257f2357da838fd50b3e912041e99830e2b8b8b902716a73cfbd0bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page