Easy access to geographic, meteorologic and photovoltaic performance data/services.
Project description
The 'Daaayonearth' library contains three classes: Location, TimeZone and EnvConditions. These provide easy access to geographical, meteorological and photovoltaic performance data/services, namely:
-
the (latitude, longitude) tuple belonging to a specific address / location string (geocoding)
-
the timezone belonging to a specific location (at a given date)
-
the typical environmental conditions belonging to a day at a specific location & date, including:
-
air temperature
-
air pressure
-
air humidity
-
wind speed
-
wind direction
-
sun height
-
solar irradiance
-
maximal photovoltaic performance
For each of said parameters there is a function as well as a belonging plot available, which provide the course of said parameter over the chosen day.
Examples
#import from daaayonearth
import daaayonearth
from daaayonearth import Location, TimeZone, EnvConditions
#import from standard library
from datetime import datetime as Datetime
from datetime import date as Date
#set application name
daaayonearth.UserAgentNameS = "DaaayExampleApp"
#get (latitude, longitude) tuple from address string
deu = Location( "Willy-Brandt-Str., 10557 Berlin" ) # ==> (52.5202262, 13.3704874)
#get timezone (Python tzfile) belonging to location
tzDeu = TimeZone( deu ) # ==> tzfile('Europe/Berlin')
#convert a date to another timezone
date = Datetime(2021, 11, 1, 20, 40, 0, tzinfo=tzDeu) # ==> 2021-11-01 20:40:00+01:00
date.astimezone( TimeZone("Pennsylvania Ave. NW, Washington, DC 20020, USA") ) # ==> 2021-11-01 15:40:00-04:00
#get the typical temperature at 12 o'clock
#in the Willy Brandt Street, Berlin - on the 2th of November (year is ignored)
envConds = EnvConditions( Location("Willy-Brandt-Str., 10557 Berlin"), Date(2021, 11, 2) )
envConds.functionsD["T(2m) [°C]"](12 * 3600) # ==> 5.03
#get a matplotlib figure of the belonging course of temperature for said location/day
envConds.getFigureOf( "T(2m) [°C]" ) # ==> plot (course of temperature)
#get the list of available parameters (for envConds.functionsD[...] and envConds.getFigureOf(...))
list( envConds.functionsD.keys() ) # ==> [ 'T(2m) [°C]', 'Humidity [%]', 'Irradiance [W/m^2]',
# 'WindSpeed(10m) [m/s]', 'WindDirection(10m) [°]',
# 'Pressure(0m) [Pa]', 'PvPower [W]', 'SunHeight [°]' ]
If you use this library you might ('under the hood') use data and/or services connected with 'OpenStreetMap', 'Nominatim' and/or 'PVGIS' - please find more informations concerning this topic in the LICENSE text!
Further infomations and links also can be found on my homepage https://www.blackward.de
Have Fun!
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 Distributions
Built Distribution
Hashes for daaayonearth-0.70-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 790d114dca88b79414a0e91f886a53c2d5633be4d4cb13a45cfa84e1fb1b05e0 |
|
MD5 | 8778b4e33a1abccf3080f1dafb5977c8 |
|
BLAKE2b-256 | 2d3aade30f281906c32db56660e36e2c8fa1e3b5da0350087979d4a2578b0dd4 |