Skip to content

Commit

Permalink
Add Models to Docs (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darcy-Linde authored May 2, 2022
1 parent 96b83c7 commit d757c33
Show file tree
Hide file tree
Showing 16 changed files with 888 additions and 478 deletions.
197 changes: 197 additions & 0 deletions docs/source/Models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
.. _models_header:

Models
==============================================================

==============================================================
Agg
==============================================================
.. autoclass:: polygon.rest.models.Agg

==============================================================
Grouped Daily Agg
==============================================================
.. autoclass:: polygon.rest.models.GroupedDailyAgg

==============================================================
Daily Open Close Agg
==============================================================
.. autoclass:: polygon.rest.models.DailyOpenCloseAgg

==============================================================
Previous Close Agg
==============================================================
.. autoclass:: polygon.rest.models.PreviousCloseAgg

==============================================================
Trade
==============================================================
.. autoclass:: polygon.rest.models.Trade

==============================================================
Last Trade
==============================================================
.. autoclass:: polygon.rest.models.LastTrade

==============================================================
Crypto Trade
==============================================================
.. autoclass:: polygon.rest.models.CryptoTrade

==============================================================
Quote
==============================================================
.. autoclass:: polygon.rest.models.Quote

==============================================================
Last Quote
==============================================================
.. autoclass:: polygon.rest.models.LastQuote

==============================================================
Snapshot Min
==============================================================
.. autoclass:: polygon.rest.models.SnapshotMin

==============================================================
Snapshot
==============================================================
.. autoclass:: polygon.rest.models.Snapshot

==============================================================
Day Option Contract Snapshot
==============================================================
.. autoclass:: polygon.rest.models.DayOptionContractSnapshot

==============================================================
Option Details
==============================================================
.. autoclass:: polygon.rest.models.OptionDetails

==============================================================
Option Last Quote
==============================================================
.. autoclass:: polygon.rest.models.OptionLastQuote

==============================================================
Option Greeks
==============================================================
.. autoclass:: polygon.rest.models.OptionGreeks

==============================================================
Underlying Asset
==============================================================
.. autoclass:: polygon.rest.models.UnderlyingAsset

==============================================================
Option Contract Snapshot
==============================================================
.. autoclass:: polygon.rest.models.OptionContractSnapshot

==============================================================
Order Book Quote
==============================================================
.. autoclass:: polygon.rest.models.OrderBookQuote

==============================================================
Snapshot Ticker Full Book
==============================================================
.. autoclass:: polygon.rest.models.SnapshotTickerFullBook

==============================================================
Ticker
==============================================================
.. autoclass:: polygon.rest.models.Ticker

==============================================================
Address
==============================================================
.. autoclass:: polygon.rest.models.Address

==============================================================
Branding
==============================================================
.. autoclass:: polygon.rest.models.Branding

==============================================================
Publisher
==============================================================
.. autoclass:: polygon.rest.models.Publisher

==============================================================
Ticker Details
==============================================================
.. autoclass:: polygon.rest.models.TickerDetails

==============================================================
Ticker News
==============================================================
.. autoclass:: polygon.rest.models.TickerNews

==============================================================
Ticker Types
==============================================================
.. autoclass:: polygon.rest.models.TickerTypes

==============================================================
Market Holiday
==============================================================
.. autoclass:: polygon.rest.models.MarketHoliday

==============================================================
Market Currencies
==============================================================
.. autoclass:: polygon.rest.models.MarketCurrencies

==============================================================
Market Exchanges
==============================================================
.. autoclass:: polygon.rest.models.MarketExchanges

==============================================================
Market Status
==============================================================
.. autoclass:: polygon.rest.models.MarketStatus

==============================================================
Split
==============================================================
.. autoclass:: polygon.rest.models.Split

==============================================================
Dividend
==============================================================
.. autoclass:: polygon.rest.models.Dividend

==============================================================
Sip Mapping
==============================================================
.. autoclass:: polygon.rest.models.SipMapping

==============================================================
Consolidated
==============================================================
.. autoclass:: polygon.rest.models.Consolidated

==============================================================
Market Center
==============================================================
.. autoclass:: polygon.rest.models.MarketCenter

==============================================================
Update Rules
==============================================================
.. autoclass:: polygon.rest.models.UpdateRules

==============================================================
Condition
==============================================================
.. autoclass:: polygon.rest.models.Condition

==============================================================
Exchange
==============================================================
.. autoclass:: polygon.rest.models.Exchange



18 changes: 9 additions & 9 deletions docs/source/Trades.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.. _trades_header:

Trades
=============
==================================================================

===========
==================================================================
List trades
===========
==================================================================
.. automethod:: polygon.RESTClient.list_trades

===========
==================================================================
Get last trade
===========
==================================================================
.. automethod:: polygon.RESTClient.get_last_trade

===========
Get last trade (crypto)
===========
.. automethod:: polygon.RESTClient.get_last_trade_crypto
==================================================================
Get last crypto trade
==================================================================
.. automethod:: polygon.RESTClient.get_last_crypto_trade
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This documentation is for the Python client only. For details about the response
Quotes
Reference
Trades
Models


Indices and tables
Expand Down
74 changes: 39 additions & 35 deletions polygon/rest/models/aggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

@dataclass
class Agg:
open: Optional[float]
high: Optional[float]
low: Optional[float]
close: Optional[float]
volume: Optional[float]
vwap: Optional[float]
timestamp: Optional[int]
transactions: Optional[int]
"Contains aggregate data for a given ticker symbol over a given date range in a custom time window size."
open: Optional[float] = None
high: Optional[float] = None
low: Optional[float] = None
close: Optional[float] = None
volume: Optional[float] = None
vwap: Optional[float] = None
timestamp: Optional[int] = None
transactions: Optional[int] = None

@staticmethod
def from_dict(d):
Expand All @@ -29,15 +30,16 @@ def from_dict(d):

@dataclass
class GroupedDailyAgg:
ticker: str
open: float
high: float
low: float
close: float
volume: float
vwap: Optional[float]
timestamp: Optional[int]
transactions: Optional[int]
"Contains daily open, high, low, and close (OHLC) data for a given date."
ticker: Optional[str] = None
open: Optional[float] = None
high: Optional[float] = None
low: Optional[float] = None
close: Optional[float] = None
volume: Optional[float] = None
vwap: Optional[float] = None
timestamp: Optional[int] = None
transactions: Optional[int] = None

@staticmethod
def from_dict(d):
Expand All @@ -56,16 +58,17 @@ def from_dict(d):

@dataclass
class DailyOpenCloseAgg:
after_hours: Optional[float]
close: float
from_: str
high: float
low: float
open: float
pre_market: Optional[float]
status: Optional[str]
symbol: str
volume: float
"Contains data for open, close and afterhours prices of a ticker symbol on a specified date."
after_hours: Optional[float] = None
close: Optional[float] = None
from_: Optional[str] = None
high: Optional[float] = None
low: Optional[float] = None
open: Optional[float] = None
pre_market: Optional[float] = None
status: Optional[str] = None
symbol: Optional[str] = None
volume: Optional[float] = None

@staticmethod
def from_dict(d):
Expand All @@ -85,14 +88,15 @@ def from_dict(d):

@dataclass
class PreviousCloseAgg:
ticker: str
close: float
high: float
low: float
open: float
timestamp: Optional[float]
volume: float
vwap: Optional[float]
"Contains data for the previous day's open, high, low, and close (OHLC) of the specified stock ticker."
ticker: Optional[str] = None
close: Optional[float] = None
high: Optional[float] = None
low: Optional[float] = None
open: Optional[float] = None
timestamp: Optional[float] = None
volume: Optional[float] = None
vwap: Optional[float] = None

@staticmethod
def from_dict(d):
Expand Down
Loading

0 comments on commit d757c33

Please sign in to comment.