update congress db

This commit is contained in:
MuslemRahimi 2024-08-03 23:48:33 +02:00
parent e577eb72a4
commit 1da2cc586f
5 changed files with 8 additions and 6 deletions

View File

@ -62,7 +62,7 @@ crypto_con.close()
load_dotenv()
api_key = os.getenv('FMP_API_KEY')
quarter_date = '2024-6-30'
quarter_date = '2024-03-31'
if os.path.exists("backup_db/institute.db"):

View File

@ -98,6 +98,7 @@ def replace_representative(office):
'Blunt, Roy (Senator)': 'Roy Blunt',
'Thune, John (Senator)': 'John Thune',
'Rosen, Jacky (Senator)': 'Jacky Rosen',
'Britt, Katie (Senator)': 'Katie Britt',
'James Costa': 'Jim Costa',
'Lummis, Cynthia (Senator)': 'Cynthia Lummis',
'Coons, Chris (Senator)': 'Chris Coons',
@ -170,7 +171,7 @@ async def get_endpoints(symbol, session):
if any('exchange' in word.lower() for word in item['type'].split()):
item['type'] = 'Exchange'
if 'representative' in item:
item['representative'] = replace_representative(item['representative'])

View File

@ -21,8 +21,8 @@ def save_json(data):
ujson.dump(data, file)
identifier = 'GME'
source = 'cta_a_delayed'
identifier = 'INTC'
source = 'utp_delayed'
start_date, end_date = GetStartEndDate().run()
start_date = start_date.strftime("%Y-%m-%d")
end_date = end_date.strftime("%Y-%m-%d")
@ -42,8 +42,8 @@ def get_data():
if count == 0:
next_page = ''
try:
response = intrinio.SecurityApi().get_security_trades(
source, start_date=start_date, start_time=start_time,
response = intrinio.SecurityApi().get_security_trades_by_symbol(
identifier, source, start_date=start_date, start_time=start_time,
end_date=end_date, end_time=end_time, timezone=timezone,
page_size=page_size, darkpool_only=darkpool_only, min_size=min_size,
next_page=next_page

View File

@ -580,6 +580,7 @@ def replace_representative(office):
'Blunt, Roy (Senator)': 'Roy Blunt',
'Thune, John (Senator)': 'John Thune',
'Rosen, Jacky (Senator)': 'Jacky Rosen',
'Britt, Katie (Senator)': 'Katie Britt',
'James Costa': 'Jim Costa',
'Lummis, Cynthia (Senator)': 'Cynthia Lummis',
'Coons, Chris (Senator)': 'Chris Coons',