Package: illumipy
illumipyis a Python module for estimating outside Illumination levels for given location, date and time.
Requires an OpenWeatherMapAPIkeyFeaturesProvides an estimation of outside brightness level based on weather and astronomical data, location, time and empirical model.Calculates a variety of solar parameters that can be used for prediction of solar irradiance and solar energy productionCan be adjustes for date, time, location, cloud coverage and many more.Can be used as imported Python module or accessed directly over CLI with a range of useful optionsUses the free OpenWeatherMap APIINSTALLATIONInstallation is easiest using a package manager likePIP. To install pip run:python-mensurepip--upgradeTo install illumipy with pip, run:pipinstallillumipySource files can be found onGitHub, in case you want to tell install manually.This package can be used via import function in Python or be run directly as a script with CLI options:Importimportillumipy# Create Illumination object using light_data() and pass optionsillumipy.data.light_data([OPTIONS])To use the module, simply import illumipy and call the function
data.light_data(): This returns a dictionary object with
the following information:['illuminance']: Outside Brightness in Lux['time']: Time used as %-H (e.g. 4 or ~~12)['date']: Date used as YYYY-MM-DD['city']: City Used['country']: Country Used['cloud_coverage']: Cloud coverage in %['et_illuminance']: Extraterrestrial Illuminance in Lux['direct_illuminance']: Direct Illuminance in Lux['horizontal_illuminance']: Horizontal Illuminance in Lux['horizontal_sky_illuminance']: Horizontal Sky Illuminance in Lux['sunrise']: Time of Sunrise as hh:mm['sunset']: Time of sunset as hh:mm['sun_altitude']: Sund altitude at [Time] in degrees.['day']: True if there is daylight at [Time].['clear_sky_index'] = Aproximation of Clear Sky Index based on cloud coverage['cs_irradiance'] = Estimated Clear Sky Irradiance in W/m^2 based on solar altitude.['irradiance'] = Estimated current Irradiance in W/m^2 based on solar altitude and cloud coverage.coverage.['air_mass'] = calculated air mass for given solar altitude, based on empirical model.['azimuth'] = Calculated solar azimuth for given time and location.['declination'] = calculated solar declination angle for given date.['LSTM'] = Local standard time meridian in degrees.['EOT'] = Equation of Time.It Takes the following arguments:time: str=[0-24]date: str=[YYYY-MM-DD]city: str=['City']country: str=['Country']api_key: str=['api_key']cloud_coverage: int=[0-100]if no arguments are provided, defaults to values defined in defaults.pyCommand lineTo use as script with CLI run <python -m illumipy>.
To get a list of available CLI options run <python-millumipy-h
>usage:__main__.py[-h][-tTIME][-dDATE][-cCITY][-CCOUNTRY][-aAPI][-oOUTPUT[OUTPUT...]][-D][-v][-A][-s]General-purposesolarbrightnesscalculator.

options:-h,--helpshowthishelpmessageandexit-tTIME,--timeTIMETimeofthedayinhours(0-24,e.g.4or12).Defaultstocurrenttimeifnotspecified.-dDATE,--dateDATEDateasYYYY-MM-DD(e.g.2023-06-01).Defaultstocurrentdateifnotspecified.-cCITY,--cityCITYCityname(e.g.Berlin).Defaultsto{CITY_DEFAULT}ifnotspecified.-CCOUNTRY,--CountryCOUNTRYCountryname(e.g.Germany).Defaultsto{COUNTRY_DEFAULT}ifnotspecified.-aAPI,--apiAPIOpeWeatherAPI-Key(required).Alternatively,adefaultAPIkeycanbedefinedinmain.py-oOUTPUT[OUTPUT...],--outputOUTPUT[OUTPUT...]Definetheparameterstobereturned.Defaultsto'Illuminance'ifnotspecified.Toseeavailablevaluestryillumipy[-o|--output]help-D,--debugPrintlotsofdebuggingstatements-v,--verboseBeverbose-A,--allPrintoutentiredataset.DefaultisjusttheIlluminanceinLux-s,--shortPrintonlyvalues,nodescriptionCurrent issuescloud level, sunrise and sunset are not available for dates in the past. Results might therefore be unreliable. Times for sunrise and sunset will always be for the current day.at 100% cloud coverage, Results might be unreliable.RequirementsPython3Python packages:requestsloggingmathsysdatetimeargparseOpenWeatherMap API-KeyAboutAuthor: Kalle ForniaGitHub:https://github.com/duckwilliam/illumipyPyPi:https://pypi.org/project/illumipyVersion: 1.3.1
10/2023