rowingdata 3.6.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. rowingdata/__init__.py +2 -0
  2. rowingdata/__main__.py +2 -0
  3. rowingdata/boatedit.py +15 -0
  4. rowingdata/checkdatafiles.py +216 -0
  5. rowingdata/copystats.py +22 -0
  6. rowingdata/crewnerdplot.py +37 -0
  7. rowingdata/crewnerdplottime.py +37 -0
  8. rowingdata/csvparsers.py +3114 -0
  9. rowingdata/ergdataplot.py +31 -0
  10. rowingdata/ergdataplottime.py +31 -0
  11. rowingdata/ergdatatotcx.py +32 -0
  12. rowingdata/ergstickplot.py +31 -0
  13. rowingdata/ergstickplottime.py +32 -0
  14. rowingdata/ergsticktotcx.py +32 -0
  15. rowingdata/example.csv +5171 -0
  16. rowingdata/gpxtools.py +70 -0
  17. rowingdata/gpxwrite.py +151 -0
  18. rowingdata/konkatenaadje.py +19 -0
  19. rowingdata/laptesting.py +293 -0
  20. rowingdata/obsolete.py +654 -0
  21. rowingdata/otherparsers.py +718 -0
  22. rowingdata/painsled_desktop_plot.py +30 -0
  23. rowingdata/painsled_desktop_plottime.py +29 -0
  24. rowingdata/painsled_desktop_toc2.py +30 -0
  25. rowingdata/painsledplot.py +27 -0
  26. rowingdata/painsledplottime.py +27 -0
  27. rowingdata/painsledtoc2.py +23 -0
  28. rowingdata/roweredit.py +15 -0
  29. rowingdata/rowingdata.py +6941 -0
  30. rowingdata/rowproplot.py +31 -0
  31. rowingdata/rowproplottime.py +31 -0
  32. rowingdata/speedcoachplot.py +31 -0
  33. rowingdata/speedcoachplottime.py +31 -0
  34. rowingdata/speedcoachtoc2.py +36 -0
  35. rowingdata/tcxplot.py +38 -0
  36. rowingdata/tcxplot_nogeo.py +38 -0
  37. rowingdata/tcxplottime.py +33 -0
  38. rowingdata/tcxplottime_nogeo.py +33 -0
  39. rowingdata/tcxtoc2.py +30 -0
  40. rowingdata/tcxtools.py +417 -0
  41. rowingdata/trainingparser.py +302 -0
  42. rowingdata/utils.py +135 -0
  43. rowingdata/windcorrected.py +48 -0
  44. rowingdata/writetcx.py +312 -0
  45. rowingdata-3.6.8.dist-info/LICENSE +21 -0
  46. rowingdata-3.6.8.dist-info/METADATA +1149 -0
  47. rowingdata-3.6.8.dist-info/RECORD +49 -0
  48. rowingdata-3.6.8.dist-info/WHEEL +5 -0
  49. rowingdata-3.6.8.dist-info/top_level.txt +1 -0
