Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #159 from timkpaine/isin
Browse files Browse the repository at this point in the history
add isin lookup
  • Loading branch information
timkpaine authored Dec 5, 2020
2 parents 56c427a + b87474a commit 2591994
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ Currently, the following methods are implemented:
- [exchangesDF](https://iexcloud.io/docs/api/#u-s-exchanges)
- [holidays](https://iexcloud.io/docs/api/#u-s-holidays-and-trading-dates)
- [holidaysDF](https://iexcloud.io/docs/api/#u-s-holidays-and-trading-dates)
- [isinLookup](https://iexcloud.io/docs/api/#isin-mapping)
- [isinLookupDF](https://iexcloud.io/docs/api/#isin-mapping)

### Other Reference
- corporateActions
Expand Down
4 changes: 4 additions & 0 deletions pyEX/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@
cryptoSymbols,
cryptoSymbolsDF,
cryptoSymbolsList,
isinLookup,
isinLookupDF,
corporateActions,
corporateActionsDF,
refDividends,
Expand Down Expand Up @@ -819,6 +821,8 @@
("fxSymbolsList", fxSymbolsList),
("optionsSymbolsList", optionsSymbolsList),
("cryptoSymbolsList", cryptoSymbolsList),
("isinLookup", isinLookup),
("isinLookupDF", isinLookupDF),
("corporateActions", corporateActions),
("corporateActionsDF", corporateActionsDF),
("refDividends", refDividends),
Expand Down
2 changes: 2 additions & 0 deletions pyEX/refdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
fxSymbolsList,
optionsSymbolsList,
cryptoSymbolsList,
isinLookup,
isinLookupDF,
)
from .refdata import (
corporateActions,
Expand Down
22 changes: 22 additions & 0 deletions pyEX/refdata/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,25 @@ def optionsSymbolsList(token="", version=""):
@wraps(cryptoSymbols)
def cryptoSymbolsList(token="", version=""):
return [x["symbol"] for x in cryptoSymbols(token, version, filter="symbol")]


def isinLookup(isin, token="", version=""):
"""This call returns an array of symbols that IEX Cloud supports for API calls.
https://iexcloud.io/docs/api/#isin-mapping
8am, 9am, 12pm, 1pm UTC daily
Args:
isin (str): isin to lookup
token (str): Access token
version (str): API version
Returns:
dict or DataFrame or list: result
"""
return _getJson("ref-data/isin?isin={}".format(isin), token, version)


@wraps(isinLookup)
def isinLookupDF(isin, token="", version=""):
return pd.DataFrame(isinLookup(isin=isin, token=token, version=version))

0 comments on commit 2591994

Please sign in to comment.