Example script now also looks for tcx files.

This commit is contained in:
Filip 2025-03-16 14:46:04 +01:00
parent 169b7c8db8
commit 0206867af5

View file

@ -1,12 +1,19 @@
from analyze_sport_data import heart_rate_dataframe
from analyze_sport_data.file_records import from_fit_file
from analyze_sport_data.file_records import from_fit_file, from_tcx_file
from matplotlib.pyplot import show
from os import scandir
data = [
fit_data = [
from_fit_file(file.path, file.name) for file in scandir(".")
if file.name.endswith(".fit") and file.is_file()
if file.name.lower().endswith(".fit") and file.is_file()
]
tcx_data = [
from_tcx_file(file.path, file.name) for file in scandir(".")
if file.name.lower().endswith(".tcx") and file.is_file()
]
data = fit_data + tcx_data
heart_rate_dataframe(data).plot()
show()