mohcineelharras commited on
Commit
6116805
1 Parent(s): 349c960

balances in

Browse files
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ *.ipynb
app.py CHANGED
@@ -8,6 +8,8 @@ import subprocess
8
  import threading
9
  from dotenv import load_dotenv
10
  from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
 
 
11
 
12
  # ------------------------ Environment Variables --------------------------
13
 
@@ -60,10 +62,16 @@ def execute_cmc_scraping():
60
  logging.info("CMC scraping completed")
61
  threading.Timer(2592000 / 9000, execute_cmc_scraping).start()
62
 
 
 
 
 
 
63
  if "initialized" not in st.session_state:
64
  # Start the scraping threads
65
  threading.Thread(target=execute_etherscan_scraping).start()
66
  threading.Thread(target=execute_cmc_scraping).start()
 
67
  st.session_state["initialized"] = True
68
 
69
  #-------------------------------------streamlit ----------------------------------
@@ -167,6 +175,79 @@ with st.container():
167
  )
168
  st.plotly_chart(fig)
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
 
172
 
 
8
  import threading
9
  from dotenv import load_dotenv
10
  from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
11
+ import plotly.express as px
12
+ import json
13
 
14
  # ------------------------ Environment Variables --------------------------
15
 
 
62
  logging.info("CMC scraping completed")
63
  threading.Timer(2592000 / 9000, execute_cmc_scraping).start()
64
 
65
+ def execute_influencers_scraping():
66
+ subprocess.call(["python", "utils/scrap_influencers_balance.py"])
67
+ logging.info("Influencers balance scraping completed")
68
+ threading.Timer(3600, execute_influencers_scraping).start() # Run every hour, for example
69
+
70
  if "initialized" not in st.session_state:
71
  # Start the scraping threads
72
  threading.Thread(target=execute_etherscan_scraping).start()
73
  threading.Thread(target=execute_cmc_scraping).start()
74
+ threading.Thread(target=execute_influencers_scraping).start()
75
  st.session_state["initialized"] = True
76
 
77
  #-------------------------------------streamlit ----------------------------------
 
175
  )
176
  st.plotly_chart(fig)
177
 
178
+ with st.container():
179
+ with col1:
180
+
181
+ # Load influencers
182
+ def load_influencers():
183
+ try:
184
+ with open("ressources/dict_influencers_addr.json", "r") as file:
185
+ return json.load(file)
186
+ except Exception as e:
187
+ st.error(f"Error loading influencers: {e}")
188
+ return {}
189
+
190
+ influencers = load_influencers()
191
+
192
+ new_influencer_name = st.text_input("New Influencer Name")
193
+ new_influencer_addr = st.text_input("New Influencer Address")
194
+ if st.button("Add Influencer"):
195
+ if new_influencer_name and new_influencer_addr:
196
+ influencers[new_influencer_name] = new_influencer_addr
197
+ with open("ressources/dict_influencers_addr.json", "w") as file:
198
+ json.dump(influencers, file, indent=4)
199
+ st.success(f"Influencer {new_influencer_name} added")
200
+ subprocess.call(["python", "utils/scrap_influencers_balance.py"])
201
+ st.success(f"Balance updated")
202
+ else:
203
+ st.error("Please enter both name and address")
204
+
205
+ # Load Ether balances
206
+ try:
207
+ df_balances = pd.read_csv("output/influencers_balances.csv")
208
+ logging.info(f"Balances uploaded, shape of dataframe is {df_balances.shape}")
209
+ #st.write("DataFrame Loaded:", df_balances) # Debugging line
210
+ except FileNotFoundError:
211
+ st.error("Balance data not found. Please wait for the next update cycle.")
212
+ df_balances = pd.DataFrame()
213
+
214
+ # Inverting the influencers dictionary
215
+ inverted_influencers = {v.lower(): k for k, v in influencers.items()}
216
+
217
+ if not df_balances.empty:
218
+ df_balances["balance"] = df_balances["balance"].astype(float) / 1e18 # Convert Wei to Ether
219
+ df_balances = df_balances.rename(columns={"account": "address"})
220
+
221
+ # Ensure addresses are in the same format as in the inverted dictionary (e.g., lowercase)
222
+ df_balances["address"] = df_balances["address"].str.lower()
223
+
224
+ # Perform the mapping
225
+ df_balances["influencer"] = df_balances["address"].map(inverted_influencers)
226
+ #st.write("Mapped DataFrame:", df_balances) # Debugging line
227
+
228
+ fig = px.bar(df_balances, y="influencer", x="balance",orientation="h")
229
+ fig.update_layout(
230
+ title='Ether Balances of Influencers',
231
+ xaxis=dict(
232
+ title='Balance in eth',
233
+ titlefont_size=16,
234
+ tickfont_size=14,
235
+ ))
236
+ fig.update_layout(
237
+ autosize=False,
238
+ width=500,
239
+ height=500,
240
+ margin=dict(
241
+ l=50,
242
+ r=50,
243
+ b=100,
244
+ t=100,
245
+ pad=4
246
+ ))
247
+
248
+ st.plotly_chart(fig)
249
+ else:
250
+ logging.info("DataFrame is empty")
251
 
252
 
253
 
