scraping-rtn 0.0.4.2__py3-none-any.whl → 0.0.5.1__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.

Potentially problematic release.


This version of scraping-rtn might be problematic. Click here for more details.

@@ -149,12 +149,10 @@ class RtnSingleTeamYear(object):
149
149
  Methods:
150
150
  * Individual Consistency - Uses Individual Consistency tab from RTN
151
151
  * Tends to have more complete data, especially for older years
152
- * Requires summing of all events to get AA (code does this for you)
153
152
  * Relies on date to join back to meet info, such as opponent, etc.
154
153
  * One API call per gymnast, relative speed depends on number of meets vs number of gymnasts
155
154
  * By Meet - loops through each meet to get scores
156
155
  * Older meets tend to be missing
157
- * Includes AA scores in the response
158
156
  * Uses team meet id to join back to meet info, such as opponent, etc.
159
157
  * One API call per meet, relative speed depends on number of meets vs number of gymnasts
160
158
  """
@@ -207,6 +205,7 @@ class RtnSingleTeamYear(object):
207
205
  if len(individual_scores_all) > 0:
208
206
  merge_dicts(dict1=individual_scores_all, dict2=self._raw_schedule, merge_field='Team Meet ID')
209
207
  self.individual_results = pd.DataFrame(individual_scores_all)
208
+ self.individual_results['AA'] = self.individual_results[['VT', 'UB', 'BB', 'FX']].dropna(how='any').astype(float).T.sum().round(4)
210
209
  else:
211
210
  self.individual_results = pd.DataFrame(columns=['Meet Date', 'VT', 'UB', 'BB', 'FX', 'AA', 'Gymnast ID', 'Name',
212
211
  'Team ID', 'Team', 'Team Meet ID', 'Home/Away', 'Opponents',
@@ -267,7 +266,8 @@ class RtnSingleTeamYear(object):
267
266
 
268
267
  def _get_current_week(self):
269
268
  if not hasattr(self, 'week'):
270
- return get_data_from_api(endpoint='currentweek', suffix=str(self.year)).json()['max']
269
+ week_data = get_data_from_api(endpoint='currentweek', suffix=str(self.year)).json()
270
+ return min(int(week_data['week']), int(week_data['max']))
271
271
 
272
272
  def _get_raw_rankings(self, team_vs_ind, event, week):
273
273
  team_ind_map = {'team': 0, 'ind': 1}
scraping_rtn/__init__.py CHANGED
@@ -18,7 +18,7 @@ def roster(year, teams, include_hometowns=False, include_class=False, include_ev
18
18
  all_rosters = []
19
19
  for team in teams:
20
20
  if verbose:
21
- print(f'Getting roster for {team} ', end='\r')
21
+ print(f'Getting roster for {team} ', end='\r' if team != teams[-1] else None)
22
22
  rtn = RtnSingleTeamYear(year=year, team_name=team)
23
23
  res = rtn.get_roster(include_hometowns=include_hometowns, include_class=include_class,
24
24
  include_events=include_events)
@@ -36,7 +36,7 @@ def schedule(year, teams, verbose=False):
36
36
  all_schedules = []
37
37
  for team in teams:
38
38
  if verbose:
39
- print(f'Getting schedule for {team} ', end='\r')
39
+ print(f'Getting schedule for {team} ', end='\r' if team != teams[-1] else None)
40
40
  rtn = RtnSingleTeamYear(year=year, team_name=team)
41
41
  res = rtn.get_schedule()
42
42
  if verbose and len(res) == 0:
@@ -52,7 +52,7 @@ def team_results(year, teams, method='team_consistency', force_update=False, ver
52
52
  all_results = []
53
53
  for team in teams:
54
54
  if verbose:
55
- print(f'Getting schedule and results for {team} ', end='\r')
55
+ print(f'Getting schedule and results for {team} ', end='\r' if team != teams[-1] else None)
56
56
  rtn = RtnSingleTeamYear(year=year, team_name=team)
57
57
  res = rtn.get_team_scores(method=method,force_update=force_update)
58
58
  if verbose and len(res) == 0:
@@ -68,7 +68,7 @@ def individual_results(year, teams, method='by_meet', force_update=False, verbos
68
68
  all_scores = []
69
69
  for team in teams:
70
70
  if verbose:
71
- print(f'Getting scores for {team} ', end='\r')
71
+ print(f'Getting scores for {team} ', end='\r' if team != teams[-1] else None)
72
72
  rtn = RtnSingleTeamYear(year=year, team_name=team)
73
73
  res = rtn.get_individual_scores(method=method, force_update=force_update)
74
74
  if verbose and len(res) == 0:
@@ -84,7 +84,7 @@ def individual_nqs(year, teams, verbose=False):
84
84
  all_nqs = []
85
85
  for team in teams:
86
86
  if verbose:
87
- print(f'Getting individual NQS for {team} ', end='\r')
87
+ print(f'Getting individual NQS for {team} ', end='\r' if team != teams[-1] else None)
88
88
  rtn = RtnSingleTeamYear(year=year, team_name=team)
89
89
  res = rtn.get_individual_nqs()
90
90
  if verbose and len(res) == 0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scraping_rtn
3
- Version: 0.0.4.2
3
+ Version: 0.0.5.1
4
4
  Summary: package to scrape gymnastics data from Road To Nationals
5
5
  Author-email: Claire Harmon <ceharmon220@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/cgn-charmon/scraping_rtn
@@ -0,0 +1,8 @@
1
+ scraping_rtn/RtnSingleTeamYear.py,sha256=gemLpucuk9bKukgYJhTqhWeKVNgATB-l3s-BROtS4hk,17123
2
+ scraping_rtn/__init__.py,sha256=GjqUhVyBgQhCFzLaAQ4rm1pevZv5uAuEdxeyJjaRpe0,3825
3
+ scraping_rtn/src.py,sha256=6L54EVeN4A5gNZxgc5P0ghnkej8y8J89glSt9rjeTwg,23719
4
+ scraping_rtn-0.0.5.1.dist-info/LICENSE,sha256=hbUs8BYJhECMTIKtiPtjcfq-0fWEtLTxB42IS_SzxWk,1069
5
+ scraping_rtn-0.0.5.1.dist-info/METADATA,sha256=GNt4EhM7M5EBVfzyk7nFct3d6NY9faWnCBM4ycW9p80,672
6
+ scraping_rtn-0.0.5.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
7
+ scraping_rtn-0.0.5.1.dist-info/top_level.txt,sha256=PlP9g-4WmuusQ1B-LmteQpLp-jVJdnh0BX8qAzBqDEE,13
8
+ scraping_rtn-0.0.5.1.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- scraping_rtn/RtnSingleTeamYear.py,sha256=ekWgpGRPMDiE1rQ_mJ-ApsmVroOYrxSj3JDD3l6w6qo,17041
2
- scraping_rtn/__init__.py,sha256=8oc32NpJAw_YDkXvoOhh9VoIYg1vZxB-Brdq_xOOYi4,3670
3
- scraping_rtn/src.py,sha256=6L54EVeN4A5gNZxgc5P0ghnkej8y8J89glSt9rjeTwg,23719
4
- scraping_rtn-0.0.4.2.dist-info/LICENSE,sha256=hbUs8BYJhECMTIKtiPtjcfq-0fWEtLTxB42IS_SzxWk,1069
5
- scraping_rtn-0.0.4.2.dist-info/METADATA,sha256=UcotJVzKgZpLgscgPyKsSqsXHJT-Y3Nxlo8eev2CRck,672
6
- scraping_rtn-0.0.4.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
7
- scraping_rtn-0.0.4.2.dist-info/top_level.txt,sha256=PlP9g-4WmuusQ1B-LmteQpLp-jVJdnh0BX8qAzBqDEE,13
8
- scraping_rtn-0.0.4.2.dist-info/RECORD,,