schema
¶
Classes:
-
HutTypeRefugesEnum– -
RefugesInfoProperties–Properties save together with the source data.
-
RefugesInfoFeature–RefugesInfo Feature Model with required properties and geometry.
-
RefugesInfoFeatureCollection–Used to get FeatureCollection, not returned by the service.
-
RefugesInfoHutSource–Data from refuges.info database.
-
RefugesInfoHut0Convert–
Attributes:
-
logger– -
REFUGES_HUT_TYPES(dict[int, HutTypeRefugesEnum]) – -
WODORE_HUT_TYPES(dict[int, HutTypeEnum]) –
Attributes¶
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
¶
RefugesInfoProperties
¶
Properties save together with the source data.
Attributes:
-
slug(str) – -
hut_type(HutTypeRefugesEnum) –
Attributes¶
slug
class-attribute
instance-attribute
¶
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:
-
get_id– -
get_name– -
get_location– -
get_properties–
Attributes:
-
model_config– -
geometry(Point) – -
properties(_RefugesInfoFeatureProperties) –
RefugesInfoFeatureCollection
¶
Used to get FeatureCollection, not returned by the service.
Attributes:
-
generator(str) – -
copyright_by(str) – -
timestamp(str) – -
size(str) – -
features(list[RefugesInfoFeature]) –
Attributes¶
RefugesInfoHutSource
¶
Data from refuges.info database.
Methods:
Attributes:
-
model_config– -
name(str) – -
location(LocationEleSchema | None) – -
source_id(str) – -
source_data(TSourceData_co | None) – -
source_properties(TProperties_co | None) – -
version(int) – -
created(datetime) – -
source_properties_schema(dict) –Returns JSON schema for the 'source_properties' fields.
-
source_name(str) –
Attributes¶
model_config
class-attribute
instance-attribute
¶
location
class-attribute
instance-attribute
¶
location: LocationEleSchema | None = Field(
None, description="Location of the hut."
)
source_id
class-attribute
instance-attribute
¶
source_data
class-attribute
instance-attribute
¶
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
¶
Returns JSON schema for the 'source_properties' fields.
Returns:
-
dict–JSON schema.
Functions¶
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:
-
FieldNotImplementedError–Field is not implemented.
Methods:
-
get_hut–Convert to hut.
Attributes:
-
source_data(TSourceData) – -
include_photos(bool) – -
slug(str) – -
location(LocationEleSchema) – -
contacts(list[ContactSchema]) – -
country_code(str | None) – -
comment(str) – -
open_monthly(OpenMonthlySchema) – -
is_active(bool) – -
extras(dict[str, Any]) – -
name(TranslationSchema) – -
source_name(str) – -
description(TranslationSchema) – -
author(AuthorSchema | None) – -
source(SourceSchema | None) – -
license(LicenseSchema | None) – -
notes(list[TranslationSchema]) – -
owner(OwnerSchema | None) – -
photos(list[PhotoSchema]) – -
url(str) – -
capacity(CapacitySchema) – -
hut_type(HutTypeSchema) – -
is_public(bool) –
Attributes¶
source_data
class-attribute
instance-attribute
¶
Classes¶
FieldNotImplementedError
¶
FieldNotImplementedError(
obj: BaseHutConverterSchema, field: str
)
Field is not implemented.
Parameters:
-
(obj¶BaseHutConverterSchema) –Current object.
-
(field¶str) –Field which is not implementd.