app_dash.py DELETED
@@ -1,73 +0,0 @@
1
- import os
2
- import pandas as pd
3
- import dash
4
- from dash import dcc,html
5
- import dash_bootstrap_components as dbc
6
- from dash.dependencies import Input, Output
7
- import plotly.graph_objs as go
8
-
9
- # Load the data from the CSV files
10
- dataframes = []
11
- for filename in os.listdir('output'):
12
- if filename.endswith('.csv'):
13
- df = pd.read_csv(os.path.join('output', filename), sep=';')
14
- dataframes.append(df)
15
- df = pd.concat(dataframes)
16
-
17
-
18
- # Create the Dash app
19
- app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
20
-
21
- # Define the app layout
22
- app.layout = dbc.Container([
23
- dbc.Row([
24
- dbc.Col([
25
- html.H1('Token Analysis'),
26
- dcc.Dropdown(
27
- id='token-dropdown',
28
- options=[{'label': i, 'value': i} for i in df['tokenSymbol'].unique()],
29
- value='MANA'
30
- ),
31
- # Add more filters here
32
- ], width=5),
33
- dbc.Col([
34
- dcc.Graph(id='token-graph')
35
- ], width=7)
36
- ])
37
- ])
38
-
39
- # Define the callback to update the graph
40
- @app.callback(
41
- Output('token-graph', 'figure'),
42
- [Input('token-dropdown', 'value')]
43
- )
44
- def update_graph(selected_token):
45
- filtered_df = df[df['tokenSymbol'] == selected_token]
46
- # filtered_df['timeStamp'] = pd.to_datetime(filtered_df['timeStamp'], unit='s')
47
- # filtered_df['value'] = filtered_df['value'].astype(float) / 1e18
48
- figure = go.Figure(
49
- data=[
50
- go.Scatter(
51
- x=filtered_df['timeStamp'],
52
- y=filtered_df['value'],
53
- mode='lines',
54
- name='Value over time'
55
- )
56
- ],
57
- layout=go.Layout(
58
- title='Token Value Over Time',
59
- yaxis=dict(
60
- title='Value ('+selected_token+')', # Change this to 'Value (USD)' if the values are in USD
61
- ),
62
- showlegend=True,
63
- legend=go.layout.Legend(
64
- x=0,
65
- y=1.0
66
- ),
67
- margin=go.layout.Margin(l=40, r=0, t=40, b=30)
68
- )
69
- )
70
- return figure
71
-
72
- if __name__ == '__main__':
73
- app.run_server(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
logs/scrapping/cmc_scrapping.log CHANGED
@@ -176,3 +176,129 @@
176
  2023-11-27 23:21:54,745 [INFO] - Function fetch_and_process_cmc_data executed in 0.45 seconds
177
  2023-11-27 23:26:43,314 [INFO] - CMC data script execution completed.
178
  2023-11-27 23:26:43,315 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  2023-11-27 23:21:54,745 [INFO] - Function fetch_and_process_cmc_data executed in 0.45 seconds
177
  2023-11-27 23:26:43,314 [INFO] - CMC data script execution completed.
178
  2023-11-27 23:26:43,315 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
179
+ 2023-11-27 23:32:30,212 [INFO] - CMC data script execution completed.
180
+ 2023-11-27 23:32:30,213 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
181
+ 2023-11-27 23:34:10,849 [INFO] - CMC data script execution completed.
182
+ 2023-11-27 23:34:10,850 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
183
+ 2023-11-27 23:34:15,365 [INFO] - CMC data script execution completed.
184
+ 2023-11-27 23:34:15,365 [INFO] - Function fetch_and_process_cmc_data executed in 0.25 seconds
185
+ 2023-11-27 23:37:18,646 [INFO] - CMC data script execution completed.
186
+ 2023-11-27 23:37:18,647 [INFO] - Function fetch_and_process_cmc_data executed in 0.17 seconds
187
+ 2023-11-27 23:38:59,272 [INFO] - CMC data script execution completed.
188
+ 2023-11-27 23:38:59,273 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
189
+ 2023-11-27 23:39:03,791 [INFO] - CMC data script execution completed.
190
+ 2023-11-27 23:39:03,792 [INFO] - Function fetch_and_process_cmc_data executed in 0.18 seconds
191
+ 2023-11-27 23:42:07,149 [INFO] - CMC data script execution completed.
192
+ 2023-11-27 23:42:07,149 [INFO] - Function fetch_and_process_cmc_data executed in 0.26 seconds
193
+ 2023-11-27 23:43:47,711 [INFO] - CMC data script execution completed.
194
+ 2023-11-27 23:43:47,712 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
195
+ 2023-11-27 23:43:52,463 [INFO] - CMC data script execution completed.
196
+ 2023-11-27 23:43:52,464 [INFO] - Function fetch_and_process_cmc_data executed in 0.43 seconds
197
+ 2023-11-27 23:46:58,664 [INFO] - CMC data script execution completed.
198
+ 2023-11-27 23:46:58,664 [INFO] - Function fetch_and_process_cmc_data executed in 3.27 seconds
199
+ 2023-11-27 23:48:36,149 [INFO] - CMC data script execution completed.
200
+ 2023-11-27 23:48:36,150 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
201
+ 2023-11-27 23:48:41,034 [INFO] - CMC data script execution completed.
202
+ 2023-11-27 23:48:41,035 [INFO] - Function fetch_and_process_cmc_data executed in 0.33 seconds
203
+ 2023-11-27 23:51:49,952 [INFO] - CMC data script execution completed.
204
+ 2023-11-27 23:51:49,953 [INFO] - Function fetch_and_process_cmc_data executed in 3.04 seconds
205
+ 2023-11-27 23:53:42,333 [INFO] - CMC data script execution completed.
206
+ 2023-11-27 23:53:42,334 [INFO] - Function fetch_and_process_cmc_data executed in 0.18 seconds
207
+ 2023-11-27 23:54:57,380 [INFO] - CMC data script execution completed.
208
+ 2023-11-27 23:54:57,381 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
209
+ 2023-11-27 23:55:12,967 [INFO] - CMC data script execution completed.
210
+ 2023-11-27 23:55:12,968 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
211
+ 2023-11-28 00:00:02,922 [INFO] - CMC data script execution completed.
212
+ 2023-11-28 00:00:02,923 [INFO] - Function fetch_and_process_cmc_data executed in 1.67 seconds
213
+ 2023-11-28 00:00:22,438 [INFO] - CMC data script execution completed.
214
+ 2023-11-28 00:00:22,439 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
215
+ 2023-11-28 00:00:34,295 [INFO] - CMC data script execution completed.
216
+ 2023-11-28 00:00:34,296 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
217
+ 2023-11-28 00:01:05,885 [INFO] - CMC data script execution completed.
218
+ 2023-11-28 00:01:05,886 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
219
+ 2023-11-28 00:01:17,051 [INFO] - CMC data script execution completed.
220
+ 2023-11-28 00:01:17,052 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
221
+ 2023-11-28 00:01:30,857 [INFO] - CMC data script execution completed.
222
+ 2023-11-28 00:01:30,858 [INFO] - Function fetch_and_process_cmc_data executed in 0.25 seconds
223
+ 2023-11-28 00:01:44,815 [INFO] - CMC data script execution completed.
224
+ 2023-11-28 00:01:44,816 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
225
+ 2023-11-28 00:05:22,758 [INFO] - CMC data script execution completed.
226
+ 2023-11-28 00:05:22,759 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
227
+ 2023-11-28 00:05:54,331 [INFO] - CMC data script execution completed.
228
+ 2023-11-28 00:05:54,331 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
229
+ 2023-11-28 00:06:05,493 [INFO] - CMC data script execution completed.
230
+ 2023-11-28 00:06:05,494 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
231
+ 2023-11-28 00:06:19,398 [INFO] - CMC data script execution completed.
232
+ 2023-11-28 00:06:19,399 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
233
+ 2023-11-28 00:06:33,258 [INFO] - CMC data script execution completed.
234
+ 2023-11-28 00:06:33,258 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
235
+ 2023-11-28 00:16:06,268 [INFO] - CMC data script execution completed.
236
+ 2023-11-28 00:16:06,269 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
237
+ 2023-11-28 00:17:37,907 [INFO] - CMC data script execution completed.
238
+ 2023-11-28 00:17:37,908 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
239
+ 2023-11-28 00:18:51,014 [INFO] - CMC data script execution completed.
240
+ 2023-11-28 00:18:51,015 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
241
+ 2023-11-28 00:20:39,099 [INFO] - CMC data script execution completed.
242
+ 2023-11-28 00:20:39,100 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
243
+ 2023-11-28 00:22:13,897 [INFO] - CMC data script execution completed.
244
+ 2023-11-28 00:22:13,898 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
245
+ 2023-11-28 00:23:01,926 [INFO] - CMC data script execution completed.
246
+ 2023-11-28 00:23:01,927 [INFO] - Function fetch_and_process_cmc_data executed in 0.44 seconds
247
+ 2023-11-28 00:23:47,827 [INFO] - CMC data script execution completed.
248
+ 2023-11-28 00:23:47,828 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
249
+ 2023-11-28 00:25:04,060 [INFO] - CMC data script execution completed.
250
+ 2023-11-28 00:25:04,061 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
251
+ 2023-11-28 00:29:04,769 [INFO] - CMC data script execution completed.
252
+ 2023-11-28 00:29:04,770 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
253
+ 2023-11-28 00:29:52,574 [INFO] - CMC data script execution completed.
254
+ 2023-11-28 00:29:52,575 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
255
+ 2023-11-28 00:31:40,386 [INFO] - CMC data script execution completed.
256
+ 2023-11-28 00:31:40,387 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
257
+ 2023-11-28 00:32:29,036 [INFO] - CMC data script execution completed.
258
+ 2023-11-28 00:32:29,037 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
259
+ 2023-11-28 00:32:59,678 [INFO] - CMC data script execution completed.
260
+ 2023-11-28 00:32:59,679 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
261
+ 2023-11-28 00:33:36,724 [INFO] - CMC data script execution completed.
262
+ 2023-11-28 00:33:36,725 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
263
+ 2023-11-28 00:34:47,295 [INFO] - CMC data script execution completed.
264
+ 2023-11-28 00:34:47,296 [INFO] - Function fetch_and_process_cmc_data executed in 0.23 seconds
265
+ 2023-11-28 00:36:29,848 [INFO] - CMC data script execution completed.
266
+ 2023-11-28 00:36:29,849 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
267
+ 2023-11-28 00:38:25,207 [INFO] - CMC data script execution completed.
268
+ 2023-11-28 00:38:25,208 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
269
+ 2023-11-28 00:38:30,807 [INFO] - CMC data script execution completed.
270
+ 2023-11-28 00:38:30,808 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
271
+ 2023-11-28 00:38:47,808 [INFO] - CMC data script execution completed.
272
+ 2023-11-28 00:38:47,809 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
273
+ 2023-11-28 00:39:02,734 [INFO] - CMC data script execution completed.
274
+ 2023-11-28 00:39:02,735 [INFO] - Function fetch_and_process_cmc_data executed in 0.23 seconds
275
+ 2023-11-28 00:39:35,788 [INFO] - CMC data script execution completed.
276
+ 2023-11-28 00:39:35,789 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
277
+ 2023-11-28 00:41:18,336 [INFO] - CMC data script execution completed.
278
+ 2023-11-28 00:41:18,337 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
279
+ 2023-11-28 00:41:35,063 [INFO] - CMC data script execution completed.
280
+ 2023-11-28 00:41:35,064 [INFO] - Function fetch_and_process_cmc_data executed in 0.63 seconds
281
+ 2023-11-28 00:41:55,087 [INFO] - CMC data script execution completed.
282
+ 2023-11-28 00:41:55,088 [INFO] - Function fetch_and_process_cmc_data executed in 0.22 seconds
283
+ 2023-11-28 00:43:13,671 [INFO] - CMC data script execution completed.
284
+ 2023-11-28 00:43:13,671 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
285
+ 2023-11-28 00:43:19,267 [INFO] - CMC data script execution completed.
286
+ 2023-11-28 00:43:19,268 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
287
+ 2023-11-28 00:43:36,279 [INFO] - CMC data script execution completed.
288
+ 2023-11-28 00:43:36,280 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
289
+ 2023-11-28 00:43:51,205 [INFO] - CMC data script execution completed.
290
+ 2023-11-28 00:43:51,206 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
291
+ 2023-11-28 00:44:24,244 [INFO] - CMC data script execution completed.
292
+ 2023-11-28 00:44:24,245 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
293
+ 2023-11-28 00:45:41,850 [INFO] - CMC data script execution completed.
294
+ 2023-11-28 00:45:41,851 [INFO] - Function fetch_and_process_cmc_data executed in 0.28 seconds
295
+ 2023-11-28 00:46:06,793 [INFO] - CMC data script execution completed.
296
+ 2023-11-28 00:46:06,794 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
297
+ 2023-11-28 00:46:23,550 [INFO] - CMC data script execution completed.
298
+ 2023-11-28 00:46:23,551 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
299
+ 2023-11-28 00:46:43,548 [INFO] - CMC data script execution completed.
300
+ 2023-11-28 00:46:43,549 [INFO] - Function fetch_and_process_cmc_data executed in 0.20 seconds
301
+ 2023-11-28 00:48:02,131 [INFO] - CMC data script execution completed.
302
+ 2023-11-28 00:48:02,132 [INFO] - Function fetch_and_process_cmc_data executed in 0.21 seconds
303
+ 2023-11-28 00:48:07,702 [INFO] - CMC data script execution completed.
304
+ 2023-11-28 00:48:07,703 [INFO] - Function fetch_and_process_cmc_data executed in 0.19 seconds
logs/scrapping/etherscan_scrap.log CHANGED
@@ -83,3 +83,123 @@
83
  2023-11-27 23:22:15,713 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
84
  2023-11-27 23:22:15,713 [INFO] - Etherscan scraping script execution completed.
85
  2023-11-27 23:22:15,713 [INFO] - Function fetch_and_update_etherscan executed in 21.43 seconds
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  2023-11-27 23:22:15,713 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
84
  2023-11-27 23:22:15,713 [INFO] - Etherscan scraping script execution completed.
85
  2023-11-27 23:22:15,713 [INFO] - Function fetch_and_update_etherscan executed in 21.43 seconds
86
+ 2023-11-27 23:32:52,250 [INFO] - Created files:
87
+ 2023-11-27 23:32:52,250 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
88
+ 2023-11-27 23:32:52,250 [INFO] - Etherscan scraping script execution completed.
89
+ 2023-11-27 23:32:52,250 [INFO] - Function fetch_and_update_etherscan executed in 22.27 seconds
90
+ 2023-11-27 23:34:33,682 [INFO] - Created files:
91
+ 2023-11-27 23:34:33,682 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
92
+ 2023-11-27 23:34:33,682 [INFO] - Etherscan scraping script execution completed.
93
+ 2023-11-27 23:34:33,682 [INFO] - Function fetch_and_update_etherscan executed in 23.10 seconds
94
+ 2023-11-27 23:34:37,126 [INFO] - Created files:
95
+ 2023-11-27 23:34:37,126 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
96
+ 2023-11-27 23:34:37,126 [INFO] - Etherscan scraping script execution completed.
97
+ 2023-11-27 23:34:37,126 [INFO] - Function fetch_and_update_etherscan executed in 22.01 seconds
98
+ 2023-11-27 23:54:04,485 [INFO] - Created files:
99
+ 2023-11-27 23:54:04,485 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
100
+ 2023-11-27 23:54:04,485 [INFO] - Etherscan scraping script execution completed.
101
+ 2023-11-27 23:54:04,486 [INFO] - Function fetch_and_update_etherscan executed in 22.33 seconds
102
+ 2023-11-27 23:55:33,934 [INFO] - Created files:
103
+ 2023-11-27 23:55:33,934 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
104
+ 2023-11-27 23:55:33,934 [INFO] - Etherscan scraping script execution completed.
105
+ 2023-11-27 23:55:33,934 [INFO] - Function fetch_and_update_etherscan executed in 21.16 seconds
106
+ 2023-11-28 00:00:56,044 [INFO] - Created files:
107
+ 2023-11-28 00:00:56,044 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
108
+ 2023-11-28 00:00:56,044 [INFO] - Etherscan scraping script execution completed.
109
+ 2023-11-28 00:00:56,044 [INFO] - Function fetch_and_update_etherscan executed in 21.94 seconds
110
+ 2023-11-28 00:01:27,862 [INFO] - Created files:
111
+ 2023-11-28 00:01:27,862 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
112
+ 2023-11-28 00:01:27,862 [INFO] - Etherscan scraping script execution completed.
113
+ 2023-11-28 00:01:27,863 [INFO] - Function fetch_and_update_etherscan executed in 22.18 seconds
114
+ 2023-11-28 00:01:42,242 [INFO] - Created files:
115
+ 2023-11-28 00:01:42,242 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
116
+ 2023-11-28 00:01:42,242 [INFO] - Etherscan scraping script execution completed.
117
+ 2023-11-28 00:01:42,242 [INFO] - Function fetch_and_update_etherscan executed in 25.47 seconds
118
+ 2023-11-28 00:02:02,570 [INFO] - Created files:
119
+ 2023-11-28 00:02:02,571 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
120
+ 2023-11-28 00:02:02,571 [INFO] - Etherscan scraping script execution completed.
121
+ 2023-11-28 00:02:02,571 [INFO] - Function fetch_and_update_etherscan executed in 31.96 seconds
122
+ 2023-11-28 00:02:09,587 [INFO] - Created files:
123
+ 2023-11-28 00:02:09,587 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
124
+ 2023-11-28 00:02:09,587 [INFO] - Etherscan scraping script execution completed.
125
+ 2023-11-28 00:02:09,587 [INFO] - Function fetch_and_update_etherscan executed in 24.99 seconds
126
+ 2023-11-28 00:16:29,245 [INFO] - Created files:
127
+ 2023-11-28 00:16:29,245 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
128
+ 2023-11-28 00:16:29,245 [INFO] - Etherscan scraping script execution completed.
129
+ 2023-11-28 00:16:29,245 [INFO] - Function fetch_and_update_etherscan executed in 23.22 seconds
130
+ 2023-11-28 00:17:59,714 [INFO] - Created files:
131
+ 2023-11-28 00:17:59,714 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
132
+ 2023-11-28 00:17:59,714 [INFO] - Etherscan scraping script execution completed.
133
+ 2023-11-28 00:17:59,714 [INFO] - Function fetch_and_update_etherscan executed in 22.03 seconds
134
+ 2023-11-28 00:19:16,916 [INFO] - Created files:
135
+ 2023-11-28 00:19:16,916 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
136
+ 2023-11-28 00:19:16,916 [INFO] - Etherscan scraping script execution completed.
137
+ 2023-11-28 00:19:16,916 [INFO] - Function fetch_and_update_etherscan executed in 26.08 seconds
138
+ 2023-11-28 00:21:02,924 [INFO] - Created files:
139
+ 2023-11-28 00:21:02,924 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
140
+ 2023-11-28 00:21:02,924 [INFO] - Etherscan scraping script execution completed.
141
+ 2023-11-28 00:21:02,924 [INFO] - Function fetch_and_update_etherscan executed in 24.03 seconds
142
+ 2023-11-28 00:23:27,103 [INFO] - Created files:
143
+ 2023-11-28 00:23:27,103 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
144
+ 2023-11-28 00:23:27,103 [INFO] - Etherscan scraping script execution completed.
145
+ 2023-11-28 00:23:27,103 [INFO] - Function fetch_and_update_etherscan executed in 25.61 seconds
146
+ 2023-11-28 00:24:09,758 [INFO] - Created files:
147
+ 2023-11-28 00:24:09,758 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
148
+ 2023-11-28 00:24:09,759 [INFO] - Etherscan scraping script execution completed.
149
+ 2023-11-28 00:24:09,759 [INFO] - Function fetch_and_update_etherscan executed in 22.12 seconds
150
+ 2023-11-28 00:25:24,884 [INFO] - Created files:
151
+ 2023-11-28 00:25:24,884 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
152
+ 2023-11-28 00:25:24,884 [INFO] - Etherscan scraping script execution completed.
153
+ 2023-11-28 00:25:24,884 [INFO] - Function fetch_and_update_etherscan executed in 21.00 seconds
154
+ 2023-11-28 00:29:25,777 [INFO] - Created files:
155
+ 2023-11-28 00:29:25,777 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
156
+ 2023-11-28 00:29:25,777 [INFO] - Etherscan scraping script execution completed.
157
+ 2023-11-28 00:29:25,777 [INFO] - Function fetch_and_update_etherscan executed in 21.20 seconds
158
+ 2023-11-28 00:32:02,225 [INFO] - Created files:
159
+ 2023-11-28 00:32:02,225 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
160
+ 2023-11-28 00:32:02,225 [INFO] - Etherscan scraping script execution completed.
161
+ 2023-11-28 00:32:02,225 [INFO] - Function fetch_and_update_etherscan executed in 22.06 seconds
162
+ 2023-11-28 00:32:49,987 [INFO] - Created files:
163
+ 2023-11-28 00:32:49,987 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
164
+ 2023-11-28 00:32:49,987 [INFO] - Etherscan scraping script execution completed.
165
+ 2023-11-28 00:32:49,987 [INFO] - Function fetch_and_update_etherscan executed in 21.20 seconds
166
+ 2023-11-28 00:33:23,088 [INFO] - Created files:
167
+ 2023-11-28 00:33:23,088 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
168
+ 2023-11-28 00:33:23,088 [INFO] - Etherscan scraping script execution completed.
169
+ 2023-11-28 00:33:23,088 [INFO] - Function fetch_and_update_etherscan executed in 23.61 seconds
170
+ 2023-11-28 00:33:57,499 [INFO] - Created files:
171
+ 2023-11-28 00:33:57,500 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
172
+ 2023-11-28 00:33:57,500 [INFO] - Etherscan scraping script execution completed.
173
+ 2023-11-28 00:33:57,500 [INFO] - Function fetch_and_update_etherscan executed in 20.97 seconds
174
+ 2023-11-28 00:35:08,107 [INFO] - Created files:
175
+ 2023-11-28 00:35:08,108 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
176
+ 2023-11-28 00:35:08,108 [INFO] - Etherscan scraping script execution completed.
177
+ 2023-11-28 00:35:08,108 [INFO] - Function fetch_and_update_etherscan executed in 21.05 seconds
178
+ 2023-11-28 00:36:52,656 [INFO] - Created files:
179
+ 2023-11-28 00:36:52,656 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
180
+ 2023-11-28 00:36:52,656 [INFO] - Etherscan scraping script execution completed.
181
+ 2023-11-28 00:36:52,656 [INFO] - Function fetch_and_update_etherscan executed in 23.00 seconds
182
+ 2023-11-28 00:38:51,771 [INFO] - Created files:
183
+ 2023-11-28 00:38:51,771 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
184
+ 2023-11-28 00:38:51,771 [INFO] - Etherscan scraping script execution completed.
185
+ 2023-11-28 00:38:51,771 [INFO] - Function fetch_and_update_etherscan executed in 21.18 seconds
186
+ 2023-11-28 00:39:11,600 [INFO] - Created files:
187
+ 2023-11-28 00:39:11,601 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
188
+ 2023-11-28 00:39:11,601 [INFO] - Etherscan scraping script execution completed.
189
+ 2023-11-28 00:39:11,601 [INFO] - Function fetch_and_update_etherscan executed in 24.03 seconds
190
+ 2023-11-28 00:39:25,463 [INFO] - Created files:
191
+ 2023-11-28 00:39:25,464 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
192
+ 2023-11-28 00:39:25,464 [INFO] - Etherscan scraping script execution completed.
193
+ 2023-11-28 00:39:25,464 [INFO] - Function fetch_and_update_etherscan executed in 22.97 seconds
194
+ 2023-11-28 00:41:57,391 [INFO] - Created files:
195
+ 2023-11-28 00:41:57,392 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
196
+ 2023-11-28 00:41:57,392 [INFO] - Etherscan scraping script execution completed.
197
+ 2023-11-28 00:41:57,392 [INFO] - Function fetch_and_update_etherscan executed in 22.96 seconds
198
+ 2023-11-28 00:42:21,289 [INFO] - Created files:
199
+ 2023-11-28 00:42:21,289 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
200
+ 2023-11-28 00:42:21,289 [INFO] - Etherscan scraping script execution completed.
201
+ 2023-11-28 00:42:21,289 [INFO] - Function fetch_and_update_etherscan executed in 26.43 seconds
202
+ 2023-11-28 00:46:02,648 [INFO] - Created files:
203
+ 2023-11-28 00:46:02,648 [INFO] - Updated files: output/transactions_APE.csv, output/transactions_AXIE.csv, output/transactions_GALA.csv, output/transactions_MANA.csv, output/transactions_PET.csv, output/transactions_WEAOPON.csv
204
+ 2023-11-28 00:46:02,648 [INFO] - Etherscan scraping script execution completed.
205
+ 2023-11-28 00:46:02,648 [INFO] - Function fetch_and_update_etherscan executed in 21.07 seconds
logs/scrapping/influencers_balance.log ADDED
File without changes
logs/streamlit/front.log CHANGED
@@ -176,3 +176,196 @@
176
  2023-11-27 23:21:54,811 [INFO] - CMC scraping completed
177
  2023-11-27 23:22:15,775 [INFO] - Etherscan scraping completed
178
  2023-11-27 23:26:43,359 [INFO] - CMC scraping completed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  2023-11-27 23:21:54,811 [INFO] - CMC scraping completed
177
  2023-11-27 23:22:15,775 [INFO] - Etherscan scraping completed
178
  2023-11-27 23:26:43,359 [INFO] - CMC scraping completed
179
+ 2023-11-27 23:32:29,592 [INFO] - Streamlit app has started
180
+ 2023-11-27 23:32:30,264 [INFO] - CMC scraping completed
181
+ 2023-11-27 23:32:34,138 [INFO] - Streamlit app has started
182
+ 2023-11-27 23:32:37,313 [INFO] - Streamlit app has started
183
+ 2023-11-27 23:32:39,895 [INFO] - Streamlit app has started
184
+ 2023-11-27 23:32:52,287 [INFO] - Etherscan scraping completed
185
+ 2023-11-27 23:32:55,329 [INFO] - Streamlit app has started
186
+ 2023-11-27 23:32:57,613 [INFO] - Streamlit app has started
187
+ 2023-11-27 23:34:01,964 [INFO] - Streamlit app has started
188
+ 2023-11-27 23:34:04,098 [INFO] - Streamlit app has started
189
+ 2023-11-27 23:34:10,215 [INFO] - Streamlit app has started
190
+ 2023-11-27 23:34:10,882 [INFO] - CMC scraping completed
191
+ 2023-11-27 23:34:13,138 [INFO] - Streamlit app has started
192
+ 2023-11-27 23:34:14,760 [INFO] - Streamlit app has started
193
+ 2023-11-27 23:34:15,400 [INFO] - CMC scraping completed
194
+ 2023-11-27 23:34:33,717 [INFO] - Etherscan scraping completed
195
+ 2023-11-27 23:34:37,162 [INFO] - Etherscan scraping completed
196
+ 2023-11-27 23:37:18,685 [INFO] - CMC scraping completed
197
+ 2023-11-27 23:38:59,315 [INFO] - CMC scraping completed
198
+ 2023-11-27 23:39:03,833 [INFO] - CMC scraping completed
199
+ 2023-11-27 23:42:07,188 [INFO] - CMC scraping completed
200
+ 2023-11-27 23:43:47,753 [INFO] - CMC scraping completed
201
+ 2023-11-27 23:43:52,502 [INFO] - CMC scraping completed
202
+ 2023-11-27 23:46:58,703 [INFO] - CMC scraping completed
203
+ 2023-11-27 23:48:36,187 [INFO] - CMC scraping completed
204
+ 2023-11-27 23:48:41,072 [INFO] - CMC scraping completed
205
+ 2023-11-27 23:51:49,990 [INFO] - CMC scraping completed
206
+ 2023-11-27 23:53:41,798 [INFO] - Streamlit app has started
207
+ 2023-11-27 23:53:42,395 [INFO] - CMC scraping completed
208
+ 2023-11-27 23:54:04,552 [INFO] - Etherscan scraping completed
209
+ 2023-11-27 23:54:56,822 [INFO] - Streamlit app has started
210
+ 2023-11-27 23:54:57,423 [INFO] - CMC scraping completed
211
+ 2023-11-27 23:55:10,329 [INFO] - Etherscan scraping completed
212
+ 2023-11-27 23:55:12,373 [INFO] - Streamlit app has started
213
+ 2023-11-27 23:55:13,009 [INFO] - CMC scraping completed
214
+ 2023-11-27 23:55:33,990 [INFO] - Etherscan scraping completed
215
+ 2023-11-28 00:00:02,968 [INFO] - CMC scraping completed
216
+ 2023-11-28 00:00:21,807 [INFO] - Streamlit app has started
217
+ 2023-11-28 00:00:22,345 [INFO] - Influencers balance scraping completed
218
+ 2023-11-28 00:00:22,479 [INFO] - CMC scraping completed
219
+ 2023-11-28 00:00:32,165 [INFO] - Etherscan scraping completed
220
+ 2023-11-28 00:00:33,656 [INFO] - Streamlit app has started
221
+ 2023-11-28 00:00:34,195 [INFO] - Influencers balance scraping completed
222
+ 2023-11-28 00:00:34,368 [INFO] - CMC scraping completed
223
+ 2023-11-28 00:00:56,085 [INFO] - Etherscan scraping completed
224
+ 2023-11-28 00:01:05,297 [INFO] - Streamlit app has started
225
+ 2023-11-28 00:01:05,750 [INFO] - Influencers balance scraping completed
226
+ 2023-11-28 00:01:05,921 [INFO] - CMC scraping completed
227
+ 2023-11-28 00:01:16,398 [INFO] - Streamlit app has started
228
+ 2023-11-28 00:01:16,845 [INFO] - Influencers balance scraping completed
229
+ 2023-11-28 00:01:17,106 [INFO] - CMC scraping completed
230
+ 2023-11-28 00:01:27,905 [INFO] - Etherscan scraping completed
231
+ 2023-11-28 00:01:30,236 [INFO] - Streamlit app has started
232
+ 2023-11-28 00:01:30,656 [INFO] - Influencers balance scraping completed
233
+ 2023-11-28 00:01:30,913 [INFO] - CMC scraping completed
234
+ 2023-11-28 00:01:42,295 [INFO] - Etherscan scraping completed
235
+ 2023-11-28 00:01:44,168 [INFO] - Streamlit app has started
236
+ 2023-11-28 00:01:44,643 [INFO] - Influencers balance scraping completed
237
+ 2023-11-28 00:01:44,866 [INFO] - CMC scraping completed
238
+ 2023-11-28 00:02:02,613 [INFO] - Etherscan scraping completed
239
+ 2023-11-28 00:02:09,636 [INFO] - Etherscan scraping completed
240
+ 2023-11-28 00:05:22,793 [INFO] - CMC scraping completed
241
+ 2023-11-28 00:05:54,368 [INFO] - CMC scraping completed
242
+ 2023-11-28 00:06:05,531 [INFO] - CMC scraping completed
243
+ 2023-11-28 00:06:19,440 [INFO] - CMC scraping completed
244
+ 2023-11-28 00:06:33,296 [INFO] - CMC scraping completed
245
+ 2023-11-28 00:16:05,661 [INFO] - Streamlit app has started
246
+ 2023-11-28 00:16:06,310 [INFO] - CMC scraping completed
247
+ 2023-11-28 00:16:06,587 [INFO] - Influencers balance scraping completed
248
+ 2023-11-28 00:16:29,280 [INFO] - Etherscan scraping completed
249
+ 2023-11-28 00:17:37,302 [INFO] - Streamlit app has started
250
+ 2023-11-28 00:17:37,959 [INFO] - CMC scraping completed
251
+ 2023-11-28 00:17:38,217 [INFO] - Influencers balance scraping completed
252
+ 2023-11-28 00:17:59,750 [INFO] - Etherscan scraping completed
253
+ 2023-11-28 00:18:50,436 [INFO] - Streamlit app has started
254
+ 2023-11-28 00:18:50,555 [INFO] - balances uploaded, shape of dataframe is (3, 2)
255
+ 2023-11-28 00:18:51,082 [INFO] - CMC scraping completed
256
+ 2023-11-28 00:18:51,352 [INFO] - Influencers balance scraping completed
257
+ 2023-11-28 00:19:16,960 [INFO] - Etherscan scraping completed
258
+ 2023-11-28 00:20:38,482 [INFO] - Streamlit app has started
259
+ 2023-11-28 00:20:38,863 [INFO] - balances uploaded, shape of dataframe is (3, 2)
260
+ 2023-11-28 00:20:38,863 [INFO] - Balance is not empty
261
+ 2023-11-28 00:20:39,138 [INFO] - CMC scraping completed
262
+ 2023-11-28 00:20:39,434 [INFO] - Influencers balance scraping completed
263
+ 2023-11-28 00:21:02,960 [INFO] - Etherscan scraping completed
264
+ 2023-11-28 00:22:13,322 [INFO] - Streamlit app has started
265
+ 2023-11-28 00:22:13,439 [INFO] - balances uploaded, shape of dataframe is (3, 2)
266
+ 2023-11-28 00:22:13,439 [INFO] - Balance is not empty
267
+ 2023-11-28 00:22:13,958 [INFO] - CMC scraping completed
268
+ 2023-11-28 00:22:14,242 [INFO] - Influencers balance scraping completed
269
+ 2023-11-28 00:22:59,094 [INFO] - Etherscan scraping completed
270
+ 2023-11-28 00:23:01,085 [INFO] - Streamlit app has started
271
+ 2023-11-28 00:23:01,482 [INFO] - balances uploaded, shape of dataframe is (3, 2)
272
+ 2023-11-28 00:23:01,482 [INFO] - Balance is not empty
273
+ 2023-11-28 00:23:01,975 [INFO] - CMC scraping completed
274
+ 2023-11-28 00:23:05,581 [INFO] - Influencers balance scraping completed
275
+ 2023-11-28 00:23:27,142 [INFO] - Etherscan scraping completed
276
+ 2023-11-28 00:23:47,186 [INFO] - Streamlit app has started
277
+ 2023-11-28 00:23:47,327 [INFO] - balances uploaded, shape of dataframe is (3, 2)
278
+ 2023-11-28 00:23:47,328 [INFO] - Balance is not empty
279
+ 2023-11-28 00:23:47,880 [INFO] - CMC scraping completed
280
+ 2023-11-28 00:23:48,138 [INFO] - Influencers balance scraping completed
281
+ 2023-11-28 00:24:09,799 [INFO] - Etherscan scraping completed
282
+ 2023-11-28 00:25:03,453 [INFO] - Streamlit app has started
283
+ 2023-11-28 00:25:03,851 [INFO] - balances uploaded, shape of dataframe is (3, 2)
284
+ 2023-11-28 00:25:03,851 [INFO] - Balance is not empty
285
+ 2023-11-28 00:25:04,099 [INFO] - CMC scraping completed
286
+ 2023-11-28 00:25:04,392 [INFO] - Influencers balance scraping completed
287
+ 2023-11-28 00:25:24,922 [INFO] - Etherscan scraping completed
288
+ 2023-11-28 00:29:04,154 [INFO] - Streamlit app has started
289
+ 2023-11-28 00:29:04,280 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
290
+ 2023-11-28 00:29:04,818 [INFO] - CMC scraping completed
291
+ 2023-11-28 00:29:05,098 [INFO] - Influencers balance scraping completed
292
+ 2023-11-28 00:29:25,819 [INFO] - Etherscan scraping completed
293
+ 2023-11-28 00:29:52,624 [INFO] - CMC scraping completed
294
+ 2023-11-28 00:31:39,706 [INFO] - Streamlit app has started
295
+ 2023-11-28 00:31:39,828 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
296
+ 2023-11-28 00:31:40,455 [INFO] - CMC scraping completed
297
+ 2023-11-28 00:31:40,706 [INFO] - Influencers balance scraping completed
298
+ 2023-11-28 00:32:02,270 [INFO] - Etherscan scraping completed
299
+ 2023-11-28 00:32:28,378 [INFO] - Streamlit app has started
300
+ 2023-11-28 00:32:28,800 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
301
+ 2023-11-28 00:32:29,086 [INFO] - CMC scraping completed
302
+ 2023-11-28 00:32:29,323 [INFO] - Influencers balance scraping completed
303
+ 2023-11-28 00:32:50,023 [INFO] - Etherscan scraping completed
304
+ 2023-11-28 00:32:59,053 [INFO] - Streamlit app has started
305
+ 2023-11-28 00:32:59,440 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
306
+ 2023-11-28 00:32:59,760 [INFO] - CMC scraping completed
307
+ 2023-11-28 00:33:00,008 [INFO] - Influencers balance scraping completed
308
+ 2023-11-28 00:33:23,128 [INFO] - Etherscan scraping completed
309
+ 2023-11-28 00:33:36,115 [INFO] - Streamlit app has started
310
+ 2023-11-28 00:33:36,510 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
311
+ 2023-11-28 00:33:36,789 [INFO] - CMC scraping completed
312
+ 2023-11-28 00:33:37,091 [INFO] - Influencers balance scraping completed
313
+ 2023-11-28 00:33:57,538 [INFO] - Etherscan scraping completed
314
+ 2023-11-28 00:34:46,665 [INFO] - Streamlit app has started
315
+ 2023-11-28 00:34:46,786 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
316
+ 2023-11-28 00:34:47,345 [INFO] - CMC scraping completed
317
+ 2023-11-28 00:34:47,615 [INFO] - Influencers balance scraping completed
318
+ 2023-11-28 00:35:08,147 [INFO] - Etherscan scraping completed
319
+ 2023-11-28 00:36:29,251 [INFO] - Streamlit app has started
320
+ 2023-11-28 00:36:29,364 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
321
+ 2023-11-28 00:36:29,906 [INFO] - CMC scraping completed
322
+ 2023-11-28 00:36:30,223 [INFO] - Influencers balance scraping completed
323
+ 2023-11-28 00:36:52,694 [INFO] - Etherscan scraping completed
324
+ 2023-11-28 00:38:25,244 [INFO] - CMC scraping completed
325
+ 2023-11-28 00:38:30,209 [INFO] - Streamlit app has started
326
+ 2023-11-28 00:38:30,325 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
327
+ 2023-11-28 00:38:30,873 [INFO] - CMC scraping completed
328
+ 2023-11-28 00:38:31,159 [INFO] - Influencers balance scraping completed
329
+ 2023-11-28 00:38:47,173 [INFO] - Streamlit app has started
330
+ 2023-11-28 00:38:47,297 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
331
+ 2023-11-28 00:38:47,855 [INFO] - CMC scraping completed
332
+ 2023-11-28 00:38:48,075 [INFO] - Influencers balance scraping completed
333
+ 2023-11-28 00:38:51,818 [INFO] - Etherscan scraping completed
334
+ 2023-11-28 00:39:02,096 [INFO] - Streamlit app has started
335
+ 2023-11-28 00:39:02,213 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
336
+ 2023-11-28 00:39:02,789 [INFO] - CMC scraping completed
337
+ 2023-11-28 00:39:03,019 [INFO] - Influencers balance scraping completed
338
+ 2023-11-28 00:39:11,636 [INFO] - Etherscan scraping completed
339
+ 2023-11-28 00:39:25,504 [INFO] - Etherscan scraping completed
340
+ 2023-11-28 00:39:35,829 [INFO] - CMC scraping completed
341
+ 2023-11-28 00:41:18,387 [INFO] - CMC scraping completed
342
+ 2023-11-28 00:41:34,014 [INFO] - Streamlit app has started
343
+ 2023-11-28 00:41:34,141 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
344
+ 2023-11-28 00:41:34,945 [INFO] - Influencers balance scraping completed
345
+ 2023-11-28 00:41:35,102 [INFO] - CMC scraping completed
346
+ 2023-11-28 00:41:54,448 [INFO] - Streamlit app has started
347
+ 2023-11-28 00:41:54,587 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
348
+ 2023-11-28 00:41:55,142 [INFO] - CMC scraping completed
349
+ 2023-11-28 00:41:55,379 [INFO] - Influencers balance scraping completed
350
+ 2023-11-28 00:41:57,427 [INFO] - Etherscan scraping completed
351
+ 2023-11-28 00:42:21,330 [INFO] - Etherscan scraping completed
352
+ 2023-11-28 00:43:13,716 [INFO] - CMC scraping completed
353
+ 2023-11-28 00:43:19,307 [INFO] - CMC scraping completed
354
+ 2023-11-28 00:43:36,329 [INFO] - CMC scraping completed
355
+ 2023-11-28 00:43:51,243 [INFO] - CMC scraping completed
356
+ 2023-11-28 00:44:24,288 [INFO] - CMC scraping completed
357
+ 2023-11-28 00:45:41,175 [INFO] - Streamlit app has started
358
+ 2023-11-28 00:45:41,291 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
359
+ 2023-11-28 00:45:41,896 [INFO] - CMC scraping completed
360
+ 2023-11-28 00:45:42,150 [INFO] - Influencers balance scraping completed
361
+ 2023-11-28 00:46:02,684 [INFO] - Etherscan scraping completed
362
+ 2023-11-28 00:46:06,833 [INFO] - CMC scraping completed
363
+ 2023-11-28 00:46:23,599 [INFO] - CMC scraping completed
364
+ 2023-11-28 00:46:43,588 [INFO] - CMC scraping completed
365
+ 2023-11-28 00:47:17,582 [INFO] - Streamlit app has started
366
+ 2023-11-28 00:47:17,698 [INFO] - Balances uploaded, shape of dataframe is (3, 2)
367
+ 2023-11-28 00:47:27,768 [INFO] - Streamlit app has started
368
+ 2023-11-28 00:47:27,856 [INFO] - Streamlit app has started
369
+ 2023-11-28 00:47:28,807 [INFO] - Balances uploaded, shape of dataframe is (4, 2)
370
+ 2023-11-28 00:48:02,170 [INFO] - CMC scraping completed
371
+ 2023-11-28 00:48:07,741 [INFO] - CMC scraping completed
output/cmc_data_v1_cryptocurrency_listings_latest_100.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f6565d58fdcb4f22b4ba93cb879ca3c74d71096a5b1ed911e625c35ae56432a0
3
- size 119080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5be145c802161fd6ec2f4932bd5c782d41e2c1e166a966bdaf080955e45397eb
3
+ size 119005
output/influencers_balances.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a132619b2c97f10e5a84b873ea52f108b2a9e61d1f18f8d2aeaf4140a22b7bc
3
+ size 247
output/top_100_update.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:767a255420ffd1a3e5480673610f1ca21a10b9c2a9f402d8a421212f5e63270e
3
- size 129574
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e6bafeb039ce6f24f145e6ebbec3eacbec576d432111ce9767686e3a85ccdf3
3
+ size 748449
output/transactions_APE.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1fe609b08835b469af3f98a03959a75ecaaa119d50d222bd95981117cce95a56
3
- size 3430047
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd20aeb6fc41c40b6d62bf00c3921bfa5cc0c803aea1a2817656db5efdebf81c
3
+ size 3457395
output/transactions_AXIE.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:497efc710a52dfb17f9dacc50500293cde3450644a84069fbdd4c1cae8462b37
3
- size 1586211
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1bcc9db49c214ca61d447a783162785e1e3a2e11cc5b037e8430addfbfd42d9
3
+ size 1610374
output/transactions_GALA.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dbdcc912f4193543018955be769a5418e98ab8dd3ebfaec7e47b290ac7c74f5d
3
- size 4094956
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c382d5715b1551fe22176130dd9b139d446339819cfe22eb8e55cbdaf391858
3
+ size 4164007
output/transactions_MANA.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d530a0dd8a8f62f11f8c912b0f90cccc849349fa743873d05fbc5c14254fa84b
3
- size 2223053
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:954bb98d20c48c0e62cb3349dbaeb4af1499c5738f664f4434cd170d9351b787
3
+ size 2237025
ressources/dict_influencers_addr.json CHANGED
@@ -1,4 +1,6 @@
1
- {"alexBecker":"0x4d224452801aced8b2f0aebe155379bb5d594381",
2
- "elliotrades":"0xc02f318365582557a482eb5d1834dfd7af4a3f59",
3
- "jrny":"0x08c1ae7e46d4a13b766566033b5c47c735e19f6f"
4
- }
 
 
 
1
+ {
2
+ "alexBecker": "0x4d224452801aced8b2f0aebe155379bb5d594381",
3
+ "elliotrades": "0xc02f318365582557a482eb5d1834dfd7af4a3f59",
4
+ "jrny": "0x08c1ae7e46d4a13b766566033b5c47c735e19f6f",
5
+ "momo": "0x17770D4A8C0d068be7eB5b7AF453f9E176E52464"
6
+ }
scrap_data_cmc.py DELETED
@@ -1,90 +0,0 @@
1
- #-------------------------------------libraries ----------------------------------
2
-
3
- from requests import Request, Session
4
- from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
5
- import json
6
- import os
7
- import pandas as pd
8
- import numpy as np
9
- import logging
10
- from dotenv import load_dotenv
11
- load_dotenv()
12
-
13
- #-------------------------------------env vars----------------------------------
14
-
15
- url = os.getenv("URL_CMC")
16
- endpoints = ["v1/cryptocurrency/listings/latest",
17
- #"/v1/cryptocurrency/trending/latest",
18
- ]
19
- start = "1"
20
- stop = "100"
21
- parameters = {
22
- 'start':start,
23
- 'limit':stop,
24
- 'convert':'USD'
25
- }
26
- headers = {
27
- 'Accepts': 'application/json',
28
- 'X-CMC_PRO_API_KEY': os.getenv("API_KEY_CMC"),
29
- }
30
-
31
- # Configure the logging settings
32
- log_folder = "./logs/scrapping/"
33
- os.makedirs(log_folder, exist_ok=True) # Ensure the log folder exists
34
- log_file = os.path.join(log_folder, "scrapping.log")
35
- log_format = "%(asctime)s [%(levelname)s] - %(message)s"
36
- logging.basicConfig(filename=log_file, level=logging.INFO, format=log_format)
37
-
38
- #-------------------------------------api call----------------------------------
39
-
40
- session = Session()
41
- session.headers.update(headers)
42
-
43
- for endpoint in endpoints:
44
- target = f"{url}/{endpoint}"
45
- try:
46
- response = session.get(target, params=parameters)
47
- data = json.loads(response.text)
48
- with open(f'output/cmc_data_{endpoint.replace("/", "_")}_{stop}.json', 'w') as f:
49
- json.dump(data, f)
50
- logging.info(f"Successfully fetched data from {target}")
51
- except (ConnectionError, Timeout, TooManyRedirects) as e:
52
- logging.error(f"Error while fetching data from {target}: {e}")
53
-
54
- #-------------------------------------process data----------------------------------
55
-
56
- # create data frame with chosen columns
57
- df = pd.DataFrame(data["data"])[["name","symbol","circulating_supply","total_supply","quote"]]
58
- # explode column quote then chose columns
59
- quote_df = pd.json_normalize(df['quote'].apply(lambda x: x['USD']))[["price","percent_change_24h","percent_change_7d","percent_change_90d","market_cap","fully_diluted_market_cap","last_updated"]]
60
- # drop quote
61
- df = df.drop("quote",axis=1)
62
- # create features
63
- df["percent_tokens_circulation"] = np.round((df["circulating_supply"]/df["total_supply"])*100,1)
64
- # merge dataframe
65
- df = df.join(quote_df)
66
- df["last_updated"] = pd.to_datetime(df["last_updated"])
67
- df.to_csv(f"output/top_{stop}_update.csv")
68
-
69
- #-------------------------------------save data----------------------------------
70
-
71
- # Check if the file exists
72
- output_file = f"output/top_{stop}_update.csv"
73
- if os.path.isfile(output_file):
74
- logging.info("Updating dataset"+f"top_{stop}_update"+". ")
75
- # Read the existing data
76
- existing_data = pd.read_csv(output_file)
77
- # Concatenate the existing data with the new data vertically
78
- updated_data = pd.concat([existing_data, df], axis=0, ignore_index=True)
79
- # Remove duplicates (if any) based on a unique identifier column
80
- updated_data.drop_duplicates(subset=["symbol", "last_updated"], inplace=True)
81
- # Save the updated data back to the same file
82
- updated_data.to_csv(output_file, index=False)
83
- else:
84
- # If the file doesn't exist, save the current data to it
85
- df.to_csv(output_file, index=False)
86
- logging.info("Script execution completed.")
87
-
88
-
89
-
90
- #-------------------------------------end----------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scrap_data_etherscan.py DELETED
@@ -1,17 +0,0 @@
1
- import requests
2
- import time
3
- import pandas as pd
4
- import json
5
- import os
6
- from utils.scrap import update_and_save_csv
7
-
8
- # Create output folder
9
- if not os.path.exists("output"):
10
- os.makedirs("output")
11
-
12
- # Load the JSON file into a dictionary
13
- print(os.getcwd())
14
- with open("ressources/dict_tokens_addr.json", "r") as file:
15
- dict_addresses = json.load(file)
16
-
17
- update_and_save_csv(dict_addresses)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
utils/scrap.py DELETED
@@ -1,198 +0,0 @@
1
- # ---------------------- Library Imports ----------------------
2
- import time
3
- import os
4
- import json
5
- import pandas as pd
6
- import numpy as np
7
- import logging
8
- import requests
9
- from dotenv import load_dotenv
10
- from requests import Session
11
-
12
- # ---------------------- Environment Variables ----------------------
13
-
14
- load_dotenv()
15
- # Etherscan API
16
- url_etherscan = os.getenv("URL_ETHERSCAN")
17
- api_key_etherscan = os.getenv("API_KEY_ETHERSCAN")
18
-
19
- # CoinMarketCap API
20
- url_cmc = os.getenv("URL_CMC")
21
- api_key_cmc = os.getenv("API_KEY_CMC")
22
-
23
- # Logging
24
- log_folder = os.getenv("LOG_FOLDER")
25
- os.makedirs(log_folder, exist_ok=True)
26
- log_file = os.path.join(log_folder, "scrapping.log")
27
- log_format = "%(asctime)s [%(levelname)s] - %(message)s"
28
- logging.basicConfig(filename=log_file, level=logging.INFO, format=log_format)
29
-
30
- # Load the JSON file into a dictionary
31
- with open("ressources/dict_tokens_addr.json", "r") as file:
32
- dict_addresses = json.load(file)
33
-
34
- L_created = []
35
- L_updated = []
36
-
37
- # Define the number of blocks to retrieve transactions from
38
- n_blocks = 20000
39
- n_loop = n_blocks // 10_000
40
-
41
- # ---------------------- Processing ----------------------
42
-
43
- # Helper function for logging execution time
44
- def log_execution_time(func):
45
- def wrapper(*args, **kwargs):
46
- start_time = time.time()
47
- result = func(*args, **kwargs)
48
- end_time = time.time()
49
- logging.info(f"Function {func.__name__} executed in {end_time - start_time:.2f} seconds")
50
- return result
51
- return wrapper
52
-
53
-
54
- @log_execution_time
55
- # function 1: Fetch and Update Etherscan Data
56
- def fetch_and_update_etherscan():
57
- for tokenSymbol, contractAddr in dict_addresses.items():
58
- file = f"output/transactions_{tokenSymbol}.csv"
59
- if not os.path.exists(file):
60
- L_created.append(file)
61
- df_transactions = get_coin_data(contractAddr, n_loop)
62
- df_transactions_no_dup = df_transactions.drop(["confirmations", "input"], axis=1).drop_duplicates(subset="hash")
63
- df_transactions_no_dup.to_csv(file, sep=",", index=False)
64
- else:
65
- L_updated.append(file)
66
- df_temp = pd.read_csv(file, sep=",")
67
- df_temp = df_temp.sort_values("blockNumber", ascending=False)
68
- start_block = df_temp["blockNumber"].iloc[0]
69
-
70
- # Retrieve latest block number and calculate the difference
71
- latest_block_number, diff = latest_block(start_block)
72
- if latest_block_number is None:
73
- logging.error(f"Failed to retrieve latest block number for token: {tokenSymbol}")
74
- continue # Skip to the next token if the latest block number could not be retrieved
75
-
76
- n_loop_to_concat = (diff // 10000) + 1
77
- df_transactions = get_coin_data(contractAddr, n_loop_to_concat)
78
- df_latest = pd.concat([df_transactions, df_temp]).drop(["confirmations", "input"], axis=1)
79
- df_latest_no_dup = df_latest.drop_duplicates(subset="hash")
80
- df_latest_no_dup.loc[:, "blockNumber"] = df_latest_no_dup["blockNumber"].astype(int)
81
- df_latest_no_dup = df_latest_no_dup.sort_values(by="blockNumber")
82
- df_latest_no_dup.to_csv(file, sep=",", index=False)
83
-
84
- logging.info("Created files: " + ", ".join(L_created))
85
- logging.info("Updated files: " + ", ".join(L_updated))
86
- logging.info("Script execution completed.")
87
-
88
- # Helper function to get latest block number
89
- def latest_block(start_block=None):
90
- params = {
91
- "module": "proxy",
92
- "action": "eth_blockNumber",
93
- "apikey": api_key_etherscan
94
- }
95
- response = requests.get(url_etherscan, params=params)
96
- if response.status_code == 200:
97
- try:
98
- latest_block_number = int(response.json()["result"], 16)
99
- if start_block is not None:
100
- return latest_block_number, latest_block_number - start_block
101
- return latest_block_number
102
- except (ValueError, KeyError):
103
- logging.error(f"Invalid response format or missing data in response: {response.json()}")
104
- return None, None
105
- else:
106
- logging.error(f"API call failed with status code {response.status_code}: {response.json()}")
107
- return None, None
108
-
109
- def get_coin_data(contractAddr, n):
110
- latest_block_number = latest_block()
111
- if latest_block_number is None:
112
- logging.error(f"Could not retrieve latest block number for contract address {contractAddr}")
113
- return pd.DataFrame() # Return an empty DataFrame
114
-
115
- df_transactions = pd.DataFrame()
116
- transactions_per_call = 10_000
117
- for i in range(n):
118
- start_block = latest_block_number - (n - i) * transactions_per_call
119
- end_block = latest_block_number - (n - 1 - i) * transactions_per_call
120
- params = {
121
- "module": "account",
122
- "action": "tokentx",
123
- "contractaddress": contractAddr,
124
- "startblock": start_block,
125
- "endblock": end_block,
126
- "sort": "asc",
127
- "apikey": api_key_etherscan
128
- }
129
- response = requests.get(url_etherscan, params=params)
130
- transactions = response.json().get("result", [])
131
-
132
- # Check if transactions is a list of dictionaries
133
- if not isinstance(transactions, list) or not all(isinstance(item, dict) for item in transactions):
134
- logging.error(f"Invalid data format for transactions: {transactions}")
135
- continue # Skip this iteration if transactions data is invalid
136
-
137
- df_temp = pd.DataFrame(transactions)
138
- if not df_temp.empty:
139
- df_transactions = pd.concat([df_transactions, df_temp])
140
- time.sleep(1)
141
-
142
- if 'timeStamp' in df_transactions:
143
- df_transactions['timeStamp'] = pd.to_datetime(df_transactions['timeStamp'].astype(int), unit='s')
144
- else:
145
- logging.error("'timeStamp' key not found in the response data.")
146
- return pd.DataFrame() # Return an empty DataFrame if key is missing
147
- df_transactions['value'] = df_transactions['value'].astype(float) / 1e18
148
- return df_transactions
149
-
150
- # function 2: Fetch and Process CMC Data
151
- @log_execution_time
152
- def fetch_and_process_cmc_data():
153
- session = Session()
154
- session.headers.update({
155
- 'Accepts': 'application/json',
156
- 'X-CMC_PRO_API_KEY': api_key_cmc,
157
- })
158
- parameters = {
159
- 'start': '1',
160
- 'limit': '100',
161
- 'convert': 'USD'
162
- }
163
-
164
- for endpoint in ["v1/cryptocurrency/listings/latest"]:
165
- target = f"{url_cmc}/{endpoint}"
166
- try:
167
- response = session.get(target, params=parameters)
168
- data = json.loads(response.text)
169
- with open(f'output/cmc_data_{endpoint.replace("/", "_")}_100.json', 'w') as f:
170
- json.dump(data, f)
171
- process_cmc_data(data, '100')
172
- except (ConnectionError, Timeout, TooManyRedirects) as e:
173
- logging.error(f"Error while fetching data from {target}: {e}")
174
-
175
- def process_cmc_data(data, stop):
176
- df = pd.DataFrame(data["data"])[["name", "symbol", "circulating_supply", "total_supply", "quote"]]
177
- quote_df = pd.json_normalize(df['quote'].apply(lambda x: x['USD']))[["price", "percent_change_24h", "percent_change_7d", "percent_change_90d", "market_cap", "fully_diluted_market_cap", "last_updated"]]
178
- df = df.drop("quote", axis=1)
179
- df["percent_tokens_circulation"] = np.round((df["circulating_supply"] / df["total_supply"]) * 100, 1)
180
- df = df.join(quote_df)
181
- df["last_updated"] = pd.to_datetime(df["last_updated"])
182
- save_cmc_data(df, stop)
183
-
184
- def save_cmc_data(df, stop):
185
- output_file = f"output/top_{stop}_update.csv"
186
- if os.path.isfile(output_file):
187
- existing_data = pd.read_csv(output_file)
188
- updated_data = pd.concat([existing_data, df], axis=0, ignore_index=True)
189
- updated_data.drop_duplicates(subset=["symbol", "last_updated"], inplace=True)
190
- updated_data.to_csv(output_file, index=False)
191
- else:
192
- df.to_csv(output_file, index=False)
193
- logging.info("CMC data script execution completed.")
194
-
195
- # ---------------------- Execution ----------------------
196
- if __name__ == "__main__":
197
- fetch_and_update_etherscan()
198
- fetch_and_process_cmc_data()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
utils/scrap_influencers_balance.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # utils/scrap_influencers_balance.py
2
+ import requests
3
+ import pandas as pd
4
+ import json
5
+ import os
6
+ from dotenv import load_dotenv
7
+
8
+ # Load environment variables
9
+ load_dotenv()
10
+ API_KEY = os.getenv('API_KEY_ETHERSCAN')
11
+ URL_ETHERSCAN = "https://api.etherscan.io/api"
12
+
13
+ def fetch_ether_balance(addresses):
14
+ params = {
15
+ 'module': 'account',
16
+ 'action': 'balancemulti',
17
+ 'address': ','.join(addresses),
18
+ 'tag': 'latest',
19
+ 'apikey': API_KEY
20
+ }
21
+ response = requests.get(URL_ETHERSCAN, params=params)
22
+ return response.json()
23
+
24
+ def main():
25
+ # Load influencers
26
+ with open("ressources/dict_influencers_addr.json", "r") as file:
27
+ influencers = json.load(file)
28
+
29
+ addresses = list(influencers.values())
30
+ response = fetch_ether_balance(addresses)
31
+
32
+ if response["status"] == "1":
33
+ df_balances = pd.DataFrame(response["result"])
34
+ df_balances.to_csv("output/influencers_balances.csv", index=False)
35
+ else:
36
+ print("Failed to fetch balances:", response.get("message", "Unknown error"))
37
+
38
+ if __name__ == "__main__":
39
+ main()