py-smn
A free and open source Python library for retrieving weather data from the National Meteorological Service of Argentina (SMN).
Note
This package offers two ways to obtain the requested data, the first is through the API of SMN and the second is by the public data offered by the official SMN website. I recommend you use the second option since it is more accurate and is updated every day.
Installation
From PyPI
pip install py-smn
From source code clone it
git clone https://github.com/manucabral/py-smn.git
cd py-smn
python -m pip install -r requirements.txt
Usage
Using static (recommended method)
import asyncio
import smn
async def main():
async with smn.Client() as client:
forecast_now = await client.get_static()
province, lat, lon = await client.get_location()
nearest_forecast = forecast_now.nearest(lat, lon)
print(nearest_forecast.weather['temp'])
if __name__ == '__main__':
asyncio.run(main())
Using API
import asyncio
import smn
async def main():
async with smn.Client() as client:
forecast_now = await client.get(forecast='now')
weather_stations = forecast_now.filter(province='Buenos Aires', name='La Plata')
for weather_station in weather_stations:
print(weather_station.name, weather_station.weather['temp'])
if __name__ == '__main__':
asyncio.run(main())
Constributions
All constributions, bug reports or fixes and ideas are welcome.
Metadata
Release files for py-smn 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py-smn-0.1.0.tar.gz | 6.7 kB | Without provenance | Details for py-smn-0.1.0.tar.gz |
Release files / py-smn-0.1.0.tar.gz
| Download URL | py-smn-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
310a3d513d39dcde0edfbeb920d4fa7e458a1f073dd7003951d80653609b016e
|
|
BLAKE2b-256 checksum How to use checksums |
958c4d01ab4d1c5a0f9a1e2452bc7b9a1422cbb614a1bcfe35804a2647e1ee6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for py-smn 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.