Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpmanson/google-weather
Python library to get weather from Google Search. No API keys required.
https://github.com/jpmanson/google-weather
Last synced: 27 days ago
JSON representation
Python library to get weather from Google Search. No API keys required.
- Host: GitHub
- URL: https://github.com/jpmanson/google-weather
- Owner: jpmanson
- Created: 2024-11-23T23:15:54.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-24T00:03:56.000Z (about 1 month ago)
- Last Synced: 2024-11-24T00:20:18.686Z (about 1 month ago)
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pygoogleweather
`pygoogleweather` is a Python library to get weather information from Google Search. No API keys required.
## Features
- Fetch current weather information for any city.
- Supports multiple languages.
- Convert temperature units between Celsius, Fahrenheit, and Kelvin.
- Get wind speed in km/h or mph.## Installation
You can install the library using pip:
```bash
pip install pygoogleweather
```## Usage
```python
from google_weather.weather import get_current_weatherresult = get_current_weather('Buenos Aires')
print(result)
# {'temperature': '24.0°C', 'humidity': '72%', 'wind': '34 kmh', 'condition': 'Mayormente soleado', 'location': 'Buenos Aires, Cdad. Autónoma de Buenos Aires'}
```You can also specify the language, temperature unit, and wind unit:
```python
print(get_current_weather('Buenos Aires', lang='it', temp_unit='F', wind_unit='mph'))
# {'temperature': '75.2°F', 'humidity': '72%', 'wind': '21 mph', 'condition': 'Per lo più soleggiato', 'location': 'Buenos Aires, Città Autonoma di Buenos Aires'}print(get_current_weather('New York', lang='en'))
# {'temperature': '37.4°F', 'humidity': '40%', 'wind': '11 mph', 'condition': 'Mostly Cloudy', 'location': 'New York, NY'}
```