ts_ids_core.mapping_table.schema_path_models module

class Index(value: typing_extensions.Literal[*] | int)[source]

Bases: object

Class for representing an index in a schema path. Asterisks are treated as less than any integer.

static from_str(ind: str) Index[source]
value: typing_extensions.Literal[*] | int
class PathPart(name: str, indices: ~typing.List[~ts_ids_core.mapping_table.schema_path_models.Index] = <factory>)[source]

Bases: object

Class to represent a part of a schema path, e.g., the path “a.b[2].c” has parts “a”, “b[2]”, and “c”. A path part has a field name and an optional list of indices

Raises:

ValueError – _description_

Returns:

_description_

static from_str(path_part: str) PathPart[source]

Parse a path part string to a PathPart object.

indices: List[Index]
name: str
class SchemaPath(parts: List[PathPart])[source]

Bases: object

Class for representing a schema path.

property deindexed_path: str

Return a schema path with all indices removed. E.g., if the path is “a[*].b[1].c” this would return “a.b.c”

static from_str(path: str) SchemaPath[source]

Parse a schema path string to a SchemaPath object.

parts: List[PathPart]