cdek.apps.form package

class cdek.apps.form.BarcodeApp(client: CdekClient)[исходный код]

Базовые классы: App

Класс для работы с ШК-местами к заказу

get(uuid: str) PrintBarcodeResponse[исходный код]

Получение сущности ШК к заказу

Args:

uuid (str): идентификатор ШК-места к заказу

Returns:

PrintBarcodeResponse: объект с информацией о ШК-месте к заказу

get_pdf(uuid: str) bytes[исходный код]

Скачивание готового ШК

Args:

uuid (str): идентификатор ШК-места к заказу

Returns:

bytes: содержимое PDF файла

set(barcode: PrintBarcodeRequest) EntityResponse[исходный код]

Запрос на формирование ШК-места к заказу

Args:
barcode (PrintBarcodeRequest): объект с информацией о запросе

на формирование ШК-места к заказу

Returns:

EntityResponse: объект с информацией о формировании ШК-места к заказу

Raises:

ValueError: если barcode не является объектом PrintBarcodeRequest

class cdek.apps.form.InvoiceApp(client: CdekClient)[исходный код]

Базовые классы: App

Класс для работы с накладными к заказу

get(uuid: str) WaybillEntityResponse[исходный код]

Получение сущности накладной к заказу

Args:

uuid (str): идентификатор накладной к заказу

Returns:

WaybillEntityResponse: объект с информацией о накладной к заказу

get_pdf(uuid: str) bytes[исходный код]

Получение PDF накладной к заказу

Args:

uuid (str): идентификатор накладной к заказу

Returns:

bytes: содержимое PDF файла

set(invoice: PrintInvoiceRequest) EntityResponse[исходный код]

Запрос на формирование накладной к заказу

Args:
invoice (PrintInvoiceRequest): объект с информацией о запросе

на формирование накладной к заказу

Returns:

EntityResponse: объект с информацией о формировании накладной к заказу

Raises:

ValueError: если invoice не является объектом PrintInvoiceRequest

class cdek.apps.form.PrintBarcodeEntity(*, orders: list[PrintOrder], copy_count: int | None = None, format: Literal['A4', 'A5', 'A6', 'A7'] = 'A4', lang: Literal['RUS', 'ENG', 'DEU', 'ITA', 'TUR', 'CES', 'KOR', 'LIT', 'LAV'] = 'RUS', uuid: UUID, url: str | None = None, statuses: list[PrintStatus])[исходный код]

Базовые классы: PrintBarcodeRequest

lang: Literal['RUS', 'ENG', 'DEU', 'ITA', 'TUR', 'CES', 'KOR', 'LIT', 'LAV']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

statuses: list[PrintStatus]
url: str | None
uuid: UUID
class cdek.apps.form.PrintBarcodeRequest(*, orders: list[PrintOrder], copy_count: int | None = None, format: Literal['A4', 'A5', 'A6', 'A7'] = 'A4', lang: Literal['RUS', 'ENG'] = 'RUS')[исходный код]

Базовые классы: PrintForm

format: Literal['A4', 'A5', 'A6', 'A7']
lang: Literal['RUS', 'ENG']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cdek.apps.form.PrintBarcodeResponse(*, entity: PrintBarcodeEntity | None = None, requests: list[Request] | None = None, related_entities: list[RelatedEntity] | None = None)[исходный код]

Базовые классы: EntityResponse

entity: PrintBarcodeEntity | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cdek.apps.form.PrintInvoiceRequest(*, orders: list[PrintOrder], copy_count: int | None = None, type: PrintType | None = None)[исходный код]

Базовые классы: PrintForm

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: PrintType | None
class cdek.apps.form.PrintStatus(*, code: str, name: str, date_time: datetime)[исходный код]

Базовые классы: BaseModel

code: str
date_time: datetime
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
serialize_date_time(date_time: datetime) str[исходный код]

Вернуть дату статуса печатной формы в формате ISO 8601

class cdek.apps.form.WaybillEntityResponse(*, entity: WaybillResponse | None = None, requests: list[Request] | None = None, related_entities: list[RelatedEntity] | None = None)[исходный код]

Базовые классы: EntityResponse

entity: WaybillResponse | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cdek.apps.form.WaybillResponse(*, orders: list[PrintOrder], copy_count: int | None = None, uuid: UUID, type: PrintType | None = None, url: str | None = None, statuses: list[PrintStatus])[исходный код]

Базовые классы: PrintForm

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

statuses: list[PrintStatus]
type: PrintType | None
url: str | None
uuid: UUID

Submodules

cdek.apps.form.barcode module

class cdek.apps.form.barcode.BarcodeApp(client: CdekClient)[исходный код]

Базовые классы: App

Класс для работы с ШК-местами к заказу

get(uuid: str) PrintBarcodeResponse[исходный код]

Получение сущности ШК к заказу

Args:

