cli

This module contains the command line interface for the WeatherDB package.

weatherdb

This is the Command line interface of the WeatherDB package.

weatherdb [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options

--version

Show the version and exit.

--do-logging, --no-logging

Should the logging be done to the console?

Default:

True

-c, --connection <connection>

The connection to use. Default is the value from the configuration file.

-v, --verbose

Should the verbose mode be activated? -> This will print complete tracebacks on errors.

Default:

False

create-db-schema

Create the database schema for the first time.

weatherdb create-db-schema [OPTIONS]

Options

-o, --owner <owner>

The user that should get the ownership of the created tables and schemas. As default is the current user will be the owner.

create-user-config

Create User configuration file.

weatherdb create-user-config [OPTIONS]

Options

-f, --file <file>

The file to save the user configuration to.

-e, --on-exists <on_exists>

What to do if the file already exists. Options are ‘ask’, ‘overwrite’, ‘define’ or ‘error’.

Default:

'ask'

download-dem

Download the newest DEM data from the Copernicus Sentinel dataset. [1]_

Only the GLO-30 DEM, wich has a 30m resolution, is downloaded as it is freely available. If you register as a scientific researcher also the EEA-10, with 10 m resolution, is available. You will have to download the data yourself and define it in the configuration file.

After downloading the data, the files are merged and saved as a single tif file in the data directory in a subfolder called ‘dems’. To use the DEM data in the WeatherDB, you will have to define the path to the tif file in the configuration file.

References:

weatherdb download-dem [OPTIONS]

Options

-d, --out-dir <out_dir>

The directory to save the downloaded DEM data to.

-o, --overwrite, -no-o, --no-overwrite

Should the digital elevation model raster be downloaded even if it already exists?

-e, --extent <extent>

The extent in WGS84 of the DEM data to download. The default is the boundary of germany + ~40km.

Default:

5.3, 46.1, 15.6, 55.4

-u, --update-user-config

Should the user configuration be updated with the path to the downloaded DEM?

Default:

False

-s, --service <service>

The service to use to download the DEM. Options are ‘prism’ or ‘openTopography’. You can use this option muultiple times to test both in the given order until the file could be downloaded.

Default:

'prism', 'openTopography'

download-ma-rasters

Get the multi annual rasters on which bases the regionalisation is done.

The refined multi annual datasets, that are downloaded are published on Zenodo. [1]_

References:

weatherdb download-ma-rasters [OPTIONS]

Options

-o, --overwrite <overwrite>

Should the multi annual rasters be downloaded even if they already exist?

-w, --which <which>

Which raster to download. Options are ‘dwd’, ‘hyras’, ‘regnie’ or ‘all’.

Default:

'all'

-u, --update-user-config

Should the user configuration be updated with the path to the downloaded rasters?

Default:

False

fillup

Do the filling of the complete database.

weatherdb fillup [OPTIONS]

Options

-u, --period_until <period_until>

The until timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-f, --period_from <period_from>

The from timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-i, --stid <stid>

The station IDs to apply the method to. Options are ‘all’ or a specific station ID. You can enter multiple values to add multiple station IDs.

Default:

'all'

-p, --para <para>

The parameters to work with. Options are ‘p’, ‘t’ and ‘et’. You can enter multiple values to add multiple parameters.

Default:

'p', 't', 'et'

force-deactivate-all-broker

Forcefully set the active broker flag in the database to deactivated. This is useful if the broker got exited before it could deactivate itself. (!!!Only use this if you’re sure that the database did all the necessary updates!!!)

weatherdb force-deactivate-all-broker [OPTIONS]

quality-check

Do the quality check of the complete database.

weatherdb quality-check [OPTIONS]

Options

-u, --period_until <period_until>

The until timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-f, --period_from <period_from>

The from timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-i, --stid <stid>

The station IDs to apply the method to. Options are ‘all’ or a specific station ID. You can enter multiple values to add multiple station IDs.

Default:

'all'

-p, --para <para>

The parameters to work with. Options are ‘p’, ‘t’ and ‘et’. You can enter multiple values to add multiple parameters.

Default:

'p', 't', 'et'

richter-correct

Do the richter correction of the complete database.

weatherdb richter-correct [OPTIONS]

Options

-i, --stid <stid>

The station IDs to apply the method to. Options are ‘all’ or a specific station ID. You can enter multiple values to add multiple station IDs.

Default:

'all'

-u, --period_until <period_until>

The until timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-f, --period_from <period_from>

The from timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

set-db-version

Set the db version to the current WeatherDB version to prevent recalculation of the whole database. (!!!Only use this if you’re sure that the database did all the necessary updates!!!)

weatherdb set-db-version [OPTIONS]

unlock-keyring

unlock the keyring backend.

weatherdb unlock-keyring [OPTIONS]

update-db

Update the complete database. Get the newest data from DWD and treat it.

weatherdb update-db [OPTIONS]

update-ma-raster

Update the multi annual raster values in the database.

weatherdb update-ma-raster [OPTIONS]

update-meta

Update the meta data in the database. Get the newest meta data from DWD.

weatherdb update-meta [OPTIONS]

update-raw

Update the raw data of the complete database.

weatherdb update-raw [OPTIONS]

Options

-u, --period_until <period_until>

The until timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-f, --period_from <period_from>

The from timestamp of the period to apply the method on. Timestamp should be in the format YYYY-MM-DD.

-i, --stid <stid>

The station IDs to apply the method to. Options are ‘all’ or a specific station ID. You can enter multiple values to add multiple station IDs.

Default:

'all'

-p, --para <para>

The parameters to work with. Options are ‘p’, ‘t’ and ‘et’. You can enter multiple values to add multiple parameters.

Default:

'p', 't', 'et'

update-richter-class

Update the Richter classes of the precipitation stations in the database.

weatherdb update-richter-class [OPTIONS]

upgrade-db-schema

Use Alembic directly to update or downgrade the database schema. Have a look at the official alembic documentation for more information.

weatherdb upgrade-db-schema [OPTIONS]

Options

-r, --revision <revision>

The revision ID (WeatherDB Version e.g. ‘V1.0.2’) to upgrade/downgrade to.

Default:

'head'