pyhaystack.client.entity package¶
Subpackages¶
Submodules¶
pyhaystack.client.entity.entity module¶
High-level Entity interface.
-
class
pyhaystack.client.entity.entity.DeletableEntity(session, entity_id)¶ Bases:
pyhaystack.client.entity.entity.EntityClass to represent entities that can be deleted from the Haystack server (the server implements the ‘delete’ operation).
Initialise a new high-level entity object.
Parameters: - session – The connection session object.
- entity_id – The entity’s fully qualified ID.
-
delete(callback=None)¶ Delete the entity.
-
class
pyhaystack.client.entity.entity.Entity(session, entity_id)¶ Bases:
objectA base class for Project Haystack entities. This is a base class that is then combined with mix-ins depending on the tags present for the entity and the tagging model in use (by default, we use the “Project Haystack” tagging model, but others such as ISA-95 may exist).
This base class just exposes the tags, and if supported by the server, may expose the ability to update those tags.
Initialise a new high-level entity object.
Parameters: - session – The connection session object.
- entity_id – The entity’s fully qualified ID.
-
dis¶ Return the description field of the entity.
-
id¶ Return the fully qualified ID of this entity.
Return the tags of this entity.
-
exception
pyhaystack.client.entity.entity.StaleEntityInstanceError¶ Bases:
exceptions.ExceptionException thrown when an entity instance is “stale”, that is, the entity class type no longer matches the tag set present in the entity.
pyhaystack.client.entity.model module¶
Tagging Model Interface.
-
class
pyhaystack.client.entity.model.TaggingModel(session)¶ Bases:
objectA base class for representing tagging models. The tagging model is responsible for considering the tags present on a new entity then instantiating an appropriate data type based on those tags seen.
Initialise a new tagging model.
-
create_entity(entity_id, tags)¶ Create an Entity instance based on the tags present.
-
pyhaystack.client.entity.tags module¶
Entity tag interface. This file implements the interfaces that will be used to access and store tags of an entity.
Bases:
objectA base class for storing entity tags.
Initialise a new high-level entity tag storage object.
Parameters: - session – The connection session object.
- entity_id – The entity’s fully qualified ID.
Bases:
pyhaystack.client.entity.tags.BaseEntityTagsA base class for entity tags that supports modifications to the tag set.
Commit any to-be-sent updates for this entity.
Returns true if there are modifications pending submission.
Revert the named attribute changes, or all changes.
Bases:
pyhaystack.client.entity.tags.BaseMutableEntityTags,_abcoll.MutableMapping
Bases:
pyhaystack.client.entity.tags.BaseEntityTags,_abcoll.MappingInitialise a new high-level entity tag storage object.
Parameters: - session – The connection session object.
- entity_id – The entity’s fully qualified ID.