Skip to content

schema

Classes:

Attributes:

Attributes

logger module-attribute

logger = getLogger(__name__)

Classes

GeocodeHutSchema

Open street map schema.

Methods:

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
place_id class-attribute instance-attribute
place_id: int | None = None
name instance-attribute
name: str
lat instance-attribute
lat: Latitude
lon instance-attribute
lon: Longitude
licence class-attribute instance-attribute
licence: str | None = None
osm_type class-attribute instance-attribute
osm_type: str | None = None
osm_id class-attribute instance-attribute
osm_id: int | None = None
category class-attribute instance-attribute
category: str | None = None
building_type class-attribute instance-attribute
building_type: str | None = Field(None, alias='type')
place_rank class-attribute instance-attribute
place_rank: int | None = None
importance class-attribute instance-attribute
importance: float | None = None
addresstype class-attribute instance-attribute
addresstype: str | None = None
display_name class-attribute instance-attribute
display_name: str | None = None
extratags class-attribute instance-attribute
extratags: OSMTagsOptional | None = None
boundingbox class-attribute instance-attribute
boundingbox: BBox | None = None

Functions

get_id
get_id() -> str

Get open street map id.

get_name
get_name() -> str

Get open street map hut name.

get_location
get_location() -> LocationEleSchema

Get open street map location.

GeocodeProperties

GeocodeHutSource

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."
)
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.

version class-attribute instance-attribute
version: int = 0
source_name class-attribute instance-attribute
source_name: str = 'geocode'

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.

GeocodeHut0Convert

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
source property
source: SourceSchema | None
author property
author: AuthorSchema | None
source_name property
source_name: str
location property
notes property
notes: list[TranslationSchema]
owner property
owner: OwnerSchema | None
url property
url: str
contacts property
contacts: list[ContactSchema]
country_code property
country_code: str | None
comment property
comment: str
capacity property
capacity: CapacitySchema
hut_type property
hut_type: HutTypeSchema
photos property
photos: list[PhotoSchema]
open_monthly property
open_monthly: OpenMonthlySchema
is_active property
is_active: bool
is_public property
is_public: bool
extras property
extras: dict[str, Any]
name property
description property
description: TranslationSchema

Classes

FieldNotImplementedError
FieldNotImplementedError(
    obj: BaseHutConverterSchema, field: str
)

Field is not implemented.

Parameters:

Functions

Functions

get_hut
get_hut() -> HutSchema

Convert to hut.

Returns: