Skip to content

Commit

Permalink
Add columns to stocks/search (#5565)
Browse files Browse the repository at this point in the history
* Add columns to `stocks/search`

isin, cusip, figi, composite_figi, shareclass_figi

* Update test_search[False].txt

* Update test_search[True].txt

* Delete tests/openbb_terminal/stocks/cassettes/test_stocks_helper/test_search.yaml

* Create test_search.yaml

---------

Co-authored-by: Danglewood <[email protected]>
  • Loading branch information
AdwaitSalankar and deeleeramone authored Oct 18, 2023
1 parent f1c368b commit 8f42c2f
Show file tree
Hide file tree
Showing 4 changed files with 234,951 additions and 222,608 deletions.
21 changes: 20 additions & 1 deletion openbb_terminal/stocks/stocks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ def search(
"industry_group",
"industry",
"exchange",
"isin",
"cusip",
"figi",
"composite_figi",
"shareclass_figi",
]
]

Expand All @@ -223,7 +228,21 @@ def search(
for x in v:
exchange_suffix[x] = k

df = df[["name", "country", "sector", "industry_group", "industry", "exchange"]]
df = df[
[
"name",
"country",
"sector",
"industry_group",
"industry",
"exchange",
"isin",
"cusip",
"figi",
"composite_figi",
"shareclass_figi",
]
]
# To automate renaming columns
df.columns = [col.replace("_", " ") for col in df.columns.tolist()]
df = df.fillna(value=np.nan)
Expand Down
Loading

0 comments on commit 8f42c2f

Please sign in to comment.