https://github.com/cuba-weather/cuba-weather-python
Application programming interface of the Cuba Weather project implemented in Python
https://github.com/cuba-weather/cuba-weather-python
cuba-weather python python-api python-package weather weather-api
Last synced: 3 months ago
JSON representation
Application programming interface of the Cuba Weather project implemented in Python
- Host: GitHub
- URL: https://github.com/cuba-weather/cuba-weather-python
- Owner: cuba-weather
- License: lgpl-3.0
- Created: 2019-12-27T17:40:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T08:05:19.000Z (about 4 years ago)
- Last Synced: 2024-07-30T20:38:14.842Z (11 months ago)
- Topics: cuba-weather, python, python-api, python-package, weather, weather-api
- Language: Python
- Homepage: https://cubaweather.app
- Size: 66.4 KB
- Stars: 16
- Watchers: 7
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- cuban-opensource - cuba-weather
README
# Cuba Weather Python
[](https://opensource.org/licenses/MIT)
Application programming interface of the Cuba Weather project implemented in Python.
Currently the weather information is obtained from the Cuban search engine [www.redcuba.cu](https://www.redcuba.cu).
## Install
```bash
pip install git+https://github.com/cuba-weather/cuba-weather-python
```You can also clone or download this repository and at the root of the project do:
```bash
python setup.py install
```## Usage
### CLI
```bash
usage: cuba-weather.py [-h] [-v] [-c] [-t] [-d] [-u] [-p] [-w] [-g] locationpositional arguments:
location location nameoptional arguments:
-h, --help show this help message and exit
-v, --version show program version
-c, --city-name show location city name
-t, --temperature show location temperature
-d, --timestamp show location timestamp
-u, --humidity show location humidity
-p, --pressure show location pressure
-w, --wind show location wind
-g, --general show location general information
```When just speciying the location and no other arguments, all the available information is displayed.
### Package
```python3
from cuba_weather import RCApiClientlocation_input = input()
api = RCApiClient()
weather = api.get(location_input, suggestion=True)
print(weather)
```