📊 A powerful Python module for seamless interaction with the AVEVA Insight API. Effortlessly retrieve and manipulate data using pandas dataframes!
- Python 3.8+
- Required packages:
requests,pandas,pytz
Initialize the client:
from aveva_insight import Aveva_Insight
aveva = Aveva_Insight(user_token='YOUR_USER_TOKEN', datasource_token='YOUR_DATASOURCE_TOKEN')Retrieve process values with ease:
df = aveva.get_Insight_Data(
tagnames=['Tag1', 'Tag2'],
starttime=datetime(2023, 1, 1),
endtime=datetime(2023, 1, 31),
RetrievalMode="Delta",
Resolution="1h",
InterpolationType="Linear"
)Fetch calculated expression data:
df = aveva.get_Expression_Data(
expression='Tag1*Tag2',
starttime=datetime(2023, 1, 1),
endtime=datetime(2023, 1, 31),
RetrievalMode="Delta",
Resolution="1h"
)Send live data with current timestamp:
df = aveva.upload_Tag_Data(tagname= "Tag1", value = 1)To Upload history values as Pandas Dataframe
df = aveva.upload_Tag_Data(dataframe= pandasDataframe)
Or upload multiple tags using a dataframe:
```python
df = pd.DataFrame({
'DateTime': [datetime.now(), datetime.now()],
'TagName': ['Tag1', 'Tag2'],
'Value': [1, 2]
})
result = aveva.upload_Tag_Data(dataframe=df)Retrieve available tags, with optional filtering:
df = aveva.get_Tag_List(tagnames=['Tag1', 'Tag2'])Fetch asset information:
df = aveva.get_asset_list(assetName="Pump", entityDefinition="YOUR_ENTITY_DEFINITION_ID")List data sources and get tokens:
datasources = aveva.get_datasource_list()
token = aveva.get_datasource_token(datasourceID="YOUR_DATASOURCE_ID")Manage users, groups, and roles:
users = aveva.get_users(email="user@example.com")
groups = aveva.get_groups(name="Engineers")
roles = aveva.get_roles()
aveva.create_user(email="newuser@example.com", connectID="CONNECT_ID")
aveva.create_group(name="New Group", description="Description")
aveva.assign_role_to_group(context="CONTEXT", groupID="GROUP_ID", roleID="ROLE_ID")
aveva.assign_user_to_group(groupID="GROUP_ID", userID="USER_ID")This library uses the AVEVA Insight API. Ensure you have the necessary permissions and valid tokens to access the API.
We welcome contributions! Found a bug or have a feature request? Open an issue or submit a pull request.
This is not an official AVEVA product. Use at your own risk.