Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esadek/taranis
Python API wrapper for weather-api
https://github.com/esadek/taranis
api-wrapper python weather-api
Last synced: 24 days ago
JSON representation
Python API wrapper for weather-api
- Host: GitHub
- URL: https://github.com/esadek/taranis
- Owner: esadek
- License: mit
- Created: 2021-08-09T04:43:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-10T20:36:04.000Z (over 3 years ago)
- Last Synced: 2025-01-07T17:51:15.072Z (25 days ago)
- Topics: api-wrapper, python, weather-api
- Language: Python
- Homepage: https://pypi.org/project/taranis/
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Taranis
[![Version](https://img.shields.io/pypi/v/taranis)](https://pypi.org/project/taranis/)
[![Build](https://img.shields.io/github/workflow/status/esadek/taranis/CI)](https://github.com/esadek/taranis/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/esadek/taranis)](https://github.com/esadek/taranis/blob/main/LICENSE)Taranis is a Python API wrapper for [weather-api](https://github.com/robertoduessmann/weather-api). It provides quick and easy retrieval of weather data for a given city.
## Installation:
Install and update using [pip](https://pip.pypa.io/en/stable/getting-started/):
```
pip install -U taranis
```## Usage:
Import the module:
```python
>>> import taranis
```Then call any of the below functions:
```python
>>> taranis.get_weather('San Francisco')
{'temperature': '+15 °C', 'wind': '24 km/h', 'description': 'Partly cloudy', 'forecast': [{'day': '1', 'temperature': '20 °C', 'wind': '18 km/h'}, {'day': '2', 'temperature': '16 °C', 'wind': '22 km/h'}, {'day': '3', 'temperature': '17 °C', 'wind': '12 km/h'}]}
``````python
>>> taranis.get_temperature('San Francisco')
'+15 °C'
``````python
>>> taranis.get_wind('San Francisco')
'24 km/h'
``````python
>>> taranis.get_description('San Francisco')
'Partly cloudy'
``````python
>>> taranis.get_forecast('San Francisco')
[{'day': '1', 'temperature': '20 °C', 'wind': '18 km/h'}, {'day': '2', 'temperature': '16 °C', 'wind': '22 km/h'}, {'day': '3', 'temperature': '17 °C', 'wind': '12 km/h'}]
```