Merge branch 'master' of https://gitlab.com/usi-si-teaching/msde/2022-2023/visual-analytics-atelier/group-projects/group-1
2
.vscode/settings.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.autopep8"
|
||||
"editor.defaultFormatter": "ms-python.python"
|
||||
},
|
||||
"python.formatting.provider": "none"
|
||||
}
|
24
backend/api/companies.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import os
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from scraper.top100_extractor import programming_crime_list
|
||||
COMPANIES_CSV_PATH: str = 'scraper/companies.csv'
|
||||
|
||||
def non_nan(a: list[any]) -> list[any]:
|
||||
return list(filter(lambda a: type(a) == str or not np.isnan(a), a))
|
||||
|
||||
|
||||
def get_companies(root_dir: str) -> list[dict]:
|
||||
"""
|
||||
reads the companies.csv file and returns it as a JSON-ifiable object
|
||||
to return to the frontend.
|
||||
"""
|
||||
df = pd.read_csv(os.path.join(root_dir, COMPANIES_CSV_PATH), index_col='ticker')
|
||||
tickers = pd.Series(programming_crime_list)
|
||||
df = df.loc[df.index.isin(tickers), :]
|
||||
df['tags'] = df[['tag 1', 'tag 2', 'tag 3']].values.tolist()
|
||||
df['tags'] = df['tags'].apply(non_nan)
|
||||
del df['tag 1']
|
||||
del df['tag 2']
|
||||
del df['tag 3']
|
||||
return df.reset_index().replace({ np.nan: None }).to_dict('records')
|
BIN
scraper/logos/logos/A.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
scraper/logos/logos/AA.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
scraper/logos/logos/AABA.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
scraper/logos/logos/AADR.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
scraper/logos/logos/AAL.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
scraper/logos/logos/AAN.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/AAOI.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
scraper/logos/logos/AAON.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
scraper/logos/logos/AAP.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
scraper/logos/logos/AAPL.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
scraper/logos/logos/AAT.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
scraper/logos/logos/AAWW.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/AAXJ.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
scraper/logos/logos/AAXN.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/AB.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
scraper/logos/logos/ABB.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
scraper/logos/logos/ABBV.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
scraper/logos/logos/ABC.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
scraper/logos/logos/ABCB.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
scraper/logos/logos/ABEO.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
scraper/logos/logos/ABEV.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
scraper/logos/logos/ABG.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
scraper/logos/logos/ABM.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
scraper/logos/logos/ABMD.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
scraper/logos/logos/ABR.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
scraper/logos/logos/ABT.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
scraper/logos/logos/ABTX.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
scraper/logos/logos/ACAD.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
scraper/logos/logos/ACB.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
scraper/logos/logos/ACBI.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
scraper/logos/logos/ACC.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
scraper/logos/logos/ACCO.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
scraper/logos/logos/ACER.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
scraper/logos/logos/ACGL.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
scraper/logos/logos/ACH.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
scraper/logos/logos/ACHN.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
scraper/logos/logos/ACHV.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
scraper/logos/logos/ACIA.png
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
scraper/logos/logos/ACIU.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
scraper/logos/logos/ACIW.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
scraper/logos/logos/ACLS.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
scraper/logos/logos/ACM.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
scraper/logos/logos/ACN.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
scraper/logos/logos/ACOR.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
scraper/logos/logos/ACRX.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
scraper/logos/logos/ACST.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
scraper/logos/logos/ACTG.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
scraper/logos/logos/ACU.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
scraper/logos/logos/ACV.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
scraper/logos/logos/ACWI.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
scraper/logos/logos/ACWV.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
scraper/logos/logos/ACWX.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
scraper/logos/logos/ADAP.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/ADBE.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
scraper/logos/logos/ADI.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
scraper/logos/logos/ADIL.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
scraper/logos/logos/ADM.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
scraper/logos/logos/ADMA.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
scraper/logos/logos/ADMP.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
scraper/logos/logos/ADNT.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
scraper/logos/logos/ADP.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
scraper/logos/logos/ADRA.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
scraper/logos/logos/ADRD.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
scraper/logos/logos/ADRE.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
scraper/logos/logos/ADRU.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
scraper/logos/logos/ADSK.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/ADSW.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
scraper/logos/logos/ADT.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
scraper/logos/logos/ADXS.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
scraper/logos/logos/AE.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
scraper/logos/logos/AEE.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
scraper/logos/logos/AEG.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
scraper/logos/logos/AEGN.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
scraper/logos/logos/AEIS.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
scraper/logos/logos/AEL.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
scraper/logos/logos/AEM.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
scraper/logos/logos/AEMD.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
scraper/logos/logos/AEO.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
scraper/logos/logos/AEP.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
scraper/logos/logos/AER.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
scraper/logos/logos/AES.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
scraper/logos/logos/AETI.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
scraper/logos/logos/AEYE.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
scraper/logos/logos/AEZS.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
scraper/logos/logos/AFB.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
scraper/logos/logos/AFG.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
scraper/logos/logos/AFH.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
scraper/logos/logos/AFL.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
scraper/logos/logos/AG.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
scraper/logos/logos/AGCO.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
scraper/logos/logos/AGE.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
scraper/logos/logos/AGEN.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
scraper/logos/logos/AGFS.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
scraper/logos/logos/AGG.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
scraper/logos/logos/AGI.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
scraper/logos/logos/AGIO.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
scraper/logos/logos/AGM.A.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
scraper/logos/logos/AGM.png
Normal file
After Width: | Height: | Size: 13 KiB |