castorfou commited on
Commit
cf89620
1 Parent(s): 63269df

2022-10-07_15:35

Browse files
Files changed (2) hide show
  1. rbc.py +6 -10
  2. requirements.txt +2 -1
rbc.py CHANGED
@@ -3,26 +3,22 @@
3
  # %% auto 0
4
  __all__ = ['PAGE', 'html_tables', 'df_adherents', 'get_classement', 'add_classements']
5
 
6
- # %% update_classement.ipynb 2
7
  PAGE = 'https://badmania.fr/club-joueurs-2254-riom-badminton-club.html'
8
 
9
- # %% update_classement.ipynb 3
10
  import pandas as pd
11
  html_tables = pd.read_html(PAGE)
12
  df_adherents = html_tables[0]
13
 
14
-
15
- # %% update_classement.ipynb 7
16
  def get_classement(
17
  license_number,# le numero de license
18
  ):
19
- # print(license_number)
20
- if len(df_adherents[df_adherents['Licence'] == license_number]['Class.'].values)>0:
21
- return df_adherents[df_adherents['Licence'] == license_number]['Class.'].values[0]
22
- else:
23
- return ''
24
 
25
- # %% update_classement.ipynb 19
26
  def add_classements(dataframe, #le dataframe des adherents
27
  ):
28
  dataframe = dataframe.copy()
 
3
  # %% auto 0
4
  __all__ = ['PAGE', 'html_tables', 'df_adherents', 'get_classement', 'add_classements']
5
 
6
+ # %% update_classement.ipynb 4
7
  PAGE = 'https://badmania.fr/club-joueurs-2254-riom-badminton-club.html'
8
 
9
+ # %% update_classement.ipynb 5
10
  import pandas as pd
11
  html_tables = pd.read_html(PAGE)
12
  df_adherents = html_tables[0]
13
 
14
+ # %% update_classement.ipynb 9
 
15
  def get_classement(
16
  license_number,# le numero de license
17
  ):
18
+ classement_licencie = df_adherents[df_adherents['Licence'] == license_number]['Class.']
19
+ return classement_licencie.values[0] if len(classement_licencie)>0 else ''
 
 
 
20
 
21
+ # %% update_classement.ipynb 22
22
  def add_classements(dataframe, #le dataframe des adherents
23
  ):
24
  dataframe = dataframe.copy()
requirements.txt CHANGED
@@ -2,4 +2,5 @@ lxml
2
  pandas
3
  openpyxl
4
  gradio
5
- nbdev
 
 
2
  pandas
3
  openpyxl
4
  gradio
5
+ nbdev
6
+ gspread