Skip to main content

A small weather package using Open-Meteo

Project description

PyOMWeather

Build Status

A python module to fetch weather data from Open-Meteo

Installation

PyOMWeather is available on PyPi :

Install the package using pip:

pip install  PyOmWeather

Usage

PyOMWeather is meant to be used in your own Python programs. The PyOMWeather.weather module contains a class called Weather that contains functions that can access data from OpenMeteo's API for your Python programs. To do this, you can import Weather and create a weather instance.

from PyOMWeather.weather import Weather

weather_instance = Weather()

The weather class contains four methods that can access different data from OpenMeteo's API

get_temperature(location_string)

Retrieves the hourly temperature data.

Arguments:

  • location_string: A string representing the location.

Returns:

  • A pandas DataFrame with two columns: 'date' and 'values' for temperatures.

get_apparent_temperature(location_string)

Retrieves the hourly apparent temperature data.

Arguments:

  • location_string: A string representing the location.

Returns:

  • A pandas DataFrame with hourly apparent temperature data.

get_relative_humidity(location_string)

Retrieves the hourly relative humidity data.

Arguments:

  • location_string: A string representing the location.

Returns:

  • A pandas DataFrame with hourly relative humidity data.

get_rain_probability(location_string)

Retrieves the hourly rain probability data.

Arguments:

  • location_string: A string representing the location.

Returns:

  • A pandas DataFrame with hourly precipitation probability data.

An example Python program that uses each of the functions and prints the fetched data is provided here

Contributing

If you want to contribute to PyOMWeather, follow these steps to set up your development environment:

  1. Fork the Project: Create your own fork of the project to work on. This will allow you to make changes to your own copy of the project.
  2. Clone your fork: Clone your fork to your local machine.
git clone https://github.com/your-username/3-python-package-exercise-team1-pt3.git 
cd 3-python-package-exercise-team1-pt3 
  1. Set up your Virtual Environment: It's recommended to use a virtual environment to keep dependencies required by different projects separate. Create a virtual environment by running:
python -m venv venv 

Activate the virtual environment: On Windows:

.\venv\Scripts\activate 

On MacOS/Linux:

source venv/bin/activate 
  1. Install Dependencies: Install all required dependencies using the requirements.txt file
pip install -r requirements.txt 
  1. Make Your Changes: Make your changes to the codebase. Be sure to write or update tests as appropriate.
  2. Run the Tests: Before submitting your changes, make sure all tests pass:
pytest 
  1. Submit a Pull Request : Once you've made your changes, tested everything, and are happy with the result, push your changes to your fork and submit a pull request to the main repository. Don't forget to update the documentation if needed. Thank you for your contributions!

Authors

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

PyOMWeather-0.1.0.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

PyOMWeather-0.1.0-py3-none-any.whl (16.5 kB view hashes)

Uploaded Python 3

Supported by

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