Skip to content

Commit 32ef690

Browse files
authored
Allow data download from Poland
Current version of the code is very US focused while stooq is a Polish website. To download data from the WSE one need to provide a ticker only (such as PZU), website returns null if one add PL at the end. My small addition copes with this issue while still allowing US focus (i.e. use of ticker only approach to shares listed in US).
1 parent 7949e60 commit 32ef690

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas_datareader/stooq.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ def _get_params(self, symbol, country='US'):
3939
symbol_parts = symbol.split(".")
4040
if len(symbol_parts) == 1:
4141
symbol = ".".join([symbol, country])
42+
elif symbol_parts[1].lower() == 'pl:
43+
symbol = symbol_parts[0]
4244
else:
4345
if symbol_parts[1].lower() not in ['de', 'hk', 'hu', 'jp',
44-
'pl', 'uk', 'us']:
46+
'uk', 'us']:
4547
symbol = ".".join([symbol, 'US'])
4648

4749
params = {

0 commit comments

Comments
 (0)