uuid (str): идентификатор ШК-места к заказу

Returns:

PrintBarcodeResponse: объект с информацией о ШК-месте к заказу

get_pdf(uuid: str) bytes[исходный код]

Скачивание готового ШК

Args:

uuid (str): идентификатор ШК-места к заказу

Returns:

bytes: содержимое PDF файла

set(barcode: PrintBarcodeRequest) EntityResponse[исходный код]

Запрос на формирование ШК-места к заказу

Args:
barcode (PrintBarcodeRequest): объект с информацией о запросе

на формирование ШК-места к заказу

Returns:

EntityResponse: объект с информацией о формировании ШК-места к заказу

Raises:

ValueError: если barcode не является объектом PrintBarcodeRequest

cdek.apps.form.invoice module

class cdek.apps.form.invoice.InvoiceApp(client: CdekClient)[исходный код]

Базовые классы: App

Класс для работы с накладными к заказу

get(uuid: str) WaybillEntityResponse[исходный код]

Получение сущности накладной к заказу

Args:

uuid (str): идентификатор накладной к заказу

Returns:

WaybillEntityResponse: объект с информацией о накладной к заказу

get_pdf(uuid: str) bytes[исходный код]

Получение PDF накладной к заказу

Args:

uuid (str): идентификатор накладной к заказу

Returns:

bytes: содержимое PDF файла

set(invoice: PrintInvoiceRequest) EntityResponse[исходный код]

Запрос на формирование накладной к заказу

Args:
invoice (PrintInvoiceRequest): объект с информацией о запросе

на формирование накладной к заказу

Returns:

EntityResponse: объект с информацией о формировании накладной к заказу

Raises:

ValueError: если invoice не является объектом PrintInvoiceRequest

cdek.apps.form.requests module

class cdek.apps.form.requests.PrintBarcodeRequest(*, orders: list[PrintOrder], copy_count: int | None = None, format: Literal['A4', 'A5', 'A6', 'A7'] = 'A4', lang: Literal['RUS', 'ENG'] = 'RUS')[исходный код]

Базовые классы: PrintForm

copy_count: int | None
format: Literal['A4', 'A5', 'A6', 'A7']
lang: Literal['RUS', 'ENG']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

orders: list[PrintOrder]
class cdek.apps.form.requests.PrintInvoiceRequest(*, orders: list[PrintOrder], copy_count: int | None = None, type: PrintType | None = None)[исходный код]

Базовые классы: PrintForm

copy_count: int | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

orders: list[PrintOrder]
type: PrintType | None

cdek.apps.form.responses module

class cdek.apps.form.responses.PrintBarcodeEntity(*, orders: list[PrintOrder], copy_count: int | None = None, format: Literal['A4', 'A5', 'A6', 'A7'] = 'A4', lang: Literal['RUS', 'ENG', 'DEU', 'ITA', 'TUR', 'CES', 'KOR', 'LIT', 'LAV'] = 'RUS', uuid: UUID, url: str | None = None, statuses: list[PrintStatus])[исходный код]

Базовые классы: PrintBarcodeRequest

copy_count: int | None
format: Literal['A4', 'A5', 'A6', 'A7']
lang: Literal['RUS', 'ENG', 'DEU', 'ITA', 'TUR', 'CES', 'KOR', 'LIT', 'LAV']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

orders: list[PrintOrder]
statuses: list[PrintStatus]
url: str | None
uuid: UUID
class cdek.apps.form.responses.PrintBarcodeResponse(*, entity: PrintBarcodeEntity | None = None, requests: list[Request] | None = None, related_entities: list[RelatedEntity] | None = None)[исходный код]

Базовые классы: EntityResponse

entity: PrintBarcodeEntity | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

related_entities: list[RelatedEntity] | None
requests: list[Request] | None
class cdek.apps.form.responses.PrintStatus(*, code: str, name: str, date_time: datetime)[исходный код]

Базовые классы: BaseModel

code: str
date_time: datetime
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
serialize_date_time(date_time: datetime) str[исходный код]

Вернуть дату статуса печатной формы в формате ISO 8601

class cdek.apps.form.responses.WaybillEntityResponse(*, entity: WaybillResponse | None = None, requests: list[Request] | None = None, related_entities: list[RelatedEntity] | None = None)[исходный код]

Базовые классы: EntityResponse

entity: WaybillResponse | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

related_entities: list[RelatedEntity] | None
requests: list[Request] | None
class cdek.apps.form.responses.WaybillResponse(*, orders: list[PrintOrder], copy_count: int | None = None, uuid: UUID, type: PrintType | None = None, url: str | None = None, statuses: list[PrintStatus])[исходный код]

Базовые классы: PrintForm

copy_count: int | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

orders: list[PrintOrder]
statuses: list[PrintStatus]
type: PrintType | None
url: str | None
uuid: UUID