Skip to main content

Python Energy Data Analysis Utilities

Project description

pyedautils

Python Energy Data Analysis Utilities

CI - Test Coverage PyPI Latest Release PyPI Downloads

What is it?

pyedautils is a Python package tailored for analyzing and visualizing comfort and energy time series data. It offers a comprehensive suite of utility functions, simplifying the complexities inherent in data analysis and visualization.

Installation

The package is available on PyPi.org and can be installed with:

pip install pyedautils

Functions

geopy.py

Helper funtions to find the coordinates from an address, convert lat/long values to swiss WGS84 coordinates and get the altitude from coordinates.

get_lat_long()

Returns latitude and longitude coordinates for the given address.

from pyedautils.geopy import get_lat_long

get_lat_long("Technikumstrasse 21, 6048 Horw, Switzerland")

# Out: [47.0143233, 8.305245521466286]

get_altitude_lat_long()

Returns altitude in meters above sea level for the given WGS84 coordinates. The opentopodata.org api gets used.

from pyedautils.geopy import get_altitude_lat_long

get_altitude_lat_long(47.0132975, 8.3059169)

# Out: 444.9

convert_wsg84_to_lv95()

Converts WGS84 latitude and longitude coordinates to Swiss coordinate system LV95.

from pyedautils.geopy import convert_wsg84_to_lv95

convert_wsg84_to_lv95(47.0132975, 8.3059169)

# Out: [2665945.104007165, 1207280.4252477456]

get_altitude_lv95()

Returns altitude in meters above sea level for the given LV95 coordinates. The geo.admin.ch api gets used.

from pyedautils.geopy import get_altitude_lv95

get_altitude_lv95([2665960.531, 1207281.985])

# Out: 442.6

get_coordindates_ch_plz()

Returns latitude and longitude for a Swiss postal code.

from pyedautils.geopy import get_coordindates_ch_plz

get_coordindates_ch_plz(6048)

Out: (47.0108, 8.3039)

get_distance_between_two_points()

Calculates the distance in km between two points on the Earth's surface given their latitude and longitude coordinates.

from pyedautils.geopy import get_coordindates_ch_plz, get_distance_between_two_points

coord1 = get_coordindates_ch_plz(6048) # Horw
coord2 = get_coordindates_ch_plz(3800) # Interlaken

get_distance_between_two_points(coord1, coord2)

#Out: 50.301

meteo_swiss.py

find_nearest_station()

Returns station id of closest meteo swiss station to a coordinate.

from pyedautils.meteo_swiss import find_nearest_station
from pyedautils.geopy import get_coordindates_ch_plz, get_altitude_lat_long

coord = get_coordindates_ch_plz(6197)
altitude = get_altitude_lat_long(coord[0], coord[1])

find_nearest_station(coord[0], coord[1], altitude, sensor="temp")

Out: "FLU"

season.py

get_season()

Get the season name out of a date for filter and grouping purposes.

from pyedautils.season import get_season
from datetime import datetime

get_season(datetime(2024,5,5))

#Out: 'Spring'

Default language of the returned strings is English. You can change that by passing the argument labels:

get_season(datetime(2024,5,5), labels=["Frühling", "Sommer", "Herbst", "Winter"])

#Out: 'Frühling'

Disclaimer
The author declines any liability or responsibility in connection with the published code and documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyedautils-0.0.7.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

pyedautils-0.0.7-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page