rowingdata/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ from .rowingdata import *
2
+
rowingdata/__main__.py ADDED
@@ -0,0 +1,2 @@
1
+ from .rowingdata import main
2
+ main()
rowingdata/boatedit.py ADDED
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/python
2
+ from __future__ import absolute_import
3
+ from __future__ import print_function
4
+ from . import rowingdata
5
+ from sys import argv
6
+
7
+ def main():
8
+ try:
9
+ boatFile=argv[1]
10
+ except IndexError:
11
+ boatFile="my1x.txt"
12
+
13
+ print((rowingdata.boatedit(boatFile)))
14
+
15
+ print("done")
@@ -0,0 +1,216 @@
1
+ from __future__ import absolute_import
2
+ from __future__ import print_function
3
+ import polars as pl
4
+
5
+ try:
6
+ from . import rowingdata
7
+ except (ValueError,ImportError):
8
+ import rowingdata
9
+
10
+ import os
11
+
12
+ def checkfile(f2, verbose=False):
13
+ fileformat = rowingdata.get_file_type(f2)
14
+ summary = 'a'
15
+ notread = 1
16
+ if verbose:
17
+ print(fileformat)
18
+
19
+ if len(fileformat) == 3 and fileformat[0] == 'zip':
20
+ with zipfile.ZipFile(f2) as z:
21
+ f = z.extract(z.namelist()[0], path='C:/Downloads')
22
+ fileformat = fileformat[2]
23
+ os.remove(f_to_be_deleted)
24
+
25
+ if fileformat == 'unknown':
26
+ return 0
27
+
28
+ # handle non-Painsled
29
+ if (fileformat != 'csv'):
30
+ # handle RowPro:
31
+ if (fileformat == 'rp'):
32
+ row = rowingdata.RowProParser(f2)
33
+ # handle TCX
34
+ if (fileformat == 'tcx'):
35
+ row = rowingdata.TCXParser(f2)
36
+ row.write_csv(f2 + 'o.csv')
37
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
38
+ os.remove(f2 + 'o.csv')
39
+ notread = 0
40
+
41
+ # handle Mystery
42
+ if (fileformat == 'mystery'):
43
+ row = rowingdata.MysteryParser(f2)
44
+
45
+ # handle Quiske
46
+ if (fileformat == 'quiske'):
47
+ row = rowingdata.QuiskeParser(f2)
48
+
49
+ # handle RitmoTime
50
+ if (fileformat == 'ritmotime'):
51
+ row = rowingdata.RitmoTimeParser(f2)
52
+
53
+ # handle TCX no HR
54
+ if (fileformat == 'tcxnohr'):
55
+ row = rowingdata.TCXParserNoHR(f2)
56
+ row.write_csv(f2 + 'o.csv')
57
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
58
+ os.remove(f2 + 'o.csv')
59
+ notread = 0
60
+
61
+ # handle ErgData
62
+ if (fileformat == 'ergdata'):
63
+ row = rowingdata.ErgDataParser(f2)
64
+
65
+ # handle CoxMate
66
+ if (fileformat == 'coxmate'):
67
+ row = rowingdata.CoxMateParser(f2)
68
+
69
+ # handle BoatCoachOTW
70
+ if (fileformat == 'boatcoachotw'):
71
+ row = rowingdata.BoatCoachOTWParser(f2)
72
+
73
+ # handle BoatCoach
74
+ if (fileformat == 'boatcoach'):
75
+ row = rowingdata.BoatCoachParser(f2)
76
+
77
+ # handle painsled desktop
78
+ if (fileformat == 'painsleddesktop'):
79
+ row = rowingdata.painsledDesktopParser(f2)
80
+
81
+ # handle speed coach GPS
82
+ if (fileformat == 'speedcoach'):
83
+ row = rowingdata.speedcoachParser(f2)
84
+
85
+ # handle speed coach GPS 2
86
+ if (fileformat == 'speedcoach2'):
87
+ row = rowingdata.SpeedCoach2Parser(f2)
88
+ summary = row.allstats()
89
+ v = rowingdata.get_empower_firmware(f2)
90
+ rig = rowingdata.get_empower_rigging(f2)
91
+
92
+ if (fileformat == 'rowperfect3'):
93
+ row = rowingdata.RowPerfectParser(f2)
94
+
95
+ # handle ErgStick
96
+ if (fileformat == 'ergstick'):
97
+ row = rowingdata.ErgStickParser(f2)
98
+
99
+ # handle Kinomap
100
+ if (fileformat == 'kinomap'):
101
+ row = rowingdata.KinoMapParser(f2)
102
+
103
+
104
+ if (fileformat == 'eth'):
105
+ row = rowingdata.ETHParser(f2)
106
+
107
+ if (fileformat == 'hero'):
108
+ row = rowingdata.HeroParser(f2)
109
+
110
+ # handle FIT
111
+ if (fileformat == 'fit'):
112
+ row = rowingdata.FITParser(f2)
113
+ row.write_csv(f2 + 'o.csv')
114
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
115
+ os.remove(f2 + 'o.csv')
116
+ notread = 0
117
+
118
+ # handle Humon
119
+ if (fileformat == 'humon'):
120
+ row = rowingdata.HumonParser(f2)
121
+ row.write_csv(f2 + 'o.csv')
122
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
123
+ os.remove(f2 + 'o.csv')
124
+ notread = 0
125
+
126
+ # handle nklinklogbook
127
+ if (fileformat == 'nklinklogbook'):
128
+ row = rowingdata.NKLiNKLogbookParser(f2)
129
+ row.write_csv(f2 + 'o.csv')
130
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
131
+ os.remove(f2 + 'o.csv')
132
+ notread = 0
133
+
134
+ # handle smartrow
135
+ if (fileformat == 'smartrow'):
136
+ row = rowingdata.SmartRowParser(f2)
137
+ row.write_csv(f2 + 'o.csv')
138
+ row = rowingdata.rowingdata(csvfile=f2 + 'o.csv')
139
+ os.remove(f2 + 'o.csv')
140
+ notread = 0
141
+
142
+
143
+ # handle workout log (no stroke data)
144
+ if (fileformat == 'c2log'):
145
+ return 0
146
+
147
+
148
+
149
+ if notread:
150
+ row = rowingdata.rowingdata(df=row.df)
151
+
152
+ else:
153
+ row = rowingdata.rowingdata(csvfile=f2)
154
+
155
+ row.write_csv(f2+'pl.csv')
156
+ row2 = rowingdata.rowingdata_pl(csvfile=f2 + 'pl.csv')
157
+ os.remove(f2 + 'pl.csv')
158
+ row2 = rowingdata.rowingdata_pl(df=pl.from_pandas(row.df))
159
+
160
+ nr_of_rows = row.number_of_rows
161
+ distmax = row.df['cum_dist'].max()
162
+ timemax = row.df['TimeStamp (sec)'].max() - row.df['TimeStamp (sec)'].min()
163
+ nrintervals = len(row.df[' lapIdx'].unique())
164
+ mintime = row.df['TimeStamp (sec)'].min()
165
+ maxtime = row.df['TimeStamp (sec)'].max()
166
+ if verbose:
167
+ print(("nr lines", row.number_of_rows))
168
+ print(("data ", row.rowdatetime))
169
+ print(("dist ", distmax))
170
+ print(("Time ", timemax))
171
+ print(("Nr intervals ", nrintervals))
172
+ print(("Min time ",mintime))
173
+ print(("Max time ",maxtime))
174
+
175
+ res = row.intervalstats_values()
176
+ int1time = res[0][0]
177
+ int1dist = res[1][0]
178
+
179
+ # alternative
180
+ summary_df = row.summarize_rowing_data()
181
+ int1time_new = summary_df['lap_duration'].values[0]
182
+ int1dst_new = summary_df['total_distance_per_lap'].values[0]
183
+
184
+ if verbose:
185
+ print(("Interval 1 time ", int1time))
186
+ print(("Interval 1 dist ", int1dist))
187
+
188
+ y = row.rowdatetime.year
189
+ m = row.rowdatetime.month
190
+ d = row.rowdatetime.day
191
+ h = row.rowdatetime.hour
192
+ tz = row.rowdatetime.tzname()
193
+ minute = row.rowdatetime.minute
194
+ sec = row.rowdatetime.second
195
+
196
+ results = {
197
+ 'type': fileformat,
198
+ 'nr_lines': nr_of_rows,
199
+ 'year': y,
200
+ 'month': m,
201
+ 'day': d,
202
+ 'hour': h,
203
+ 'minute': minute,
204
+ 'second': sec,
205
+ 'dist': int(distmax),
206
+ 'seconds': int(timemax),
207
+ 'nrintervals': nrintervals,
208
+ 'lap 1 time': int(int1time),
209
+ 'lap 1 dist': int(int1dist),
210
+ 'lap 1 time new': int(int1time_new),
211
+ 'lap 1 dist new': int(int1dst_new),
212
+ 'timezone': tz,
213
+ 'summary':summary,
214
+ }
215
+
216
+ return results
@@ -0,0 +1,22 @@
1
+ #! /usr/bin/python
2
+ from __future__ import absolute_import
3
+ from . import rowingdata
4
+ from sys import argv
5
+
6
+
7
+ def main():
8
+ readFile=argv[1]
9
+
10
+ try:
11
+ rowerFile=argv[2]
12
+ except IndexError:
13
+ rowerFile="defaultrower.txt"
14
+
15
+ rower=rowingdata.getrower(rowerFile)
16
+
17
+ row=rowingdata.rowingdata(readFile,rowtype="Indoor Rower",
18
+ rower=rower)
19
+
20
+ rowingdata.copytocb(row.allstats())
21
+
22
+
@@ -0,0 +1,37 @@
1
+ #! /usr/bin/python
2
+ from __future__ import absolute_import
3
+ from __future__ import print_function
4
+ from . import rowingdata
5
+ from sys import argv
6
+
7
+ def main():
8
+ readFile=argv[1]
9
+
10
+ try:
11
+ rowerFile=argv[2]
12
+ except IndexError:
13
+ rowerFile="defaultrower.txt"
14
+
15
+ rower=rowingdata.getrower(rowerFile)
16
+
17
+ tcxFile=readFile+".TCX"
18
+ csvsummary=readFile+".CSV"
19
+ csvoutput=readFile+"_o.CSV"
20
+
21
+ tcx=rowingdata.TCXParser(tcxFile)
22
+ tcx.write_csv(csvoutput,window_size=10)
23
+
24
+ res=rowingdata.rowingdata(open(csvoutput),rowtype="On-water",
25
+ rower=rower)
26
+
27
+ res.plotmeters_otw()
28
+
29
+ sumdata=rowingdata.summarydata(csvsummary)
30
+ sumdata.shortstats()
31
+
32
+ sumdata.allstats()
33
+
34
+
35
+
36
+
37
+ print(("done "+readFile))
@@ -0,0 +1,37 @@
1
+ #! /usr/bin/python
2
+ from __future__ import absolute_import
3
+ from __future__ import print_function
4
+ from . import rowingdata
5
+ from sys import argv
6
+
7
+ def main():
8
+ readFile=argv[1]
9
+
10
+ try:
11
+ rowerFile=argv[2]
12
+ except IndexError:
13
+ rowerFile="defaultrower.txt"
14
+
15
+ rower=rowingdata.getrower(rowerFile)
16
+
17
+ tcxFile=readFile+".TCX"
18
+ csvsummary=readFile+".CSV"
19
+ csvoutput=readFile+"_o.CSV"
20
+
21
+ tcx=rowingdata.TCXParser(tcxFile)
22
+ tcx.write_csv(csvoutput,window_size=20)
23
+
24
+ res=rowingdata.rowingdata(csvoutput,rowtype="On-water",
25
+ rower=rower)
26
+
27
+ res.plottime_otw()
28
+
29
+ sumdata=rowingdata.summarydata(csvsummary)
30
+ sumdata.shortstats()
31
+
32
+ rowingdata.copytocb(sumdata.allstats())
33
+
34
+
35
+
36
+
37
+ print(("done "+readFile))