Skip to content

schema

Classes:

Attributes:

Attributes

logger module-attribute

logger = getLogger(__name__)

Classes

WikidataPhotoInfo

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
size instance-attribute
size: int
width instance-attribute
width: int
height instance-attribute
height: int
url instance-attribute
url: str
descriptionurl instance-attribute
descriptionurl: str
descriptionshorturl instance-attribute
descriptionshorturl: str
mime instance-attribute
mime: str

WikidataPhotoAttributes

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
ns instance-attribute
ns: int
title instance-attribute
title: str
missing instance-attribute
missing: str
known instance-attribute
known: str
imagerepository instance-attribute
imagerepository: str
imageinfo instance-attribute
imageinfo: list[WikidataPhotoInfo]
contentmodel instance-attribute
contentmodel: str
pagelanguage instance-attribute
pagelanguage: str
pagelanguagehtmlcode instance-attribute
pagelanguagehtmlcode: str
pagelanguagedir instance-attribute
pagelanguagedir: str
fullurl instance-attribute
fullurl: str
editurl instance-attribute
editurl: str
canonicalurl instance-attribute
canonicalurl: str

WikidataPhoto

Wikidata photo.

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
title instance-attribute
title: str
attributes instance-attribute

WikidataHutSchema

Open street map schema.

Methods:

Attributes:

Attributes

model_config class-attribute instance-attribute
model_config = ConfigDict(
    from_attributes=True, extra="allow"
)
attributes instance-attribute
attributes: dict[str, Any]
photo instance-attribute
photo: WikidataPhoto | None
wikidata_id class-attribute instance-attribute
wikidata_id: str = Field(..., alias='id')
name instance-attribute
name: str
lat instance-attribute
lat: Latitude | None
lon instance-attribute
lon: Longitude | 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.

WikidataProperties

WikidataHutSource

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 = 'wikidata'

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.

WikidataHut0Convert

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
author property
author: AuthorSchema | None
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
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
source_name property
source_name: str
description property
description: TranslationSchema
photos property
photos: list[PhotoSchema]
source property
source: SourceSchema | None
license property
license: LicenseSchema | None

Classes

FieldNotImplementedError
FieldNotImplementedError(
    obj: BaseHutConverterSchema, field: str
)

Field is not implemented.

Parameters:

Functions

Functions

get_hut
get_hut() -> HutSchema

Convert to hut.

Returns: