db

In this module there are all the database setups and models used by the weatherDB package, you shouldn’t need to use them directly.

models

Those are the database models

class weatherDB.db.models.MetaP(**kwargs)[source]

Bases: MetaBase, MetaBaseQC

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

last_imp_corr: Mapped[bool]
corr_from: Mapped[UTCDateTime | None]
corr_until: Mapped[UTCDateTime | None]
horizon: Mapped[float | None]
richter_class: Mapped[str | None]
bundesland: Mapped[str30]
filled_from: Mapped[UTCDateTime | None]
filled_until: Mapped[UTCDateTime | None]
geometry: Mapped[str]
geometry_utm: Mapped[str]
hist_until: Mapped[UTCDateTime | None]
is_real: Mapped[bool]
last_imp_filled: Mapped[bool]
last_imp_from: Mapped[UTCDateTime | None]
last_imp_qc: Mapped[bool]
last_imp_until: Mapped[UTCDateTime | None]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

qc_dropped: Mapped[float | None]
qc_from: Mapped[UTCDateTime | None]
qc_until: Mapped[UTCDateTime | None]
raw_from: Mapped[UTCDateTime | None]
raw_until: Mapped[UTCDateTime | None]
registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

station_id: Mapped[int]
stationshoehe: Mapped[int]
stationsname: Mapped[str50]
class weatherDB.db.models.MetaPD(**kwargs)[source]

Bases: MetaBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

bundesland: Mapped[str30]
filled_from: Mapped[UTCDateTime | None]
filled_until: Mapped[UTCDateTime | None]
geometry: Mapped[str]
geometry_utm: Mapped[str]
hist_until: Mapped[UTCDateTime | None]
is_real: Mapped[bool]
last_imp_filled: Mapped[bool]
last_imp_from: Mapped[UTCDateTime | None]
last_imp_until: Mapped[UTCDateTime | None]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

raw_from: Mapped[UTCDateTime | None]
raw_until: Mapped[UTCDateTime | None]
registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

station_id: Mapped[int]
stationshoehe: Mapped[int]
stationsname: Mapped[str50]
class weatherDB.db.models.MetaET(**kwargs)[source]

Bases: MetaBase, MetaBaseQC

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

bundesland: Mapped[str30]
filled_from: Mapped[UTCDateTime | None]
filled_until: Mapped[UTCDateTime | None]
geometry: Mapped[str]
geometry_utm: Mapped[str]
hist_until: Mapped[UTCDateTime | None]
is_real: Mapped[bool]
last_imp_filled: Mapped[bool]
last_imp_from: Mapped[UTCDateTime | None]
last_imp_qc: Mapped[bool]
last_imp_until: Mapped[UTCDateTime | None]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

qc_dropped: Mapped[float | None]
qc_from: Mapped[UTCDateTime | None]
qc_until: Mapped[UTCDateTime | None]
raw_from: Mapped[UTCDateTime | None]
raw_until: Mapped[UTCDateTime | None]
registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

station_id: Mapped[int]
stationshoehe: Mapped[int]
stationsname: Mapped[str50]
class weatherDB.db.models.MetaT(**kwargs)[source]

Bases: MetaBase, MetaBaseQC

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

bundesland: Mapped[str30]
filled_from: Mapped[UTCDateTime | None]
filled_until: Mapped[UTCDateTime | None]
geometry: Mapped[str]
geometry_utm: Mapped[str]
hist_until: Mapped[UTCDateTime | None]
is_real: Mapped[bool]
last_imp_filled: Mapped[bool]
last_imp_from: Mapped[UTCDateTime | None]
last_imp_qc: Mapped[bool]
last_imp_until: Mapped[UTCDateTime | None]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

qc_dropped: Mapped[float | None]
qc_from: Mapped[UTCDateTime | None]
qc_until: Mapped[UTCDateTime | None]
raw_from: Mapped[UTCDateTime | None]
raw_until: Mapped[UTCDateTime | None]
registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

station_id: Mapped[int]
stationshoehe: Mapped[int]
stationsname: Mapped[str50]
class weatherDB.db.models.RawFiles(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

parameter: Mapped[Annotated[str, 3]]
filepath: Mapped[str]
modtime: Mapped[UTCDateTime]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.DroppedStations(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

station_id: Mapped[int]
parameter: Mapped[Annotated[str, 3]]
why: Mapped[str]
timestamp: Mapped[UTCDateTime]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.ParameterVariables(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

parameter: Mapped[Annotated[str, 3]]
start_tstp_last_imp: Mapped[UTCDateTime | None]
max_tstp_last_imp: Mapped[UTCDateTime | None]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.StationMATimeserie(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

station_id: Mapped[int]
parameter: Mapped[Annotated[str, 3]]
kind: Mapped[str]
value: Mapped[int]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.StationMARaster(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

station_id: Mapped[int]
raster_key: Mapped[Annotated[str, 7]]
parameter: Mapped[Annotated[str, 3]]
term: Mapped[Annotated[str, 4]]
value: Mapped[int]
distance: Mapped[int]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.NeededDownloadTime(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

timestamp: Mapped[UTCDateTime]
quantity: Mapped[int]
aggregate: Mapped[str]
timespan: Mapped[timedelta]
zip: Mapped[bool]
pc: Mapped[str]
duration: Mapped[timedelta]
output_size: Mapped[int]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.Settings(**kwargs)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

key: Mapped[str]
value: Mapped[str]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

base models

class weatherDB.db.models.ModelBase(**kwargs: Any)[source]

Bases: DeclarativeBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

class weatherDB.db.models.MetaBase(**kwargs: Any)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

station_id: Mapped[int] = <sqlalchemy.orm.properties.MappedColumn object>
is_real: Mapped[bool] = <sqlalchemy.orm.properties.MappedColumn object>
stationsname: Mapped[Annotated[str, 50]] = <sqlalchemy.orm.properties.MappedColumn object>
bundesland: Mapped[Annotated[str, 30]] = <sqlalchemy.orm.properties.MappedColumn object>
raw_from: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
raw_until: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
hist_until: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
last_imp_from: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
last_imp_until: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
last_imp_filled: Mapped[bool] = <sqlalchemy.orm.properties.MappedColumn object>
filled_from: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
filled_until: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
stationshoehe: Mapped[int] = <sqlalchemy.orm.properties.MappedColumn object>
geometry: Mapped[str] = <sqlalchemy.orm.properties.MappedColumn object>
geometry_utm: Mapped[str] = <sqlalchemy.orm.properties.MappedColumn object>
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class weatherDB.db.models.MetaBaseQC(**kwargs: Any)[source]

Bases: ModelBase

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

last_imp_qc: Mapped[bool] = <sqlalchemy.orm.properties.MappedColumn object>
qc_from: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
qc_until: Mapped[UTCDateTime | None] = <sqlalchemy.orm.properties.MappedColumn object>
qc_dropped: Mapped[float | None] = <sqlalchemy.orm.properties.MappedColumn object>
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.