Meilisearch pipeline

Build a Meilisearch-ready JSON document containing all DPM operation versions with their scopes, module assignments, operand references, and version history. The end-to-end pipeline (MeiliBuildService) runs Access → CSV → in-memory SQLite → JSON, delegating JSON generation to MeiliJsonService.

Note

Requires the migration extra: pip install dpmcore[migration].

dpmcore.services.meili_build

class dpmcore.services.meili_build.MeiliBuildService[source]

Bases: object

Build Meilisearch JSON from CSV tables or an Access source file.

build(*, output_file, source_dir=None, access_file=None, ecb_validations_file=None)[source]

Build the Meilisearch JSON and write it to output_file.

Return type:

MeiliBuildResult

Parameters:
  • output_file (str)

  • source_dir (str | None)

  • access_file (str | None)

  • ecb_validations_file (str | None)

class dpmcore.services.meili_build.MeiliBuildResult(operations_written, output_file, source_dir, used_access_file, ecb_validations_imported)[source]

Outcome of a full Meilisearch JSON build.

Parameters:
  • operations_written (int)

  • output_file (Path)

  • source_dir (Path)

  • used_access_file (bool)

  • ecb_validations_imported (bool)

operations_written: int
output_file: Path
source_dir: Path
used_access_file: bool
ecb_validations_imported: bool
exception dpmcore.services.meili_build.MeiliBuildError[source]

Bases: Exception

Raised when the end-to-end Meilisearch JSON build fails.

dpmcore.services.meili_json

class dpmcore.services.meili_json.MeiliJsonService(session=None)[source]

Bases: object

Generate the operations JSON consumed by Meilisearch.

Parameters:

session (Optional[Session])

__init__(session=None)[source]

Initialise the service with an optional SQLAlchemy session.

Parameters:

session (Session | None)

Return type:

None

generate(output_file)[source]

Generate the operations JSON and write it to output_file.

Return type:

MeiliJsonResult

Parameters:

output_file (str)

merge_by_owner(*, new_file, existing_file, output_file)[source]

Merge new_file into existing_file, replacing by owner.

Return type:

MeiliJsonResult

Parameters:
  • new_file (str)

  • existing_file (str)

  • output_file (str)

class dpmcore.services.meili_json.MeiliJsonResult(operations_written, output_file)[source]

Outcome of a Meilisearch JSON generation run.

Parameters:
  • operations_written (int)

  • output_file (Path)

operations_written: int
output_file: Path
exception dpmcore.services.meili_json.MeiliJsonError[source]

Bases: Exception

Raised when JSON generation for Meilisearch cannot proceed.