cdek.apps.location package¶
- class cdek.apps.location.CitiesResponse(*, longitude: float | None = None, latitude: float | None = None, region: Annotated[str | None, MaxLen(max_length=255)] = None, region_code: int | None = None, kladr_region_code: str | None = None, sub_region: str | None = None, country_code: Annotated[str | None, MaxLen(max_length=2)] = None, country: Annotated[str | None, MaxLen(max_length=255)] = None, code: int, city_uuid: UUID, city: str, fias_guid: UUID | None = None, time_zone: str | None = None, payment_limit: float | None)[исходный код]¶
Базовые классы:
City,Country,Region,Coordinates- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- payment_limit: float | None¶
- region: str | None¶
- time_zone: str | None¶
- class cdek.apps.location.CityFilter(*, name: str, country_code: str | None = None)[исходный код]¶
Базовые классы:
BaseModelФильтр для городов
- country_code: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- class cdek.apps.location.CityListFilter(*, country_codes: str | None = None, region_code: int | None = None, kladr_region_code: str | None = None, kladr_code: str | None = None, fias_guid: UUID | None = None, postal_code: str | None = None, code: int | None = None, city: str | None = None, payment_limit: float | None = None, size: int | None = 1000, page: int | None = 0, lang: str | None = None)[исходный код]¶
Базовые классы:
BaseModelФильтр для списка городов
- city: str | None¶
- code: int | None¶
- country_codes: str | None¶
- fias_guid: UUID | None¶
- kladr_code: str | None¶
- kladr_region_code: str | None¶
- lang: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int | None¶
- payment_limit: float | None¶
- postal_code: str | None¶
- region_code: int | None¶
- size: int | None¶
- class cdek.apps.location.CityResponse(*, code: int, city_uuid: UUID, full_name: Annotated[str, MaxLen(max_length=255)], country_code: Annotated[str, MaxLen(max_length=255)])[исходный код]¶
Базовые классы:
BaseModel- city_uuid: UUID¶
- code: int¶
- country_code: str¶
- full_name: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.CoordinatesFilter(*, latitude: float, longitude: float)[исходный код]¶
Базовые классы:
BaseModelФильтр для координат
- latitude: float¶
- longitude: float¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.CoordinatesResponse(*, code: int, city_uuid: UUID, city: str, fias_guid: UUID | None = None)[исходный код]¶
Базовые классы:
City- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.LocationApp(client: CdekClient)[исходный код]¶
Базовые классы:
AppПолучение списка локаций
- cities(filter_params: CityListFilter | None = None) list[CitiesResponse][исходный код]¶
Получение списка населенных пунктов Метод предназначен для получения детальной информации о населенных пунктах
- Args:
filter_params (CityListFilter): Фильтр для получения списка городов
- Raises:
ValueError: Если filter_params не является объектом CityListFilter
- Returns:
list[CitiesResponse]: Список объектов CitiesResponse с информацией о городах
- city(filter_params: CityFilter) CityResponse | None[исходный код]¶
Подбор локации по названию города Метод позволяет получать подсказки по подбору населенного пункта по его наименованию.
- Args:
filter_params (CityFilter): Фильтр для подбора города
- Raises:
ValueError: Если filter_params не является объектом CityFilter
- Returns:
Optional[CityResponse]: Объект CityResponse с информацией о найденном городе или None, если город не найден
- coordinates(filter_params: CoordinatesFilter | None = None) list[CoordinatesResponse][исходный код]¶
Получение локации по координатам Метод позволяет определить локацию по переданным в запросе координатам
- Args:
filter_params (CoordinatesFilter): Фильтр для получения локации по координатам
- Raises:
ValueError: Если filter_params не является объектом CoordinatesFilter
- Returns:
list[CoordinatesResponse]: Список объектов CoordinatesResponse с информацией о локации
- regions(filter_params: RegionFilter | None = None) list[RegionResponse][исходный код]¶
Получение списка регионов Метод предназначен для получения детальной информации о регионах.
- Args:
filter_params (RegionFilter): Фильтр для получения списка регионов
- Raises:
ValueError: Если filter_params не является объектом RegionFilter
- Returns:
list[RegionResponse]: Список объектов RegionResponse с информацией о регионах
- zip(filter_params: ZipFilter | None = None) list[ZipResponse][исходный код]¶
Получение почтовых индексов города Метод предназначен для получения списка почтовых индексов.
- Args:
filter_params (ZipFilter): Фильтр для получения списка почтовых индексов
- Raises:
ValueError: Если filter_params не является объектом ZipFilter
- Returns:
list[ZipResponse]: Список объектов ZipResponse с информацией о почтовых индексах
- class cdek.apps.location.RegionFilter(*, country_codes: str | None = None, size: int = 1000, page: int = 0, lang: Literal['rus', 'zho'] = 'rus')[исходный код]¶
Базовые классы:
BaseModelФильтр для регионов
- country_codes: str | None¶
- lang: Literal['rus', 'zho']¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int¶
- size: int¶
- class cdek.apps.location.RegionResponse(*, region: Annotated[str, MaxLen(max_length=255)], region_code: int | None = None, kladr_region_code: str | None = None, sub_region: str | None = None, country_code: Annotated[str | None, MaxLen(max_length=2)] = None, country: Annotated[str | None, MaxLen(max_length=255)] = None)[исходный код]¶
Базовые классы:
Country,Region- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.ZipFilter(*, city_code: int)[исходный код]¶
Базовые классы:
BaseModelФильтр для почтовых индексов
- city_code: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.ZipResponse(*, code: int, postal_code: list[str])[исходный код]¶
Базовые классы:
BaseModel- code: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- postal_code: list[str]¶
Submodules¶
cdek.apps.location.filters module¶
- class cdek.apps.location.filters.CityFilter(*, name: str, country_code: str | None = None)[исходный код]¶
Базовые классы:
BaseModelФильтр для городов
- country_code: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
- class cdek.apps.location.filters.CityListFilter(*, country_codes: str | None = None, region_code: int | None = None, kladr_region_code: str | None = None, kladr_code: str | None = None, fias_guid: UUID | None = None, postal_code: str | None = None, code: int | None = None, city: str | None = None, payment_limit: float | None = None, size: int | None = 1000, page: int | None = 0, lang: str | None = None)[исходный код]¶
Базовые классы:
BaseModelФильтр для списка городов
- city: str | None¶
- code: int | None¶
- country_codes: str | None¶
- fias_guid: UUID | None¶
- kladr_code: str | None¶
- kladr_region_code: str | None¶
- lang: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int | None¶
- payment_limit: float | None¶
- postal_code: str | None¶
- region_code: int | None¶
- size: int | None¶
- class cdek.apps.location.filters.CoordinatesFilter(*, latitude: float, longitude: float)[исходный код]¶
Базовые классы:
BaseModelФильтр для координат
- latitude: float¶
- longitude: float¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.filters.RegionFilter(*, country_codes: str | None = None, size: int = 1000, page: int = 0, lang: Literal['rus', 'zho'] = 'rus')[исходный код]¶
Базовые классы:
BaseModelФильтр для регионов
- country_codes: str | None¶
- lang: Literal['rus', 'zho']¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int¶
- size: int¶
- class cdek.apps.location.filters.ZipFilter(*, city_code: int)[исходный код]¶
Базовые классы:
BaseModelФильтр для почтовых индексов
- city_code: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
cdek.apps.location.location module¶
- class cdek.apps.location.location.LocationApp(client: CdekClient)[исходный код]¶
Базовые классы:
AppПолучение списка локаций
- cities(filter_params: CityListFilter | None = None) list[CitiesResponse][исходный код]¶
Получение списка населенных пунктов Метод предназначен для получения детальной информации о населенных пунктах
- Args:
filter_params (CityListFilter): Фильтр для получения списка городов
- Raises:
ValueError: Если filter_params не является объектом CityListFilter
- Returns:
list[CitiesResponse]: Список объектов CitiesResponse с информацией о городах
- city(filter_params: CityFilter) CityResponse | None[исходный код]¶
Подбор локации по названию города Метод позволяет получать подсказки по подбору населенного пункта по его наименованию.
- Args:
filter_params (CityFilter): Фильтр для подбора города
- Raises:
ValueError: Если filter_params не является объектом CityFilter
- Returns:
Optional[CityResponse]: Объект CityResponse с информацией о найденном городе или None, если город не найден
- coordinates(filter_params: CoordinatesFilter | None = None) list[CoordinatesResponse][исходный код]¶
Получение локации по координатам Метод позволяет определить локацию по переданным в запросе координатам
- Args:
filter_params (CoordinatesFilter): Фильтр для получения локации по координатам
- Raises:
ValueError: Если filter_params не является объектом CoordinatesFilter
- Returns:
list[CoordinatesResponse]: Список объектов CoordinatesResponse с информацией о локации
- regions(filter_params: RegionFilter | None = None) list[RegionResponse][исходный код]¶
Получение списка регионов Метод предназначен для получения детальной информации о регионах.
- Args:
filter_params (RegionFilter): Фильтр для получения списка регионов
- Raises:
ValueError: Если filter_params не является объектом RegionFilter
- Returns:
list[RegionResponse]: Список объектов RegionResponse с информацией о регионах
- zip(filter_params: ZipFilter | None = None) list[ZipResponse][исходный код]¶
Получение почтовых индексов города Метод предназначен для получения списка почтовых индексов.
- Args:
filter_params (ZipFilter): Фильтр для получения списка почтовых индексов
- Raises:
ValueError: Если filter_params не является объектом ZipFilter
- Returns:
list[ZipResponse]: Список объектов ZipResponse с информацией о почтовых индексах
cdek.apps.location.responses module¶
- class cdek.apps.location.responses.CitiesResponse(*, longitude: float | None = None, latitude: float | None = None, region: Annotated[str | None, MaxLen(max_length=255)] = None, region_code: int | None = None, kladr_region_code: str | None = None, sub_region: str | None = None, country_code: Annotated[str | None, MaxLen(max_length=2)] = None, country: Annotated[str | None, MaxLen(max_length=255)] = None, code: int, city_uuid: UUID, city: str, fias_guid: UUID | None = None, time_zone: str | None = None, payment_limit: float | None)[исходный код]¶
Базовые классы:
City,Country,Region,Coordinates- city: str¶
- city_uuid: UUID¶
- code: int¶
- country: str | None¶
- country_code: str | None¶
- fias_guid: UUID | None¶
- kladr_region_code: str | None¶
- latitude: float | None¶
- longitude: float | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- payment_limit: float | None¶
- region: str | None¶
- region_code: int | None¶
- sub_region: str | None¶
- time_zone: str | None¶
- class cdek.apps.location.responses.CityResponse(*, code: int, city_uuid: UUID, full_name: Annotated[str, MaxLen(max_length=255)], country_code: Annotated[str, MaxLen(max_length=255)])[исходный код]¶
Базовые классы:
BaseModel- city_uuid: UUID¶
- code: int¶
- country_code: str¶
- full_name: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.responses.CoordinatesResponse(*, code: int, city_uuid: UUID, city: str, fias_guid: UUID | None = None)[исходный код]¶
Базовые классы:
City- city: str¶
- city_uuid: UUID¶
- code: int¶
- fias_guid: UUID | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class cdek.apps.location.responses.RegionResponse(*, region: Annotated[str, MaxLen(max_length=255)], region_code: int | None = None, kladr_region_code: str | None = None, sub_region: str | None = None, country_code: Annotated[str | None, MaxLen(max_length=2)] = None, country: Annotated[str | None, MaxLen(max_length=255)] = None)[исходный код]¶
Базовые классы:
Country,Region- country: str | None¶
- country_code: str | None¶
- kladr_region_code: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- region: str¶
- region_code: int | None¶
- sub_region: str | None¶
- class cdek.apps.location.responses.ZipResponse(*, code: int, postal_code: list[str])[исходный код]¶
Базовые классы:
BaseModel- code: int¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- postal_code: list[str]¶