Skip to main content

A secure, unified Python interface for African climate data, integrating TAHMO station data and gridded datasets (IMERG, CHIRPS, ERA5, TAMSAT), and medium-to-seasonal weather models

Project description

Documentation

You can find the documentation for the project by following this link
https://filter-stations.readthedocs.io/en/latest/

Getting Started

All methods require an API key and secret, which can be obtained by contacting dsail-info@dkut.ac.ke.

  • AuthManager: The new secure gateway. Log in once with your credentials to automatically unlock access to all downstream data loaders
  • RainLoader: class is used to get our DSAIL unified weather dataset from HuggingFace (See the documentation for more information on this)
  • MediumForecaster: Connects to the Google Weather API to pull 1-to-10 day forecasts (both hourly and daily)
  • SeasonalForecaster: Connects to Open-Meteo API to pull seasonal forecasts.
  • The RetrieveData class is used to retrieve data from the TAHMO API endpoints.
  • The Kieni class is used to get weather data for stations 100km around Kieni from the central point.with water level data.

Example

from filter_stations import AuthManager, MediumForecaster, RetrieveData, SeasonalForecaster

# 1. Authenticate once securely
auth = AuthManager(email="your_email@domain.com", password="your_password")

# 2. Initialize any tool you need seamlessly
weather = MediumForecaster(auth_session=auth)
tahmo = RetrieveData(auth_session=auth)
seasonal = SeasonalForecaster(auth_session=auth)

# 3. Pull your Medium Range weather forecast data 
nyeri_forecast = weather.get_weather_api_forecast(lat=-0.41, lon=36.95, days=7)

# Seasonal Forecasting Example

# 4. See what is available
print(seasonal.list_all_models())

# 5. Pull 6 months of ECMWF AIFS and Standard IFS data simultaneously
data = seasonal.get_forecast(
    lat=-0.41,
    lon=36.95,
    models=["ecmwf_seasonal_ensemble_mean_seamless"], 
    forecast_months=6,
    daily=['temperature_2m_max',
            'temperature_2m_mean',
            'temperature_2m_min',
            'precipitation_sum',
            'rain_sum',
            'pressure_msl_min',
            'pressure_msl_mean',
            'relative_humidity_2m_min',
            'relative_humidity_2m_mean',
            'relative_humidity_2m_max',
            'dew_point_2m_max',
            'dew_point_2m_mean',
            'dew_point_2m_min',
            'surface_pressure_min',
            'surface_pressure_mean',
            'surface_pressure_max',
            'cloud_cover_min',
            'cloud_cover_mean',
            'cloud_cover_max' ]
)

# 6. View the AIFS DataFrame (first model in the list)
aifs_df = data[0]["daily_df"]
print(aifs_df)

seasonal.list_api_variables()

To get started on the module test it out on Google Colab

Open In Colab

For earlier versions <= v0.6.2 use the link below for documentation

https://filter-stations.netlify.app/

Citations

If you use this package in your research, please cite it using the following BibTeX entry:

@misc{filter-stations,
  author = {Austin Kaburia},
  title = {filter-stations},
  year = {2024},
  publisher = {Python Package Index},
  journal = {PyPI},
  howpublished = {\url{https://pypi.org/project/filter-stations/}},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filter_stations-0.8.1.tar.gz (40.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filter_stations-0.8.1-py3-none-any.whl (28.0 MB view details)

Uploaded Python 3

File details

Details for the file filter_stations-0.8.1.tar.gz.

File metadata

  • Download URL: filter_stations-0.8.1.tar.gz
  • Upload date:
  • Size: 40.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for filter_stations-0.8.1.tar.gz
Algorithm Hash digest
SHA256 237935caa1d6ef3596b728deca1f8cae10e1ed221b2591a44684d2f6570132e5
MD5 dce6b934fa9fe6cfcb87f3b61042593d
BLAKE2b-256 5ff14e3d6325419633502a444167052fa40054eb9e2f171acd58ce18a1f8357d

See more details on using hashes here.

File details

Details for the file filter_stations-0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for filter_stations-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08d8f176b040c5f72a5ca36ea3f4af6f614334ad19c75cbfd71a0a04d9c1854e
MD5 a67417da3d8473a77f0f4065345d2d1c
BLAKE2b-256 b019a888c92393e338d86a0f6557bc46d14ff9e607461e524a85f59579dd1cb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page