Tells if, and how hard, it's raining at any location in Singapore
Project description
sgrain
Tells if it's currently raining at a given latitude and longitude in Singapore. The data comes from rain radar images at https://www.weather.gov.sg/weather-rain-area-50km/. The image is updated every 5 minutes.
Link to project: https://github.com/nlannuzel/sgrain
Package installation
From Github:
pip install git+https://github.com/nlannuzel/sgrain
... or from Pypi:
pip install nlannuzel.sgrain
Package usage
For example:
#!/usr/bin/env python3
from nlannuzel.sgrain.rain import RainAreas
from nlannuzel.sgrain.geo import Location
rain = RainAreas()
# Download the latest radar image from https://www.weather.gov.sg/weather-rain-area-50km/
rain.load_image()
# https://maps.app.goo.gl/9aA7i8chryYwuhUT8
picnic_spot = Location(1.313383, 103.815203)
# Returns a number from 0 to 31
intensity = rain.intensity_at(picnic_spot)
message = f"At location {picnic_spot}, time {rain.rounded_dt}: "
if intensity == 0:
message += "it's not raining."
elif intensity < 10:
msg += "it's raining a little bit ({intensity}), bring a umbrella."
else:
msg += "it's raining a lot ({intensity}), cancel the picnic."
print(message)
One liner: python -m
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nlannuzel_sgrain-1.0.0.tar.gz.
File metadata
- Download URL: nlannuzel_sgrain-1.0.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be19517159584b09f4e6a96f9e0ed765366af0eaca36d639c117ebaa3fefaf34
|
|
| MD5 |
5f195cf3ae53d464a7a1588f8038d640
|
|
| BLAKE2b-256 |
284a95e8b112e86e2ffbb6685d30542b4d656b362dc07c9226242063ebc72695
|
File details
Details for the file nlannuzel_sgrain-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nlannuzel_sgrain-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a0aade7ab8bbd547779cc8f664d3cecb8207d3036222be863eae026513abcbf
|
|
| MD5 |
1135a3103d69026ac6aa7b4ac8e5d91e
|
|
| BLAKE2b-256 |
871d48dd097c1384893f0e248ff676e3ebbbaf64700ff3329d1502fd3156d4f9
|