fix
filtering things
loisense
This script gets data from Koyfin. In order for it to work:
key
of form eq-...
representing
a specific company on a specific exchange).
This can be done by looking at keys
api method.
Then you can download companies' json results and filter them, example:cat *.txt | jq ".KID | to_entries[] | {key, ticker: .value.t, name: .value.t_n, country: .value.iso2, industry:
.value.t_ind, sector: .value.t_sec}" > parsed_companies
[optional] You can also parse companies' names and info to a separate csv file using
jq -s -r -f filter.jq parsed_companies > data/companies.csv
Create a file payloads
with information to retrieve from Koyfin.
It should hold lines of pairs name json_payload
, one for each indicator.
Note Koyfin api is private and can change at any time. An example is provided.
Run koyfin.py
to obtain json files with data.
Some indicators may be missing for some companies, use this script to remove files with errors:
ag "(no data in|not available)" data/ -c | cut -d: -f1 | xargs rm
.
Run merge.py
to merge obtained data into csv files, one per company.
You may need to tweak it if you change payloads
.