runtilities 2.1.7.dev1__tar.gz → 2.2.1.dev1__tar.gz
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.
- runtilities-2.2.1.dev1/PKG-INFO +47 -0
- runtilities-2.2.1.dev1/running/parseralogxml.py +61 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/runsignup.py +23 -1
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/version.py +1 -1
- runtilities-2.2.1.dev1/runtilities.egg-info/PKG-INFO +47 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/SOURCES.txt +1 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/entry_points.txt +1 -1
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/setup.py +2 -0
- runtilities-2.1.7.dev1/PKG-INFO +0 -33
- runtilities-2.1.7.dev1/runtilities.egg-info/PKG-INFO +0 -33
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/README.md +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/__init__.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/analyzeagegrade.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/athlinks.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/athlinksresults.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/comparegpx.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/competitor.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/competitor2csv.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/getweather.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/gpx2kml.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/parseresults.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/parserun-bk3.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/parsetcx.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/ra2membersfile.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/racewx-render.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/racewx.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/renderclubagstats.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/runningahead.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/runningaheadmembers.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/runningaheadparticipants.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/runningaheadresults.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/strava.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/textnormalize.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/ultrasignup.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/ultrasignupresults.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/xmldict.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/xmldict1.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/xmldict2.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/running/xmlreader.py +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/dependency_links.txt +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/not-zip-safe +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/requires.txt +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/runtilities.egg-info/top_level.txt +0 -0
- {runtilities-2.1.7.dev1 → runtilities-2.2.1.dev1}/setup.cfg +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: runtilities
|
|
3
|
+
Version: 2.2.1.dev1
|
|
4
|
+
Summary: running related scripts
|
|
5
|
+
Home-page: http://github.com/louking/running
|
|
6
|
+
Author: Lou King
|
|
7
|
+
Author-email: lking@pobox.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.6
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: requests>=2.22.0
|
|
15
|
+
Requires-Dist: requests_oauthlib>=1.3.0
|
|
16
|
+
Requires-Dist: loutilities>=3.3.0
|
|
17
|
+
Requires-Dist: tzlocal>=2.0.0
|
|
18
|
+
Requires-Dist: xlrd>=1.2.0
|
|
19
|
+
Requires-Dist: unicodecsv>=0.14.1
|
|
20
|
+
Requires-Dist: sqlalchemy>=1.3.12
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
runtilities - running utilities
|
|
32
|
+
===================================
|
|
33
|
+
|
|
34
|
+
This is a package with a few hopefully useful running utilities.
|
|
35
|
+
|
|
36
|
+
package name is "running". Yes I know that's confusing.
|
|
37
|
+
|
|
38
|
+
Install
|
|
39
|
+
|
|
40
|
+
pip install runtilities
|
|
41
|
+
|
|
42
|
+
Usage, e.g.
|
|
43
|
+
|
|
44
|
+
from running.runsignup import RunSignUp
|
|
45
|
+
|
|
46
|
+
A lot of this may be obsolete and hasn't been tested for a while,
|
|
47
|
+
so your mileage may vary. Sorry about that.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# standard
|
|
2
|
+
from argparse import ArgumentParser
|
|
3
|
+
from csv import DictWriter
|
|
4
|
+
from datetime import timedelta
|
|
5
|
+
|
|
6
|
+
# pypi
|
|
7
|
+
from loutilities.xmldict import ConvertXmlToDict
|
|
8
|
+
|
|
9
|
+
class ParameterError(Exception): pass
|
|
10
|
+
|
|
11
|
+
def dist2miles(distel):
|
|
12
|
+
dist = float(distel['_text'])
|
|
13
|
+
distunits = distel['unit']
|
|
14
|
+
if distunits == 'mi':
|
|
15
|
+
pass
|
|
16
|
+
elif distunits == 'km':
|
|
17
|
+
dist /= 1.609344
|
|
18
|
+
elif distunits == 'm':
|
|
19
|
+
dist /= 1609.344
|
|
20
|
+
else:
|
|
21
|
+
raise ParameterError(f'unexpected distance unit {distunits}')
|
|
22
|
+
|
|
23
|
+
return dist
|
|
24
|
+
|
|
25
|
+
def convertsecs(dur):
|
|
26
|
+
return str(timedelta(seconds = float(dur)))
|
|
27
|
+
|
|
28
|
+
def main():
|
|
29
|
+
parser = ArgumentParser()
|
|
30
|
+
parser.add_argument('-X', '--xmlfile', help='input xml file, from RunningAHEAD export', required=True)
|
|
31
|
+
parser.add_argument('-C', '--csvfile', help='output csv file', required=True)
|
|
32
|
+
args = parser.parse_args()
|
|
33
|
+
|
|
34
|
+
fieldnames = 'date,time,type,subtype,dist,duration,equipment,route,temp,notes'.split(',')
|
|
35
|
+
workouts = ConvertXmlToDict(args.xmlfile)
|
|
36
|
+
with open(args.csvfile, 'w', newline='') as oscsvfile:
|
|
37
|
+
csvfile = DictWriter(oscsvfile, fieldnames=fieldnames)
|
|
38
|
+
csvfile.writeheader()
|
|
39
|
+
for wo in workouts['RunningAHEADLog']['EventCollection']['Event']:
|
|
40
|
+
if wo['typeName'] not in ['Run', 'Bike', 'Walk']: continue
|
|
41
|
+
datetime = wo['time']
|
|
42
|
+
datetimesplit = datetime.split('T')
|
|
43
|
+
date = datetimesplit[0]
|
|
44
|
+
time = datetimesplit[1] if len(datetimesplit) == 2 else ''
|
|
45
|
+
time = time[:-1] if time and time[-1] == 'Z' else time
|
|
46
|
+
row = {
|
|
47
|
+
'date': date,
|
|
48
|
+
'time': time,
|
|
49
|
+
'type': wo['typeName'],
|
|
50
|
+
'subtype': wo['subtypeName'] if 'subtypeName' in wo else '',
|
|
51
|
+
'dist': dist2miles(wo['Distance']) if 'Distance' in wo else '',
|
|
52
|
+
'duration': convertsecs(wo['Duration']['seconds']) if 'Duration' in wo else '',
|
|
53
|
+
'equipment': wo['Equipment']['_text'] if 'Equipment' in wo else '',
|
|
54
|
+
'route': wo['Route']['_text'] if 'Route' in wo else '',
|
|
55
|
+
'temp': wo['EnvironmentalConditions']['Temperature']['_text'] if 'EnvironmentalConditions' in wo and 'Temperature' in wo['EnvironmentalConditions'] else '',
|
|
56
|
+
'notes': wo['Notes'] if 'Notes' in wo else '',
|
|
57
|
+
}
|
|
58
|
+
csvfile.writerow(row)
|
|
59
|
+
|
|
60
|
+
if __name__ == "__main__":
|
|
61
|
+
main()
|
|
@@ -56,6 +56,7 @@ logout_url = 'https://runsignup.com/rest/logout'
|
|
|
56
56
|
# methods
|
|
57
57
|
members_url = 'https://runsignup.com/rest/club/{club_id}/members'
|
|
58
58
|
getrace_url = 'https://runsignup.com/rest/race/{race_id}'
|
|
59
|
+
getracedivisions_url = 'https://runsignup.com/rest/race/{race_id}/divisions/divisions'
|
|
59
60
|
getresultsets_url = 'https://runsignup.com/rest/race/{race_id}/results/get-result-sets'
|
|
60
61
|
geteventresults_url = 'https://runsignup.com/rest/race/{race_id}/results/get-results'
|
|
61
62
|
|
|
@@ -246,6 +247,27 @@ class RunSignUp():
|
|
|
246
247
|
|
|
247
248
|
return events
|
|
248
249
|
|
|
250
|
+
def getracedivisions(self, race_id, event_id, **kwargs):
|
|
251
|
+
"""
|
|
252
|
+
return information about a specific race's divisions
|
|
253
|
+
uses get race divisions RSU method
|
|
254
|
+
does not require credentials (userpriv=True)
|
|
255
|
+
|
|
256
|
+
:param race_id: id of race
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
if self.debug:
|
|
260
|
+
current_app.logger.debug(f'getracedivisions({race_id}, {event_id})')
|
|
261
|
+
|
|
262
|
+
data = self._rsuget(
|
|
263
|
+
getracedivisions_url.format(race_id=race_id),
|
|
264
|
+
event_id=event_id,
|
|
265
|
+
**kwargs
|
|
266
|
+
)
|
|
267
|
+
racedivisions = data['race_divisions']
|
|
268
|
+
|
|
269
|
+
return racedivisions
|
|
270
|
+
|
|
249
271
|
def getresultsets(self, race_id, event_id, **kwargs):
|
|
250
272
|
"""
|
|
251
273
|
return result sets for race event
|
|
@@ -282,7 +304,7 @@ class RunSignUp():
|
|
|
282
304
|
current_app.logger.debug('getraceevents({})'.format(race_id))
|
|
283
305
|
|
|
284
306
|
# max number of results in results list is 100, so need to loop, collecting
|
|
285
|
-
# BITESIZE
|
|
307
|
+
# BITESIZE results at a time. These are all added to results list, and final
|
|
286
308
|
# list is returned to the caller
|
|
287
309
|
BITESIZE = 100
|
|
288
310
|
page = 1
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# this string is used for the version string in the documentation, as well as the egg
|
|
2
|
-
__version__ = '2.1.
|
|
2
|
+
__version__ = '2.2.1.dev1'
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: runtilities
|
|
3
|
+
Version: 2.2.1.dev1
|
|
4
|
+
Summary: running related scripts
|
|
5
|
+
Home-page: http://github.com/louking/running
|
|
6
|
+
Author: Lou King
|
|
7
|
+
Author-email: lking@pobox.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.6
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: requests>=2.22.0
|
|
15
|
+
Requires-Dist: requests_oauthlib>=1.3.0
|
|
16
|
+
Requires-Dist: loutilities>=3.3.0
|
|
17
|
+
Requires-Dist: tzlocal>=2.0.0
|
|
18
|
+
Requires-Dist: xlrd>=1.2.0
|
|
19
|
+
Requires-Dist: unicodecsv>=0.14.1
|
|
20
|
+
Requires-Dist: sqlalchemy>=1.3.12
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: home-page
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
runtilities - running utilities
|
|
32
|
+
===================================
|
|
33
|
+
|
|
34
|
+
This is a package with a few hopefully useful running utilities.
|
|
35
|
+
|
|
36
|
+
package name is "running". Yes I know that's confusing.
|
|
37
|
+
|
|
38
|
+
Install
|
|
39
|
+
|
|
40
|
+
pip install runtilities
|
|
41
|
+
|
|
42
|
+
Usage, e.g.
|
|
43
|
+
|
|
44
|
+
from running.runsignup import RunSignUp
|
|
45
|
+
|
|
46
|
+
A lot of this may be obsolete and hasn't been tested for a while,
|
|
47
|
+
so your mileage may vary. Sorry about that.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
analyzeagegrade = running.analyzeagegrade:main
|
|
3
3
|
athlinksresults = running.athlinksresults:main
|
|
4
4
|
competitor2csv = running.competitor2csv:main
|
|
5
|
+
parseralogxml = running.parseralogxml:main
|
|
5
6
|
parseresults = running.parseresults:main
|
|
6
7
|
parsetcx = running.parsetcx:main
|
|
7
8
|
renderclubagstats = running.renderclubagstats:main
|
|
8
9
|
runningaheadresults = running.runningaheadresults:main
|
|
9
10
|
ultrasignupresults = running.ultrasignupresults:main
|
|
10
|
-
|
|
@@ -38,6 +38,7 @@ setup(
|
|
|
38
38
|
'running/competitor2csv.py',
|
|
39
39
|
'running/parseresults.py',
|
|
40
40
|
'running/parsetcx.py',
|
|
41
|
+
'running/parseralogxml.py',
|
|
41
42
|
'running/renderclubagstats.py',
|
|
42
43
|
'running/runningaheadresults.py',
|
|
43
44
|
# 'running/strava.py',
|
|
@@ -74,6 +75,7 @@ setup(
|
|
|
74
75
|
'competitor2csv = running.competitor2csv:main',
|
|
75
76
|
'parseresults = running.parseresults:main',
|
|
76
77
|
'parsetcx = running.parsetcx:main',
|
|
78
|
+
'parseralogxml = running.parseralogxml:main',
|
|
77
79
|
'renderclubagstats = running.renderclubagstats:main',
|
|
78
80
|
'runningaheadresults = running.runningaheadresults:main',
|
|
79
81
|
'ultrasignupresults = running.ultrasignupresults:main',
|
runtilities-2.1.7.dev1/PKG-INFO
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: runtilities
|
|
3
|
-
Version: 2.1.7.dev1
|
|
4
|
-
Summary: running related scripts
|
|
5
|
-
Home-page: http://github.com/louking/running
|
|
6
|
-
Author: Lou King
|
|
7
|
-
Author-email: lking@pobox.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Description: runtilities - running utilities
|
|
10
|
-
===================================
|
|
11
|
-
|
|
12
|
-
This is a package with a few hopefully useful running utilities.
|
|
13
|
-
|
|
14
|
-
package name is "running". Yes I know that's confusing.
|
|
15
|
-
|
|
16
|
-
Install
|
|
17
|
-
|
|
18
|
-
pip install runtilities
|
|
19
|
-
|
|
20
|
-
Usage, e.g.
|
|
21
|
-
|
|
22
|
-
from running.runsignup import RunSignUp
|
|
23
|
-
|
|
24
|
-
A lot of this may be obsolete and hasn't been tested for a while,
|
|
25
|
-
so your mileage may vary. Sorry about that.
|
|
26
|
-
|
|
27
|
-
Platform: UNKNOWN
|
|
28
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
29
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
30
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
31
|
-
Classifier: Operating System :: OS Independent
|
|
32
|
-
Requires-Python: >=3.6
|
|
33
|
-
Description-Content-Type: text/markdown
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: runtilities
|
|
3
|
-
Version: 2.1.7.dev1
|
|
4
|
-
Summary: running related scripts
|
|
5
|
-
Home-page: http://github.com/louking/running
|
|
6
|
-
Author: Lou King
|
|
7
|
-
Author-email: lking@pobox.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Description: runtilities - running utilities
|
|
10
|
-
===================================
|
|
11
|
-
|
|
12
|
-
This is a package with a few hopefully useful running utilities.
|
|
13
|
-
|
|
14
|
-
package name is "running". Yes I know that's confusing.
|
|
15
|
-
|
|
16
|
-
Install
|
|
17
|
-
|
|
18
|
-
pip install runtilities
|
|
19
|
-
|
|
20
|
-
Usage, e.g.
|
|
21
|
-
|
|
22
|
-
from running.runsignup import RunSignUp
|
|
23
|
-
|
|
24
|
-
A lot of this may be obsolete and hasn't been tested for a while,
|
|
25
|
-
so your mileage may vary. Sorry about that.
|
|
26
|
-
|
|
27
|
-
Platform: UNKNOWN
|
|
28
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
29
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
30
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
31
|
-
Classifier: Operating System :: OS Independent
|
|
32
|
-
Requires-Python: >=3.6
|
|
33
|
-
Description-Content-Type: text/markdown
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|