Skip to content

Schema

bmkg.schemas

Coordinate dataclass

A schema used to store info about coordinate.

Attributes:

Name Type Description
latitude float

latitude of the coordinate.

longitude float

longitude of the coordinate.

Earthquake dataclass

A schema used to store info about earthquake.

Attributes:

Name Type Description
datetime datetime

datetime of the earthquake.

coordinate Coordinate

coordinate of the earthquake.

magnitude float

magnitude is the strength of an earthquake in M as its unit.

depth float

depth of the earthquake in km as its unit.

region str

The area closest to the location of the earthquake epicenter.

Note

The datetime field is aware datetime, meaning it has the timezone information.

FeltEarthquake dataclass

A schema used to store info about felt earthquake.

Attributes:

Name Type Description
earthquake Earthquake

earthquake schema.

felt str

area that felt an earthquake on the MMI scale.

LatestEarthquake dataclass

A schema used to store info about latest earthquake.

Attributes:

Name Type Description
earthquake Earthquake

earthquake schema.

potency str

potential tsunami or not, and the status of the earthquake felt.

felt str

area that felt an earthquake on the MMI scale.

shakemap Shakemap

shakemap schema.

Location dataclass

A schema used to store information about a geographic location.

Attributes:

Name Type Description
admin_level_1 str

The administrative level 1 code, typically representing the province.

admin_level_2 str

The administrative level 2 code, typically representing the city or district.

admin_level_3 str

The administrative level 3 code, typically representing the subdistrict.

admin_level_4 str

The administrative level 4 code, typically representing a more localized area (e.g., village or neighborhood).

province str

The name of the province or state.

city str

The name of the city or district.

subdistrict str

The name of the subdistrict (a subdivision of a city or district).

village str

The name of the village or rural area.

longitude float

The geographic longitude coordinate of the location.

latitude float

The geographic latitude coordinate of the location.

timezone str

The time zone identifier for the location, e.g., "Asia/Jakarta".

Shakemap dataclass

A schema used to store info about shakemap.

Attributes:

Name Type Description
file_name str

name of shakemap file.

StrongEarthquake dataclass

A schema used to store info about strong earthquake.

Attributes:

Name Type Description
earthquake Earthquake

earthquake schema.

potency str

potential tsunami or not, and the status of the earthquake felt.

Weather dataclass

A schema used to store information about a weather.

Attributes:

Name Type Description
datetime datetime

The datetime of the weather data in UTC format.

t int

Temperature in degrees Celsius.

tcc int

Total cloud cover percentage (0-100%).

tp float

Precipitation amount in millimeters.

weather Weather

Weather condition code, corresponds to a predefined set of weather conditions.

wd_deg int

Wind direction in degrees (0-360), where 0° is North.

wd Cardinal

Wind direction from which the wind blows.

wd_to Cardinal

Wind direction the wind is blowing towards.

ws float

Wind speed in kilometers per hour (km/h).

hu int

Humidity percentage (0-100%).

vs int

Visibility in meters.

time_index str

Time index in the format "x-y", where x is the hour start of the forecast, and y is the hour end of the forecast.

analysis_date datetime

The date when the weather data was generated (in UTC format).

image str

URL to an image representing the weather condition (e.g., an icon).

utc_datetime datetime

The UTC datetime when the weather data was recorded.

local_datetime datetime

The local datetime when the weather data was recorded.

WeatherForecast dataclass

A schema used to store information about weather forecast.

Attributes:

Name Type Description
location Location

location information.

weathers list[Weather]

list of weather forecast data.