antimatter.capsule#

Module Contents#

Classes#

class antimatter.capsule.CapsuleBindings(capsule_session: antimatter_engine.PySessionCapsule, redact_tags: List[antimatter.tags.SpanTag] = [])#
read_extras() List[str]#

Get the extras field stored in the capsule.

Returns:

The extras string.

read_all(redact_tags: List[antimatter.tags.SpanTag] = []) Tuple[List[str], List[List[bytes]], str]#

Get the column definitions, redacted data and extras from the underlying capsule.

Parameters:

redact_tags – The tags to redact from the data. These can be in one of the following forms: - A list of unary tags, like [‘tag.antimatter.io/pii/email’, ‘tag.antimatter.io/pii/name’] - A list of key-value pairs, like [“tag.antimatter.io/pii/date=24/12/2021”, “tag.antimatter.io/pii/credit_card=1234”] - A list of dictionaries, like [{“tag.antimatter.io/pii/email”: “”}, {“tag.antimatter.io/pii/date”: “24/12/2021”}] - A list of dictionaries as a name/value pair, like [{“name”: “tag.antimatter.io/pii/email”, “value”: “”}, {“name”: “tag.antimatter.io/pii/date”, “value”: “24/12/2021”}] - Any combination of the above

Returns:

The column definition list, a 2D list of list of string containing the redacted data, and the extras string.

read_all_with_tags(redact_tags: List[antimatter.tags.SpanTag] = []) Tuple[List[antimatter_engine.PyTag], List[str], List[List[antimatter_engine.PyTag]], List[List[List[bytes]]], List[List[List[antimatter_engine.PySpanTag]]], str]#

Get the tag information (capsule, column, etc.), column definitions, redacted data and extras from the underlying capsule. This method is meant to provide insight into what is being tagged along with the corresponding tag that was applied.

Parameters:

redact_tags – The tags to redact from the data. These can be in one of the following forms: - A list of unary tags, like [‘tag.antimatter.io/pii/email’, ‘tag.antimatter.io/pii/name’] - A list of key-value pairs, like [“tag.antimatter.io/pii/date=24/12/2021”, “tag.antimatter.io/pii/credit_card=1234”] - A list of dictionaries, like [{“tag.antimatter.io/pii/email”: “”}, {“tag.antimatter.io/pii/date”: “24/12/2021”}] - A list of dictionaries as a name/value pair, like [{“name”: “tag.antimatter.io/pii/email”, “value”: “”}, {“name”: “tag.antimatter.io/pii/date”, “value”: “24/12/2021”}] - Any combination of the above

Returns:

The list of capsule tags, column definition list, list of column tags, a 2D list of list of string containing the redacted data, a list of data span tags, and the extras string.

capsule_ids() List[str]#

Get a list capsule IDs associated with this CapsuleBinding.

domain_id() str#

Get the domain ID associated with the capsule.

class antimatter.capsule.AnnotatedData(capsule_tags: List[antimatter.tags.CapsuleTag], column: Any, column_tags: List[antimatter.tags.ColumnTag], data: str, bytes: AnnotatedData.__init__.bytes, span_tags: List[antimatter.tags.SpanTag], row: int, bytes_with_tags: AnnotatedData.__init__.bytes = None)#
class antimatter.capsule.CapsuleMeta#
datatype_in: antimatter.datatype.datatypes.Datatype#
extra: Dict[str, Any]#
class antimatter.capsule.Capsule(capsule_binding: CapsuleBindings)#
property capsule: CapsuleBindings#

Get the capsule binding for the underlying Antimatter Capsule.

Returns:

The Antimatter Capsule binding.

data(redact_tags: List[str] = [], **kwargs) Any#

Get the data from the underlying Antimatter Capsule using the supplied read parameters. This will raise an error if the capsule is sealed.

Parameters:
  • redact_tags – The tags to redact from the data. These can be in one of the following forms: - A list of unary tags, like [‘tag.antimatter.io/pii/email’, ‘tag.antimatter.io/pii/name’] - A list of key-value pairs, like [“tag.antimatter.io/pii/date=24/12/2021”, “tag.antimatter.io/pii/credit_card=1234”] - A list of dictionaries, like [{“tag.antimatter.io/pii/email”: “”}, {“tag.antimatter.io/pii/date”: “24/12/2021”}] - A list of dictionaries as a name/value pair, like [{“name”: “tag.antimatter.io/pii/email”, “value”: “”}, {“name”: “tag.antimatter.io/pii/date”, “value”: “24/12/2021”}] - Any combination of the above

  • kwargs – The extra arguments to pass to the data handler.

Returns:

The data in its default format.

data_as(dt: antimatter.datatype.datatypes.Datatype | str, **kwargs) Any#

Get the data from the underlying Antimatter Capsule using the supplied read parameters. This will raise an error if the capsule is sealed.

Parameters:
  • dt – The datatype to use for reading data.

  • kwargs – The extra arguments to pass to the data handler.

Returns:

The data in the specified format.

data_with_tags(column_major: bool = False, redact_tags: List[str] = [], **kwargs) List[List[AnnotatedData]]#

Get the data and related tag information from the underlying Antimatter Capsule using the supplied read parameters. This will raise an error if the capsule is sealed.

Parameters:
  • column_major – The orientation to use for the return list. A value of True results in data being grouped together by column versus a value of False which results in data being grouped together by row.

  • redact_tags – The tags to redact from the data. These can be in one of the following forms: - A list of unary tags, like [‘tag.antimatter.io/pii/email’, ‘tag.antimatter.io/pii/name’] - A list of key-value pairs, like [“tag.antimatter.io/pii/date=24/12/2021”, “tag.antimatter.io/pii/credit_card=1234”] - A list of dictionaries, like [{“tag.antimatter.io/pii/email”: “”}, {“tag.antimatter.io/pii/date”: “24/12/2021”}] - A list of dictionaries as a name/value pair, like [{“name”: “tag.antimatter.io/pii/email”, “value”: “”}, {“name”: “tag.antimatter.io/pii/date”, “value”: “24/12/2021”}] - Any combination of the above

  • kwargs – The extra arguments to pass to the data handler.

Returns:

The list of objects providing insight to the Tags that were found within a data item.

capsule_ids() List[str]#

Get a list capsule IDs associated with this capsule bundle.

domain_id() str#

Get the domain ID associated with this capsule.