Skip to content

Commit fd050b9

Browse files
committed
Rename method
1 parent e0aa189 commit fd050b9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/source/Snapshot.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Get snapshots for all asset types
1212
- `Forex snapshot all tickers`_
1313
- `Crypto snapshot all tickers`_
1414

15-
.. automethod:: polygon.RESTClient.list_asset_snapshots
15+
.. automethod:: polygon.RESTClient.list_universal_snapshot
1616

1717
=================================
1818
Get all snapshots

examples/rest/universal-snapshot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def print_snapshots(iterator: Union[Iterator[UniversalSnapshot], HTTPResponse]):
2222
print(item)
2323

2424

25-
# it = client.list_asset_snapshots() # all tickers for all assets types in lexicographical order
25+
# it = client.list_universal_snapshot() # all tickers for all assets types in lexicographical order
2626

27-
it = client.list_asset_snapshots(
27+
it = client.list_universal_snapshot(
2828
ticker_any_of=[
2929
"AAPL",
3030
"O:AAPL230519C00055000",
@@ -35,12 +35,12 @@ def print_snapshots(iterator: Union[Iterator[UniversalSnapshot], HTTPResponse]):
3535
)
3636
print_snapshots(it)
3737

38-
it = client.list_asset_snapshots(
38+
it = client.list_universal_snapshot(
3939
market_type=SnapshotMarketType.STOCKS, ticker_gt="A", ticker_lt="AAPL"
4040
)
4141
print_snapshots(it)
4242

43-
it = client.list_asset_snapshots(
43+
it = client.list_universal_snapshot(
4444
market_type=SnapshotMarketType.STOCKS, ticker_gte="AAPL", ticker_lte="ABB"
4545
)
4646
print_snapshots(it)

polygon/rest/snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_locale(market_type: Union[SnapshotMarketType, str]):
2222

2323

2424
class SnapshotClient(BaseClient):
25-
def list_asset_snapshots(
25+
def list_universal_snapshot(
2626
self,
2727
market_type: Optional[Union[str, SnapshotMarketType]] = None,
2828
ticker_any_of: Optional[List[str]] = None,
@@ -57,7 +57,7 @@ def list_asset_snapshots(
5757
url = f"/v3/snapshot"
5858
return self._paginate(
5959
path=url,
60-
params=self._get_params(self.list_asset_snapshots, locals()),
60+
params=self._get_params(self.list_universal_snapshot, locals()),
6161
result_key="results",
6262
deserializer=UniversalSnapshot.from_dict,
6363
raw=raw,

test_rest/test_snapshots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
class SnapshotsTest(BaseTest):
29-
def test_list_asset_snapshots(self):
29+
def test_list_universal_snapshot(self):
3030
expected = [
3131
UniversalSnapshot(
3232
ticker="O:NCLH221014C00005000",
@@ -130,7 +130,7 @@ def test_list_asset_snapshots(self):
130130
error="NOT_FOUND", message="Ticker not found.", ticker="TSLAAPL"
131131
),
132132
]
133-
snapshots = [s for s in self.c.list_asset_snapshots()]
133+
snapshots = [s for s in self.c.list_universal_snapshot()]
134134
self.assertEqual(snapshots, expected)
135135

136136
def test_get_snapshot_all(self):

0 commit comments

Comments
 (0)