runtilities 3.0.0.dev1__tar.gz → 3.0.0.dev2__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.
Files changed (43) hide show
  1. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/PKG-INFO +1 -1
  2. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/runsignup.py +58 -88
  3. runtilities-3.0.0.dev2/running/runsignup_fluent.py +36 -0
  4. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/version.py +1 -1
  5. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/PKG-INFO +1 -1
  6. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/SOURCES.txt +1 -0
  7. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/README.md +0 -0
  8. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/__init__.py +0 -0
  9. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/analyzeagegrade.py +0 -0
  10. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/athlinks.py +0 -0
  11. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/athlinksresults.py +0 -0
  12. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/comparegpx.py +0 -0
  13. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/competitor.py +0 -0
  14. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/competitor2csv.py +0 -0
  15. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/getweather.py +0 -0
  16. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/gpx2kml.py +0 -0
  17. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/parseralogxml.py +0 -0
  18. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/parseresults.py +0 -0
  19. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/parserun-bk3.py +0 -0
  20. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/parsetcx.py +0 -0
  21. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/ra2membersfile.py +0 -0
  22. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/racewx-render.py +0 -0
  23. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/racewx.py +0 -0
  24. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/renderclubagstats.py +0 -0
  25. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/runningahead.py +0 -0
  26. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/runningaheadmembers.py +0 -0
  27. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/runningaheadparticipants.py +0 -0
  28. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/runningaheadresults.py +0 -0
  29. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/strava.py +0 -0
  30. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/textnormalize.py +0 -0
  31. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/ultrasignup.py +0 -0
  32. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/ultrasignupresults.py +0 -0
  33. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/xmldict.py +0 -0
  34. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/xmldict1.py +0 -0
  35. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/xmldict2.py +0 -0
  36. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/running/xmlreader.py +0 -0
  37. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/dependency_links.txt +0 -0
  38. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/entry_points.txt +0 -0
  39. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/not-zip-safe +0 -0
  40. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/requires.txt +0 -0
  41. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/runtilities.egg-info/top_level.txt +0 -0
  42. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/setup.cfg +0 -0
  43. {runtilities-3.0.0.dev1 → runtilities-3.0.0.dev2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtilities
3
- Version: 3.0.0.dev1
3
+ Version: 3.0.0.dev2
4
4
  Summary: running related scripts
5
5
  Home-page: http://github.com/louking/running
6
6
  Author: Lou King
@@ -15,7 +15,6 @@ from tempfile import NamedTemporaryFile
15
15
  # pypi
16
16
  from flask import current_app
17
17
  import requests
18
- from universalclient import Client as UniversalClient
19
18
 
20
19
  # github
21
20
 
@@ -48,9 +47,9 @@ class parameterError(Exception): pass
48
47
  thislogger = logging.getLogger("running.runsignup")
49
48
 
50
49
  ########################################################################
51
- class RunSignUp():
50
+ class RunSignupBase():
52
51
  '''
53
- access methods for RunSignUp.com
52
+ common session / authentication / low-level request handling for RunSignUp.com REST API clients
54
53
 
55
54
  key and secret should be supplied for authenticated access
56
55
 
@@ -133,6 +132,62 @@ class RunSignUp():
133
132
  self.client_credentials = {}
134
133
  self.session.close()
135
134
 
135
+ def _rsugetcsv(self, methodurl, **payload):
136
+ """
137
+ get method for runsignup access (csv format response)
138
+
139
+ :param methodurl: runsignup method url to call
140
+ :param contentfield: content field to retrieve from response
141
+ :param **payload: parameters for the method
142
+ """
143
+
144
+ thispayload = self.client_credentials.copy()
145
+ thispayload.update(payload)
146
+ thispayload.update({'format':'csv'})
147
+
148
+ resp = self.session.get(methodurl, params=thispayload)
149
+ if resp.status_code != 200:
150
+ raise accessError('HTTP response code={}, url={}'.format(resp.status_code,resp.url))
151
+
152
+ data = resp.text
153
+
154
+ # if 'error' in data:
155
+ # raise accessError('RSU response code={}-{}, url={}'.format(data['error']['error_code'],data['error']['error_msg'],resp.url))
156
+
157
+ return data
158
+
159
+ def _rsuget(self, methodurl, **payload):
160
+ """
161
+ get method for runsignup access (json format response)
162
+
163
+ :param methodurl: runsignup method url to call
164
+ :param contentfield: content field to retrieve from response
165
+ :param **payload: parameters for the method
166
+ """
167
+
168
+ thispayload = self.client_credentials.copy()
169
+ thispayload.update(payload)
170
+ thispayload.update({'format':'json'})
171
+
172
+ resp = self.session.get(methodurl, params=thispayload)
173
+ if resp.status_code != 200:
174
+ raise accessError('HTTP response code={}, url={}'.format(resp.status_code,resp.url))
175
+
176
+ data = resp.json()
177
+
178
+ if 'error' in data:
179
+ raise accessError('RSU response code={}-{}, url={}'.format(data['error']['error_code'],data['error']['error_msg'],resp.url))
180
+
181
+ return data
182
+
183
+ ########################################################################
184
+ class RunSignUp(RunSignupBase):
185
+ '''
186
+ access methods for RunSignUp.com
187
+
188
+ see :class:`RunSignupBase` for authentication / session parameters
189
+ '''
190
+
136
191
  def members(self, club_id, **kwargs):
137
192
  '''
138
193
  return members accessible to this application
@@ -336,54 +391,6 @@ class RunSignUp():
336
391
 
337
392
  return '\n'.join([header] + results)
338
393
 
339
- def _rsugetcsv(self, methodurl, **payload):
340
- """
341
- get method for runsignup access (csv format response)
342
-
343
- :param methodurl: runsignup method url to call
344
- :param contentfield: content field to retrieve from response
345
- :param **payload: parameters for the method
346
- """
347
-
348
- thispayload = self.client_credentials.copy()
349
- thispayload.update(payload)
350
- thispayload.update({'format':'csv'})
351
-
352
- resp = self.session.get(methodurl, params=thispayload)
353
- if resp.status_code != 200:
354
- raise accessError('HTTP response code={}, url={}'.format(resp.status_code,resp.url))
355
-
356
- data = resp.text
357
-
358
- # if 'error' in data:
359
- # raise accessError('RSU response code={}-{}, url={}'.format(data['error']['error_code'],data['error']['error_msg'],resp.url))
360
-
361
- return data
362
-
363
- def _rsuget(self, methodurl, **payload):
364
- """
365
- get method for runsignup access (json format response)
366
-
367
- :param methodurl: runsignup method url to call
368
- :param contentfield: content field to retrieve from response
369
- :param **payload: parameters for the method
370
- """
371
-
372
- thispayload = self.client_credentials.copy()
373
- thispayload.update(payload)
374
- thispayload.update({'format':'json'})
375
-
376
- resp = self.session.get(methodurl, params=thispayload)
377
- if resp.status_code != 200:
378
- raise accessError('HTTP response code={}, url={}'.format(resp.status_code,resp.url))
379
-
380
- data = resp.json()
381
-
382
- if 'error' in data:
383
- raise accessError('RSU response code={}-{}, url={}'.format(data['error']['error_code'],data['error']['error_msg'],resp.url))
384
-
385
- return data
386
-
387
394
  #----------------------------------------------------------------------
388
395
  def updatemembercache(club_id, membercachefilename, key=None, secret=None,
389
396
  api_reg_token=None, api_reg_secret=None, debug=False):
@@ -843,40 +850,3 @@ class ClubMemberships():
843
850
  for member in self.userid2mem
844
851
  )
