Skip to content

refuges_info

Modules:

Classes:

Classes

RefugesInfoService

RefugesInfoService(
    request_url: str = "https://www.refuges.info/api",
)

Service to get huts from refuges.info with its api.

Note

The methods are descriebed in BaseService.

Classes:

Methods:

Attributes:

Attributes

support_bbox class-attribute instance-attribute
support_bbox: bool = support_bbox
support_limit class-attribute instance-attribute
support_limit: bool = support_limit
support_offset class-attribute instance-attribute
support_offset: bool = support_offset
support_convert class-attribute instance-attribute
support_convert: bool = support_convert
support_booking class-attribute instance-attribute
support_booking: bool = support_booking
request_url instance-attribute
request_url = request_url

Classes

MethodNotImplementedError
MethodNotImplementedError(obj: BaseService, method: str)

Method is not implemented exception.

Parameters:

  • obj
    (BaseService) –

    Service object (e.g. MyService).

  • method
    (str) –

    Method which is not implemented.

Functions

Functions

clear_all_cache classmethod
clear_all_cache() -> None

Clears the cache of all services!

get_huts
get_huts(
    bbox: BBox | None = None,
    limit: int = 1,
    offset: int = 0,
    include_photos: bool = True,
    **kwargs: Any,
) -> list[HutSchema]

Get all huts form source and converts them. Calls get_huts_from_source() and convert().

Returns:

  • list[HutSchema]

    Converted huts from source.

get_bookings
get_bookings(
    date: datetime | date | Literal["now"] | None = None,
    days: int | None = None,
    source_ids: list[int | str] | None = None,
    lang: str = "de",
    request_interval: float | None = None,
) -> dict[int | str, HutBookingsSchema]

Get bookings for a list of huts.

Parameters:

  • date
    (datetime | date | Literal['now'] | None, default: None ) –

    Start daye for the bookings

  • days
    (int | None, default: None ) –

    Duration in days

  • source_ids
    (list[int | str] | None, default: None ) –

    A list of ids to return (source id, not the hut id), if set to None all are returned

  • lang
    (str, default: 'de' ) –

    Language for the response

  • request_interval
    (float | None, default: None ) –

    Interval between requests (if each huts needs a request)

Returns:

  • dict[int | str, HutBookingsSchema]

    A dictionary with the bookings (key = source id).

get_huts_from_source
get_huts_from_source(
    bbox: BBox | None = None,
    limit: int = 1,
    offset: int = 0,
    **kwargs: Any,
) -> list[RefugesInfoHutSource]
convert
convert(
    src: Mapping | Any, include_photos: bool = True
) -> HutSchema