estceque.core – Core objects definition

estceque.core.Element = Element

Document element.

This is a recursive type defining a document element that can represent a JSON value with extra types supported by Elasticsearch, including:

  • Dictionaries associating string keys with document elements;

  • Lists of document elements;

  • Strings;

  • Numbers (integers, floating-point, booleans);

  • None.

class estceque.core.FieldPath(path: FieldPath | str | Iterable[str], /)

Object representing the path to a field in a JSON document.

This object can be used in a similar fashion to pathlib.Path. For example, in order to create a field path out of several components, the following can be used:

>>> FieldPath("hello.world")
FieldPath('hello.world')
>>> FieldPath("hello") / "world"
FieldPath('hello.world')
>>> FieldPath(["hello", "world"])
FieldPath('hello.world')

Field paths can also be used in Pydantic models:

>>> from pydantic import BaseModel
>>> class MyModel(BaseModel):
...     field: FieldPath
...
>>> MyModel(field="hello.world")
MyModel(field=FieldPath('hello.world'))
property parent: FieldPathType | EmptyFieldPath

Get the field path parent.

Returns:

Parent.

property parts: tuple[~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[^\.]+$)], ...]

Get the parts of the current path.

Returns:

Parts.

class estceque.core.EmptyFieldPath

Object representing an empty field path.

property parent: EmptyFieldPathType

Get the field path parent.

Returns:

Parent.

property parts: tuple[~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[^\.]+$)], ...]

Get the parts of the current path.

Returns:

Parts.

pydantic model estceque.core.PainlessCondition

Condition written in Painless.

See Painless scripting language for more information.

field script: Annotated[str, StringConstraints(min_length=1)] [Required]

Painless script to run.

Constraints:
  • min_length = 1

pydantic model estceque.core.Processor

Elasticsearch ingest pipeline processor.

This class is used for parsing and rendering Elasticsearch ingest pipelines, in order to ensure that we check all options, forbid additional options, and so on.

field description: str | None = None
field if_: Annotated[str | None, Field(alias='if')] = None (alias 'if')
field ignore_failure: bool = False
field on_failure: list[_ProcessorWrapper] | None = None
field tag: str | None = None
class estceque.core.IngestPipelineParser(*, processors: dict[str, type[Processor]], name: str | None = None)

Elasticsearch ingest pipeline converter.

Parameters:
  • name – Optional name with which the parser wants to be represented.

  • processors – Processors supported by the pipeline.

copy(*, with_processors: dict[str, type[Processor]] | None = None, without_processors: Iterable[str] | None = None) IngestPipelineParser

Copy the parser.

Parameters:
  • with_processors – Processors to add in the new parser. If the key exists in the current parser, the processor will be replaced automatically in the new parser.

  • without_processors – Processors to remove from the current parser.

Returns:

New parser with the modified processors.

validate_processors(raw: Any, /) list[dict]

Validate the provided pipeline’s processors.

Parameters:

raw – Pipeline or processor list dictionary, or JSON-encoded version of the same.

Returns:

Validated object, as Python.

validate_failure_processors(raw: Any, /) list[dict]

Validate the provided pipeline’s failure processors.

Parameters:

raw – Pipeline or processor list dictionary, or JSON-encoded version of the same.

Returns:

Validated object, as Python.