-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e65bf51
commit 83a2d40
Showing
4 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from polygon import RESTClient | ||
|
||
# client = RESTClient("XXXXXX") # hardcoded api_key is used | ||
client = RESTClient() # POLYGON_API_KEY environment variable is used | ||
|
||
taxonomies = [] | ||
for t in client.vx.list_taxonomies( | ||
ticker_any_of=[ | ||
"TSLA", | ||
"AAPL", | ||
"GME", | ||
] | ||
): | ||
taxonomies.append(t) | ||
|
||
print(taxonomies) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
from .tickers import * | ||
from .trades import * | ||
from .summaries import * | ||
from .taxonomies import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import Optional | ||
from ...modelclass import modelclass | ||
|
||
|
||
@modelclass | ||
class Taxonomy: | ||
"Retrieve taxonomy classifications for one or more tickers." | ||
category: Optional[str] = None | ||
reason: Optional[str] = None | ||
relevance: Optional[float] = None | ||
tag: Optional[str] = None | ||
ticker: Optional[str] = None | ||
|
||
@staticmethod | ||
def from_dict(d): | ||
return Taxonomy( | ||
d.get("category", None), | ||
d.get("reason", None), | ||
d.get("relevance", None), | ||
d.get("tag", None), | ||
d.get("ticker", None), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters