-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaygrounds.py
More file actions
45 lines (40 loc) · 1.2 KB
/
playgrounds.py
File metadata and controls
45 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import argparse
import os
import requests
from bs4 import BeautifulSoup
import datetime
from tqdm import tqdm
import pandas as pd
import numpy as np
import streamlit
import p_acquisition.m_acquisition_lean as acq
import p_wrangling.m_wrangling as wra
import p_analysis
import p_reporting
fondos=[]
dict_links=acq.get_links_from_csv()
i=0
for fondo in fondos:
a=datetime.datetime.now()
print(f'{i}/{len(fondos)} - {fondo}-{a}')
#if os.path.isfile(f'data/csv/{fondo}.csv'):
# os.remove(f'data/csv/{fondo}.csv')
# print(f'{fondo}.csv deleted')
link=dict_links[fondo]
try:acq.get_info_fondo(fondo,link)
except:
import json
import telegram
def notify_ending(message):
with open('../keys.json', 'r') as keys_file:
k = json.load(keys_file)
token = k['telegram_token']
chat_id = k['telegram_chat_id']
bot = telegram.Bot(token=token)
bot.sendMessage(chat_id=chat_id, text=message)
notify_ending('ha petau')
raise EOFError
i+=1
print(f'Elapsed time: {(datetime.datetime.now() -a).total_seconds()/60} minutes')
fondo_df=wra.inspect_data(fondo)
print('finished!')