Package: pymeteoclimatic
PyMeteoclimaticA Python wrapper around the Meteoclimatic service.PyMeteoclimatic is a client Python wrapper library forMeteoclimatic. Meteoclimatic is a large network of non-professional automatic real-time weather stations and an important directory of weather resources. The geographical scope of Meteoclimatic comprises the Iberian Peninsula, the two Spanish archipelagos (the Balearic Islands and the Canary Islands), southern France and Africa near the Strait of Gibraltar.PyMeteoclimatic relies on theMeteoclimatic RSS feed. More specifically, PyMeteoclimatic leverages the coded, normalized data blocks included as HTML comments in the feeds between the[[<BEGIN:identificador:DATA>]]and[[<END:identificador:DATA>]]tags to obtain station weather information.What data can I get?With PyMeteoclimatic you can obtain weather information directly from Meteoclimatic stations identified by their code. You can find out the station code from the station profile page in the Meteoclimatic site.When obtaining the weather information from a station, you will get ameteoclimatic.Observationobject, which represents the weather which is currently being observed from a certain station and contains the following fields.FieldTypeDescriptionreception_timedatetime.datetimeTimestamp telling when the weather obervation has been received from the stationstationmeteoclimatic.StationTheStationrelative to this observationweathermeteoclimatic.WeatherTheWeatherrelative to this observationAmeteoclimatic.Stationobject contains the following data.FieldTypeDescriptionnamestrName of the stationcodestrMeteoclimatic code of the station (e.g. "ESCAT4300000043206B")urlstrURL of the Meteoclimatic station pageAmeteoclimatic.Weatherobject contains the following data. Note that not all stations have the same physical sensors and capabilities (e.g. pluviometer, barometer, ...), therefore, some of these values may beNonefor some stations. Check the Meteoclimatic station page for more information on your preferred station capabilities.FieldTypeDescriptionreference_timedatetime.datetimeTimestamp of weather measurementconditionmeteoclimatic.ConditionorstrSingle-word weather condition (e.g. "sun", "suncloud", "rain", ...). If it's a recognized condition, it will be mapped to a value of themeteoclimatic.Conditionenumerate, otherwise it will be stored as a stringtemp_currentfloatCurrent temperature in Celsiustemp_maxfloatMaximum temperature in Celsius for the past 24 hourstemp_minfloatMinimum temperature in Celsius for the past 24 hourshumidity_currentfloatCurrent humidity in percentage pointshumidity_maxfloatMaximum humidity in percentage points for the past 24 hourshumidity_minfloatMinimum humidity in percentage points for the past 24 hourspressure_currentfloatCurrent atmospheric pressure in hPa unitspressure_maxfloatMaximum atmospheric pressure in hPa units for the past 24 hourspressure_minfloatMinimum atmospheric pressure in hPa units for the past 24 hourswind_currentfloatCurrent wind speed in km/h unitswind_maxfloatMaximum wind speed in km/h units for the past 24 hourswind_bearingfloatWind bearing in degree unitsrainfloatPrecipitation in mm units for the past 24 hoursInstallationInstall withpipfor your ease.$ pip install pymeteoclimaticExamplefrommeteoclimaticimportMeteoclimaticClientclient=MeteoclimaticClient()observation=client.weather_at_station("ESCAT4300000043206B")print("Timestamp")print("~~~~~~~~~")print(observation.reception_time)print()print("Station")print("~~~~~~~")print(observation.station)print()print("Weather")print("~~~~~~~")print(observation.weather)Output:Timestamp
~~~~~~~~~
2020-06-09 13:45:55+00:00

Station
~~~~~~~
<class 'meteoclimatic.station.Station'>({'name': 'Reus - Nord (Tarragona)', 'code': 'ESCAT4300000043206B', 'url': 'http://www.meteoclimatic.net/perfil/ESCAT4300000043206B'})

Weather
~~~~~~~
<class 'meteoclimatic.weather.Weather'>({'reference_time': datetime.datetime(2020, 6, 9, 13, 45, 55, tzinfo=datetime.timezone.utc), 'condition': <Condition.sun: 'sun'>, 'temp_current': 24.0, 'temp_max': 24.2, 'temp_min': 13.7, 'humidity_current': 45.0, 'humidity_max': 80.0, 'humidity_min': 44.0, 'pressure_current': 1013.5, 'pressure_max': 1015.3, 'pressure_min': 1013.5, 'wind_current': 13.0, 'wind_max': 31.0, 'wind_bearing': 232.0, 'rain': 0.2})ContributingPlease feel free to submit issues or fork the repository and send pull requests to update the library and fix bugs, implement support for new sentence types, refactor code, etc.LicenseMIT License