845
852
 
846
- class RunSignupFluent(UniversalClient):
847
- from rauth import OAuth2Service
848
-
849
- '''
850
- Fluent interface to RunSignUp API -- see https://universal-client.readthedocs.io
851
- '''
852
- def __init__(self, key=None, secret=None, api_reg_token=None, api_reg_secret=None, debug=False):
853
- '''
854
- initialize RunSignUp Fluent client
855
-
856
- :param key: api key for RunSignUp
857
- :param secret: api secret for RunSignUp
858
- :param api_reg_token: API caller registration token, sent as rsu_api_reg GET parameter -- see
859
- https://info.runsignup.com/2026/07/17/new-api-registration-requirements/
860
- :param api_reg_secret: API caller registration secret, sent as X-RSU-API-REG-SECRET header
861
- :param debug: debug flag
862
- '''
863
- # rsuservice = Oauth2Service(
864
- # name='runsignup',
865
- # authorize_url='https://www.runsignup.com/oauth2/authorize',
866
- # access_token_url='https://api.runsignup.com/oauth2/token',
867
- # client_id=key,
868
- # client_secret=secret,
869
- # )
870
-
871
- self._params = params = {'api_key' : key,
872
- 'api_secret' : secret,
873
- 'format' : 'json' }
874
- if api_reg_token:
875
- params['rsu_api_reg'] = api_reg_token
876
-
877
- client_kwargs = {'url': 'https://api.runsignup.com/rest', 'params': params}
878
- if api_reg_secret:
879
- client_kwargs['headers'] = {'X-RSU-API-REG-SECRET': api_reg_secret}
880
-
881
- super().__init__(**client_kwargs)
882
-
@@ -0,0 +1,36 @@
1
+ '''
2
+ runsignup_fluent - fluent access to runsignup.com
3
+ ===================================================
4
+ '''
5
+
6
+ # pypi
7
+ from universalclient import Client as UniversalClient
8
+
9
+ class RunSignupFluent(UniversalClient):
10
+
11
+ '''
12
+ Fluent interface to RunSignUp API -- see https://universal-client.readthedocs.io
13
+ '''
14
+ def __init__(self, key=None, secret=None, api_reg_token=None, api_reg_secret=None, debug=False):
15
+ '''
16
+ initialize RunSignUp Fluent client
17
+
18
+ :param key: api key for RunSignUp
19
+ :param secret: api secret for RunSignUp
20
+ :param api_reg_token: API caller registration token, sent as rsu_api_reg GET parameter -- see
21
+ https://info.runsignup.com/2026/07/17/new-api-registration-requirements/
22
+ :param api_reg_secret: API caller registration secret, sent as X-RSU-API-REG-SECRET header
23
+ :param debug: debug flag
24
+ '''
25
+
26
+ self._params = params = {'api_key' : key,
27
+ 'api_secret' : secret,
28
+ 'format' : 'json' }
29
+ if api_reg_token:
30
+ params['rsu_api_reg'] = api_reg_token
31
+
32
+ client_kwargs = {'url': 'https://api.runsignup.com/rest', 'params': params}
33
+ if api_reg_secret:
34
+ client_kwargs['headers'] = {'X-RSU-API-REG-SECRET': api_reg_secret}
35
+
36
+ super().__init__(**client_kwargs)
@@ -1,2 +1,2 @@
1
1
  # this string is used for the version string in the documentation, as well as the egg
2
- __version__ = '3.0.0.dev1'
2
+ __version__ = '3.0.0.dev2'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtilities
3
- Version: 3.0.0.dev1
3
+ Version: 3.0.0.dev2
4
4
  Summary: running related scripts
5
5
  Home-page: http://github.com/louking/running
6
6
  Author: Lou King
@@ -22,6 +22,7 @@ running/runningaheadmembers.py
22
22
  running/runningaheadparticipants.py
23
23
  running/runningaheadresults.py
24
24
  running/runsignup.py
25
+ running/runsignup_fluent.py
25
26
  running/strava.py
26
27
  running/textnormalize.py
27
28
  running/ultrasignup.py