pyhaystack.client.mixins.vendor.widesky package

Submodules

pyhaystack.client.mixins.vendor.widesky.crud module

VRT Widesky low-level CRUD operation mix-in. This is a mix-in for HaystackSession that implements CRUD operations as used in VRT Widesky’s implementation of Project Haystack.

At present, this has not been adopted by other implementations.

class pyhaystack.client.mixins.vendor.widesky.crud.CRUDOpsMixin

Bases: object

The CRUD operations mix-in implements low-level support for entity create / update / delete operation extensions to Project Haystack. (Read is not included, since that’s part of the core standard.)

create(entities, callback=None)

Create the entities listed. If given a dict, we are creating a single entity, otherwise multiple entities may be given as individual dicts.

Each dict must carry an id which is a string giving the unique fully qualified ID of the entity. All other keys are taken to be tag values to attach to that entity, the values of which must be valid hszinc types.

Parameters:entities – The entities to be inserted.
create_entity(entities, single=None, callback=None)

Create the entities listed, and return high-level entity instances for them. This is a high-level convenience around the above create method.

delete(ids=None, filter_expr=None, callback=None)

Delete entities matching the given criteria. Either ids or filter_expr may be given. ids may be given as a list or as a single ID string/reference.

filter_expr is given as a string. pyhaystack.util.filterbuilder may be useful for generating these programatically.

Parameters:
  • ids – IDs of many entities to retrieve as a list
  • filter_expr – A filter expression that describes the entities of interest.
update(entities, callback=None)

Update the entities listed. If given a dict, we are creating a single entity, otherwise multiple entities may be given as individual dicts.

Each dict must carry an id which is a string giving the unique fully qualified ID of the entity. All other keys are taken to be tag values to update on that entity, the values of which must be valid hszinc types.

Parameters:entities – The entities to be updated.

pyhaystack.client.mixins.vendor.widesky.multihis module

VRT Widesky low-level multi-hisRead/hisWrite operation mix-in. This is a mix-in for HaystackSession that implements CRUD operations as used in VRT Widesky’s implementation of Project Haystack.

At present, this has not been adopted by other implementations.

class pyhaystack.client.mixins.vendor.widesky.multihis.MultiHisOpsMixin

Bases: object

The Multi-His operations mix-in implements low-level support for multi-point hisRead and hisWrite operations.

multi_his_read(points, rng, callback=None)

Read the historical data for multiple points. This processes each point given by the list points and returns the data from that point in a numbered column named idN where N starts counting from zero.

multi_his_write(timestamp_records, callback=None)

Write the historical data for multiple points.

timestamp_records may be given as: - a Pandas DataFrame object, with column names specifying IDs of points - a list of dicts with the key ‘ts’ mapping to a datetime object and

the remaining keys mapping point IDs to the values to be written.
  • a dict of dicts, with the outer dict mapping timestamps to the inner dict mapping point IDs to values.

Module contents