Skip to content

schema

Classes:

Attributes:

Attributes

logger module-attribute

logger = getLogger(__name__)

REFUGES_HUT_TYPES module-attribute

REFUGES_HUT_TYPES: dict[int, HutTypeRefugesEnum] = {
    7: cabane_non_gardee,
    10: refuge_garde,
    9: gite_d_etape,
    28: batiment_en_montagne,
}

WODORE_HUT_TYPES module-attribute

WODORE_HUT_TYPES: dict[int, HutTypeEnum] = {
    7: selfhut,
    10: hut,
    9: hut,
    28: bhotel,
}

Classes

HutTypeRefugesEnum

Attributes:

Attributes

missing class-attribute instance-attribute
missing = 'missing'
cabane_non_gardee class-attribute instance-attribute
cabane_non_gardee = 'cabane-non-gardee'
refuge_garde class-attribute instance-attribute
refuge_garde = 'refuge-garde'
gite_d_etape class-attribute instance-attribute
gite_d_etape = 'gite-d-etape'
batiment_en_montagne class-attribute instance-attribute
batiment_en_montagne = 'batiment-en-montagne'

RefugesInfoProperties

Properties save together with the source data.

Attributes:

Attributes

slug class-attribute instance-attribute
slug: str = Field(
    ..., description="hut slug by refuges.info"
)
hut_type class-attribute instance-attribute
hut_type: HutTypeRefugesEnum = Field(
    ..., description="hut type by refuges.info."
)

RefugesInfoFeature

RefugesInfo Feature Model with required properties and geometry.

Methods:

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
geometry instance-attribute
geometry: Point
properties instance-attribute
properties: _RefugesInfoFeatureProperties

Functions

get_id
get_id() -> str
get_name
get_name() -> str
get_location
get_location() -> LocationEleSchema
get_properties
get_properties() -> RefugesInfoProperties

RefugesInfoFeatureCollection

Used to get FeatureCollection, not returned by the service.

Attributes:

Attributes

generator instance-attribute
generator: str
copyright_by class-attribute instance-attribute
copyright_by: str = Field(..., alias='copyright')
timestamp instance-attribute
timestamp: str
size instance-attribute
size: str
features instance-attribute
features: list[RefugesInfoFeature]

RefugesInfoHutSource

Data from refuges.info database.

Methods:

  • __str__
  • show

    Returns a formatted string with the hut information which can be printed.

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(coerce_numbers_to_str=True)
name class-attribute instance-attribute
name: str = Field(..., description='Original hut name.')
location class-attribute instance-attribute
location: LocationEleSchema | None = Field(
    None, description="Location of the hut."
)
source_id class-attribute instance-attribute
source_id: str = Field(
    ..., description="Originial source id of the hut."
)
source_data class-attribute instance-attribute
source_data: TSourceData_co | None = Field(
    None, description="Source data for this hut."
)
source_properties class-attribute instance-attribute
source_properties: TProperties_co | None = Field(
    None, description="Additinal source data properties."
)
version class-attribute instance-attribute
version: int = Field(
    default=0,
    description="Version of the service when this entry was created.",
)
created class-attribute instance-attribute
created: datetime = Field(
    default_factory=now,
    description="Version of the service when this entry was created.",
)
source_properties_schema property
source_properties_schema: dict

Returns JSON schema for the 'source_properties' fields.

Returns:

  • dict

    JSON schema.

source_name class-attribute instance-attribute
source_name: str = 'refuges'

Functions

__str__
__str__() -> str
show
show(
    source_id: bool = True,
    location: bool = True,
    elevation: bool = True,
    source_name: bool = True,
    version: bool = False,
    created: bool = False,
) -> str

Returns a formatted string with the hut information which can be printed.

Parameters:

  • source_id
    (bool, default: True ) –

    Show source ID.

  • location
    (bool, default: True ) –

    Show location.

  • elevation
    (bool, default: True ) –

    Show elevation.

  • source_name
    (bool, default: True ) –

    Show source name.

  • version
    (bool, default: False ) –

    Show verions.

  • created
    (bool, default: False ) –

    Show created date.

Returns:

  • str

    Formatted string.

RefugesInfoHut0Convert

Classes:

Methods:

Attributes:

Attributes

source_data class-attribute instance-attribute
source_data: TSourceData = Field(..., exclude=True)
include_photos class-attribute instance-attribute
include_photos: bool = True
slug property
slug: str
location property
contacts property
contacts: list[ContactSchema]
country_code property
country_code: str | None
comment property
comment: str
open_monthly property
open_monthly: OpenMonthlySchema
is_active property
is_active: bool
extras property
extras: dict[str, Any]
name property
source_name property
source_name: str
description property
description: TranslationSchema
author property
author: AuthorSchema | None
source property
source: SourceSchema | None
license property
license: LicenseSchema | None
notes property
notes: list[TranslationSchema]
owner property
owner: OwnerSchema | None
photos property
photos: list[PhotoSchema]
url property
url: str
capacity property
capacity: CapacitySchema
hut_type property
hut_type: HutTypeSchema
is_public property
is_public: bool

Classes

FieldNotImplementedError
FieldNotImplementedError(
    obj: BaseHutConverterSchema, field: str
)

Field is not implemented.

Parameters:

Functions

Functions

get_hut
get_hut() -> HutSchema

Convert to hut.

Returns:

Functions