tincan.documents package

Submodules

tincan.documents.activity_profile_document module

class tincan.documents.activity_profile_document.ActivityProfileDocument(*args, **kwargs)

Bases: tincan.documents.document.Document

Extends tincan.Document with an Activity field, can be created from a dict, another tincan.Document, or from kwargs.

Parameters:
  • id (unicode) – The id of this document
  • content_type (unicode) – The content_type of the content of this document
  • content (bytearray) – The content of this document
  • etag (unicode) – The etag of this document
  • timestamp (datetime.datetime) – The timestamp of this document
  • activity (tincan.Activity) – The activity object of this document
__init__(*args, **kwargs)
activity

The Document’s activity object

Setter:Tries to convert to tincan.Activity
Setter type:tincan.Activity
Return type:tincan.Activity

tincan.documents.agent_profile_document module

class tincan.documents.agent_profile_document.AgentProfileDocument(*args, **kwargs)

Bases: tincan.documents.document.Document

Extends tincan.Document with an Agent field, can be created from a dict, another tincan.Document, or from kwargs.

Parameters:
  • id (unicode) – The id of this document
  • content_type (unicode) – The content_type of the content of this document
  • content (bytearray) – The content of this document
  • etag (unicode) – The etag of this document
  • timestamp (datetime.datetime) – The timestamp of this document
  • agent (tincan.Agent) – The agent object of this document
__init__(*args, **kwargs)
agent

The Document’s agent object

Setter:Tries to convert to tincan.Agent
Setter type:tincan.Agent
Return type:tincan.Agent

tincan.documents.document module

class tincan.documents.document.Document(*args, **kwargs)

Bases: tincan.base.Base

Document class can be instantiated from a dict, another tincan.Document, or from kwargs

Parameters:
  • id (unicode) – The id of this document
  • content_type (unicode) – The content type of the content of this document
  • content (bytearray) – The content of this document
  • etag (unicode) – The etag of this document
  • timestamp (datetime.datetime) – The timestamp of this document
__init__(*args, **kwargs)
content

The Document content

Setter:Tries to convert to bytearray.
Setter type:str | unicode | bytearray
Return type:bytearray
content_type

The Document content type

Setter:Tries to convert to unicode
Setter type:str | unicode
Return type:unicode
etag

The Document etag

Setter:Tries to convert to unicode
Setter type:str | unicode
Return type:unicode
id

The Document id

Setter:Tries to convert to unicode
Setter type:str | unicode
Return type:unicode
timestamp

The Document timestamp.

Setter:Tries to convert to datetime.datetime. If

no timezone is given, makes a naive datetime.datetime.

Strings will be parsed as ISO 8601 timestamps.

If a number is provided, it will be interpreted as a UNIX timestamp, which by definition is UTC.

If a dict is provided, does datetime.datetime(**value).

If a tuple or a list is provided, does datetime.datetime(*value). Uses the timezone in the tuple or list if provided.

Setter type:datetime.datetime | unicode | str | int | float | dict | tuple | None
Return type:datetime.datetime

tincan.documents.state_document module

class tincan.documents.state_document.StateDocument(*args, **kwargs)

Bases: tincan.documents.document.Document

Extends tincan.Document with Agent, Activity, and Registration fields; can be created from a dict, another tincan.Document, or from kwargs.

Parameters:
  • id (unicode) – The id of this document
  • content_type (unicode) – The content_type of the content of this document
  • content (bytearray) – The content of this document
  • etag (unicode) – The etag of this document
  • timestamp (datetime.datetime) – The time stamp of this document
  • agent (tincan.Agent) – The agent object of this document
  • activity (Activity) – The activity object of this document
  • registration (unicode) – The registration id of the state for this document
__init__(*args, **kwargs)
activity

The Document’s activity object

Setter:Tries to convert to activity
Setter type:tincan.Activity
Return type:tincan.Activity
agent

The Document’s agent object

Setter:Tries to convert to tincan.Agent
Setter type:tincan.Agent
Return type:tincan.Agent
registration

The Document registration id

Setter:Tries to convert to unicode
Setter type:str | unicode | uuid.UUID
Return type:unicode

Module contents