Dicts module

Module for managing dict in sdcv

Route

app.features.dicts.route.list_dicts(body)

Get the list of all available dictionaries — tags:

  • features/dicts

requestBody:

required: true content:

application/json:
schema:

type: object required:

  • sdcv_type

properties:
sdcv_type:

type: string description: Where to run sdcv from example: “docker”

container_name:

type: string description: Container name, if sdcv is in docker example: “sdcv-test”

responses:
200:

description: Successful retrieval of the dictionary list content:

application/json:
schema:

type: object required: [data, error] properties:

data:

type: array description: List of dictionary names available in sdcv items:

type: string

example: [“Mueller7GPL”, “Full English-Russian”, “LingvoUniversal”]

error:

type: string nullable: true example: null

409:

description: Internal server error when communicating with the sdcv container content:

application/json:
schema:

type: object required: [data, error] properties:

data:

type: object nullable: true example: null

error:

type: string example: “Failed to fetch dictionaries from container”

Parameters:

body (DictRequest)

Service

class app.features.dicts.service.DictsService

Bases: object

Service for managing available dictionaries.

get_all(engine)

Retrieves all available dictionaries.

Parameters:

engine (BaseSdcvEngine) – The engine implementation based on the sdcv deployment location.

Returns:

A data transfer object containing the list of dictionaries.

Return type:

BaseDTO

Repository

Requests

class app.features.dicts.requests.DictRequest

Bases: BaseModel

Represents a request to retrieve the list of available dictionaries.

Fields

Field

Type

Required

Default

Constraints

container_name

str

Yes

min_length=0

sdcv_type

str

Yes

min_length=0

container_name: str

The name of the sdcv container, if deployed inside Docker.

Constraints:
  • min_length = 0

sdcv_type: str

The deployment type of the sdcv application.

Constraints:
  • min_length = 0

Responses

app.features.dicts.responses.DictsResponse

Represents a response containing the list of available dictionaries.

Fields

Field

Type

Required

Default

data

List[str] | None

No

None

error

str | None

No

None

Consts

class app.features.dicts.consts.ResultCodes

Operation execution result codes.

DICTS_NOT_FOUND = 'Dicts not found'

No matching dictionaries were found in the system.

UNEXPECTED_ERROR = 'Unexpected error'

An unhandled or unexpected error occurred during execution.