colander_data_converter.base.types.data_fragment

class colander_data_converter.base.types.data_fragment.DataFragmentType[source]

Bases: CommonEntityType

DataFragmentType represents metadata for data fragments in Colander. Check the list of supported types.

Example

>>> data_fragment_type = DataFragmentTypes.CODE.value
>>> print(data_fragment_type.name)
Snippet of code
Fields:

Validators:
validator is_supported_type  »  short_name[source]
class colander_data_converter.base.types.data_fragment.DataFragmentTypes(*values)[source]

Bases: Enum

DataFragmentTypes provides access to all supported data fragment types.

This class loads data fragment type definitions from the data fragment types JSON file and exposes them as an enum. It also provides a method to look up a data fragment type by its short name.

Example

>>> data_fragment_type = DataFragmentTypes.CODE.value
>>> print(data_fragment_type.name)
Snippet of code
>>> default_type = DataFragmentTypes.by_short_name("nonexistent")
>>> print(default_type.name)
Generic
classmethod by_short_name(short_name)[source]
CODE = CODE

Snippet of code - A snippet or segment of source code from any programming language.

GENERIC = GENERIC

Generic - A general or unspecified data fragment type that does not fit other categories.

PATTERN = PATTERN

Matching pattern - A recognizable sequence or structure, such as a regular expression or YARA rule.

PAYLOAD = PAYLOAD

Encoded payload - A block of encoded data.

TEXT = TEXT

Piece of text - A fragment of unstructured or plain text.

default = GENERIC