portfolioplus / pytickersymbols Goto Github PK
View Code? Open in Web Editor NEWFundamental stock data and yahoo/google ticker symbols for several indices.
License: MIT License
Fundamental stock data and yahoo/google ticker symbols for several indices.
License: MIT License
Hi,
thanks for providing this ressource. It's nicely done.
Just some questions:
Take care
get_stocks_by_index('IBEX 35') does not return the 35 components of the index IBEX 35
According to the official website https://www.bolsasymercados.es/bme-exchange/es/Mercados-y-Cotizaciones/Acciones/Mercado-Continuo/Precios/ibex-35-ES0SI0000005
Acciona Ener, Logista, Unicaja and Sacyr are missing and, for instance, Siemmens Gamesa should not be there.
There are a bunch of automatically generated PRs to increment the DB, is there any plan for merging them?
I am new in programming, feel free to give feedback if his is not the most appropriate way to post this question.
get_all_countries() is returning the cities [[Paris]] and [[Cleveland]] and also 'en'
Is that the purpose?
FYI
=> get_all_countries():
['', 'Isle of Man', 'en', 'China', 'France', 'Luxembourg', 'Bermuda', 'Russia', '[[Paris]]', 'South Africa', 'Spain', 'United States', 'Mexico', 'Argentina', 'Sweden', 'Czechia', 'Australia', 'Italy', '[[Cleveland]]', 'Austria', 'Netherlands', 'Canada', 'United Kingdom', 'Switzerland', 'Belgium', 'Israel', 'Germany', 'Russian Federation', 'Ireland', 'Finland']
=> get_stocks_by_country('en'):
{'name': 'Dow Inc.', 'wiki_name': 'Dow Inc.', 'symbol': 'DOW', 'country': 'en', 'indices': ['DOW JONES', 'S&P 100', 'S&P 500'], 'industries': ['Chemicals'], 'symbols': [{'yahoo': 'DOW', 'google': 'NYSE:DOW', 'currency': 'USD'}], 'isins': [], 'metadata': {'founded': 2019, 'employees': 36500}, 'id': 1001}
=> get_stocks_by_country('[[Paris]]'):
{'name': 'Ipsos SA', 'wiki_name': 'Ipsos SA', 'symbol': 'IPZ', 'country': '[[Paris]]', 'indices': ['CAC Mid 60'], 'industries': ['Public opinion research'], 'symbols': [{'yahoo': 'IPZ.F', 'google': 'FRA:IPZ', 'currency': 'EUR'}], 'isins': ['FR0000073298'], 'metadata': {'founded': 1975, 'employees': 16664}, 'id': 1082}
=> get_stocks_by_country('[[Cleveland]]'):
{'name': 'KeyBank', 'wiki_name': 'KeyBank', 'symbol': 'KEY', 'country': '[[Cleveland]]', 'indices': ['S&P 500'], 'industries': ['Financial services'], 'symbols': [{'yahoo': 'KEY', 'google': 'NYSE:KEY', 'currency': 'USD'}], 'isins': [], 'metadata': {'founded': 1825, 'employees': 17999}, 'id': 1008}
=> get_stocks_by_country(''):
These countries seem to have no country? just check if that is correct?
{'name': 'Norfolk Southern Corp.', 'wiki_name': 'Norfolk Southern Corp.', 'symbol': 'NSC', 'country': '', 'indices': ['S&P 500'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1018}
{'name': 'Pool Corporation', 'wiki_name': 'Pool Corporation', 'symbol': 'POOL', 'country': '', 'indices': ['S&P 500'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1026}
{'name': 'IMCD', 'wiki_name': 'IMCD', 'symbol': 'IMCD', 'country': '', 'indices': ['AEX'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1049}
{'name': 'DBV Technologies', 'wiki_name': 'DBV Technologies', 'symbol': 'DBVT', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': 'DBVT', 'google': 'NASDAQ:DBVT', 'currency': 'USD'}, {'yahoo': 'DBVA.F', 'google': 'FRA:DBVA', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1065}
{'name': 'Elior Group', 'wiki_name': 'Elior Group', 'symbol': '21E', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': '21E.F', 'google': 'FRA:21E', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1066}
{'name': 'Genfit', 'wiki_name': 'Genfit', 'symbol': 'XUP', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': 'XUP.F', 'google': 'FRA:XUP', 'currency': 'EUR'}, {'yahoo': 'GNFTF', 'google': 'OTCMKTS:GNFTF', 'currency': 'USD'}, {'yahoo': 'GNFT', 'google': 'NASDAQ:GNFT', 'currency': 'USD'}, {'yahoo': 'XUPB.F', 'google': 'FRA:XUPB', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1076}
{'name': 'Gaztransport & Technigaz', 'wiki_name': 'Gaztransport & Technigaz', 'symbol': '9TG', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': '9TG.F', 'google': 'FRA:9TG', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1077}
{'name': 'Mercialys', 'wiki_name': 'Mercialys', 'symbol': 'MEIYF', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': 'MEIYF', 'google': 'OTCMKTS:MEIYF', 'currency': 'USD'}, {'yahoo': 'M8Y.F', 'google': 'FRA:M8Y', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1087}
{'name': 'TF1 Group', 'wiki_name': 'TF1 Group', 'symbol': None, 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1101}
{'name': 'Virbac', 'wiki_name': 'Virbac', 'symbol': 'VRBCF', 'country': '', 'indices': ['CAC Mid 60'], 'industries': [], 'symbols': [{'yahoo': 'VRBCF', 'google': 'OTCMKTS:VRBCF', 'currency': 'USD'}, {'yahoo': 'V16.F', 'google': 'FRA:V16', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1105}
{'name': 'Aedifica', 'wiki_name': 'Aedifica', 'symbol': None, 'country': '', 'indices': ['BEL 20'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1114}
{'name': 'WDP', 'wiki_name': 'WDP', 'symbol': None, 'country': '', 'indices': ['BEL 20'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1120}
{'name': 'Kojamo', 'wiki_name': 'Kojamo', 'symbol': 'KOJAMO', 'country': '', 'indices': ['OMX Helsinki 25'], 'industries': [], 'symbols': [{'yahoo': 'V4OC.F', 'google': 'FRA:V4OC', 'currency': 'EUR'}], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1127}
{'name': 'TCS Group', 'wiki_name': 'TCS Group', 'symbol': None, 'country': '', 'indices': ['MOEX'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 0, 'employees': 0}, 'id': 1172}
List for SMI stock exchange is empty.
from pytickersymbols import PyTickerSymbols
File "/usr/local/lib/python2.7/dist-packages/pytickersymbols/init.py", line 26
class PyTickerSymbols(metaclass=Singleton):
^
SyntaxError: invalid syntax
Thank you very much for your work :). Thats what I am looking for.
Cheers Michael
In general, even though the correct symbols are in the list, some other symbols are returned as index members.
For example. yahoo finance provides the data for symbol "Mar", but 0p0000kql0 is given as the corresponding symbol here.
Are there any solutions on how to tell this to provide the usual tickers?
I also fond that often in https://github.com/portfolioplus/pytickersymbols/blob/master/stocks.yaml
there are multiple alternative symbols listed. Often the correct one is one of them.
T h a n k you for pytickersymbol - it helps :-)
So far I only compared the DAX symbol list with https://en.wikipedia.org/wiki/DAX:
Daimler, Delivery Hero and Siemens Energy are no longer in the DAX INDEX.
They got replaced by Daimler Truck, Mercedes-Benz Group and Hannover Rueck.
May I ask you to kindly refresh the Index lists ...?
I reckon your refresh procedure only runs on demand (or is broken because the layout of the source-pages may have changed).
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
Nice work! One question, though: How can I download the symbols for German stocks listed on XETRA instead of 'Frankfurt' (in this case the symbol output should be .DE instead of .F)?
Facebook changed to meta, yet here still shows as facebook. What's happening? :)
Hi,
I tried to use the package and found out that calling the get_stocks_by_index
with NASDAQ 100
as an argument returns faulty results.
First of all, it returns only 89 stocks when the index contains 103 companies.
Moreover some of the stocks aren't included in the index currently.
Basically, the json file used to pull data from is outdated.
Is there a way to update the json file?
How do I access other indices that aren't in the list, for example the UK AIM 100? Thank you.
using the examples I can print stock_data, countries etc.
For the second example when
from pytickersymbols import PyTickerSymbols
uk_stocks = stock_data.get_stocks_by_index('FTSE 100')
print(uk_stocks)
I get <filter object at 0x7fbd543e8048>
I was expecting a list of tickers for the FTSE 100
Moin!
First of all, I love your work. It saves me tons of time, many thanks for putting this out!
My question is about the stocks.yaml
file. As far as I understood your implementation, this is where all stock information is loaded from. But how often is it updated? Or how is it generally assured to query the most up-to-date stock info?
Thanks a bunch!
All the best from Berlin
pytickersymbols
is great but I'm struggling to get the results as pandas dataframes, is there a native way to export in that format? It would be really helpful.
Also, in the example below, how can I convert 'spx' into a dataframe or at least export as .csv? Because, in the current format, I have not been able to use it for any of my purposes.
stock_data = PyTickerSymbols()
spx = stock_data.get_stocks_by_index('S&P 500')
Thank you
Hi, looking for something like this for long, thanks for it.
Works for DAX, NASDAQ and SP500
Trying to get stocks for DOW JONES, seems to have problems.
I only get 2 outputs for it. Am i doing anything wrong?
dow_stocks = stock_data.get_stocks_by_index('DOW JONES')
[{'name': 'Nasdaq Inc.', 'symbol': 'NDAQ', 'country': 'United States', 'indices': ['DOW JONES', 'S&P 500'], 'industries': ['Banking & Investment Services', 'Investment Banking & Investment Services', 'Financials', 'Financial & Commodity Market Operators'], 'symbols': [{'yahoo': 'NAQ.F', 'google': 'FRA:NAQ', 'currency': 'EUR'}, {'yahoo': 'NDAQ', 'google': 'NASDAQ:NDAQ', 'currency': 'USD'}, {'yahoo': '0K4T.L', 'google': 'LON:0K4T', 'currency': 'GBP'}], 'metadata': {'founded': 1971, 'employees': 4830}, 'isins': []}, {'name': 'New York Stock Exchange', 'wiki_name': 'New York Stock Exchange', 'symbol': 'MMM', 'country': 'United States', 'indices': ['DOW JONES'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 1792, 'employees': ''}}, {'name': 'Nasdaq', 'wiki_name': 'Nasdaq', 'symbol': 'AMGN', 'country': 'United States', 'indices': ['DOW JONES'], 'industries': [], 'symbols': [], 'isins': [], 'metadata': {'founded': 1971, 'employees': ''}}]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.