Skip to content

Commit

Permalink
consistent docstring style (remove ###)
Browse files Browse the repository at this point in the history
remove ### from docstrings
  • Loading branch information
primalleous committed Jun 2, 2023
1 parent 5a8e397 commit c393205
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 128 deletions.
2 changes: 1 addition & 1 deletion samples/stream_client/example_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async def save_raw_msg(self, future, timeframe, msg):

async def raw_message_handler(self, msg):
"""
Processes a message with the snapshot key and returns pydantic obj representation.
Processes a message with the snapshot key {"snapshot":...} and returns pydantic obj representation.
"""
msg = msg["snapshot"][0]
return self.construct_message(msg)
Expand Down
26 changes: 13 additions & 13 deletions td/rest/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
class Accounts:

"""
## Overview
Overview
----
Allows the user to retrieve account information.
"""

def __init__(self, session: TdAmeritradeSession) -> None:
"""Initializes the `Accounts` services.
### Parameters
Parameters
----
session : TdAmeritradeSession
An authenticated `TDAmeritradeSession
Expand All @@ -35,19 +35,19 @@ def get_accounts(
) -> dict | list:
"""Queries accounts for a user.
### Overview
Overview
----
Serves as the mechanism to make a request to the
"Get Accounts" and "Get Account" Endpoint. If one
account is provided a "Get Account" request will
be made and if more than one account is provided
then a "Get Accounts" request will be made.
### Documentation
Documentation
----
https://developer.tdameritrade.com/account-access/apis
### Parameters
Parameters
----
account_id: str (optional, default=None)
The account number you wish to recieve data on.
Expand All @@ -64,7 +64,7 @@ def get_accounts(
from the API. If set to `False` no positions will be
returned.
### Usage
Usage
----
>>> account_services = td_client.accounts()
>>> account_services.get_accounts(
Expand Down Expand Up @@ -118,11 +118,11 @@ def get_transactions(
) -> dict:
"""Queries the transactions for an account.
### Documentation
Documentation
----
https://developer.tdameritrade.com/transaction-history/apis
### Parameters
Parameters
----
account_id: str
The account number you want to query transactions
Expand All @@ -147,7 +147,7 @@ def get_transactions(
Note: The maximum date range is one year. Valid ISO-8601
formats are: yyyy-MM-dd.
### Usage
Usage
----
>>> account_services = td_client.accounts()
>>> account_services.get_transactions(
Expand Down Expand Up @@ -188,17 +188,17 @@ def get_transactions(
def get_transaction(self, account_id: str, transaction_id: str) -> dict:
"""Queries a transaction for a specific account.
### Overview
Overview
----
Serves as the mechanism to make a request to the "Get Transaction"
Endpoint. The transaction ID will be queried for the specific account
passed through.
### Documentation
Documentation
----
https://developer.tdameritrade.com/transaction-history/apis
### Parameters
Parameters
----
account_id: str
The account number you want to query transactions
Expand All @@ -209,7 +209,7 @@ def get_transaction(self, account_id: str, transaction_id: str) -> dict:
from the API. If set to `False` no orders will be
returned.
### Usage
Usage
----
>>> account_services = td_client.accounts()
>>> account_services.get_transaction(
Expand Down
14 changes: 7 additions & 7 deletions td/rest/instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Instruments:
def __init__(self, session: TdAmeritradeSession) -> None:
"""Initializes the `Instruments` services.
### Parameters
Parameters
----
session : TdAmeritradeSession
An authenticated `TDAmeritradeSession
Expand All @@ -35,15 +35,15 @@ def __init__(self, session: TdAmeritradeSession) -> None:
def search_instruments(self, instruments_query: InstrumentsQuery) -> dict:
"""Search or retrieve instrument data, including fundamental data.
### Documentation
Documentation
----
https://developer.tdameritrade.com/instruments/apis/get/instruments
### Parameters
Parameters
----
instruments_query : InstrumentsQuery
### Usage
Usage
----
This method can be used in three different ways:
Expand Down Expand Up @@ -81,16 +81,16 @@ def search_instruments(self, instruments_query: InstrumentsQuery) -> dict:
def get_instrument(self, cusip: str) -> dict:
"""Get an instrument by CUSIP.
### Documentation
Documentation
----
https://developer.tdameritrade.com/instruments/apis/get/instruments/%7Bcusip%7D
### Parameters
Parameters
----
cusip: str
The CUSIP Id.
### Usage
Usage
----
>>> from td.enums import Instruments
>>> instruments_service = td_client.instruments()
Expand Down
14 changes: 7 additions & 7 deletions td/rest/market_hours.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MarketHours:
def __init__(self, session: TdAmeritradeSession) -> None:
"""Initializes the `MarketHours` services.
### Parameters
Parameters
----
session : TdAmeritradeSession
An authenticated `TDAmeritradeSession
Expand All @@ -29,15 +29,15 @@ def __init__(self, session: TdAmeritradeSession) -> None:
def get_multiple_market_hours(self, market_hours_query: MarketHoursQuery) -> dict:
"""Returns the market hours for all the markets.
### Documentation
Documentation
----
https://developer.tdameritrade.com/market-hours/apis
### Parameters
Parameters
----
market_hours_query : MarketHoursQuery
### Usage
Usage
----
1. Population by field names specified in `MarketHoursQuery`
>>> market_hours_service = td_client.market_hours()
Expand Down Expand Up @@ -70,15 +70,15 @@ def get_multiple_market_hours(self, market_hours_query: MarketHoursQuery) -> dic
def get_market_hours(self, market_hours_query: MarketHoursQuery) -> dict:
"""Returns the market hours for the specified market.
### Documentation
Documentation
----
https://developer.tdameritrade.com/market-hours/apis
### Parameters
Parameters
----
market_hours_query : MarketHoursQuery
### Usage
Usage
----
1. Population by field names specified in `MarketHoursQuery`
>>> market_hours_service = td_client.market_hours()
Expand Down
10 changes: 5 additions & 5 deletions td/rest/movers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Movers:
def __init__(self, session: TdAmeritradeSession) -> None:
"""Initializes the `Movers` services.
### Parameters
Parameters
----
session : TdAmeritradeSession
An authenticated `TDAmeritradeSession
Expand All @@ -30,20 +30,20 @@ def __init__(self, session: TdAmeritradeSession) -> None:
def get_movers(self, movers_query: MoversQuery) -> List[Mover]:
"""Gets Active movers for a specific Index.
### Overview
Overview
----
Top 10 (up or down) movers by value or percent for
a particular market.
### Documentation
Documentation
----
https://developer.tdameritrade.com/movers/apis/get/marketdata
### Parameters
Parameters
----
movers_query : MoversQuery
### Usage
Usage
----
1. Population by field names specified in `MoversQuery`
>>> movers_service = td_client.movers()
Expand Down
10 changes: 5 additions & 5 deletions td/rest/options_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OptionsChain:
def __init__(self, session: TdAmeritradeSession) -> None:
"""Initializes the `OptionsChain` services.
### Parameters
Parameters
----
session : TdAmeritradeSession
An authenticated `TDAmeritradeSession
Expand All @@ -31,17 +31,17 @@ def __init__(self, session: TdAmeritradeSession) -> None:
def get_option_chain(self, option_chain_query: OptionChainQuery) -> OptionChain:
"""Get option chain for an optionable Symbol.
### Documentation
Documentation
----
https://developer.tdameritrade.com/option-chains/apis/get/marketdata/chains
### Parameters
Parameters
----
option_chain_query: OptionChainQuery
### NOTE: Filters such as ITM/OTM/DTE don't seem to work.
NOTE: Filters such as ITM/OTM/DTE don't seem to work.
### Usage
Usage
----
1. Population by field names specified in `OptionChainQuery`
>>> options_chain_service = td_client.options_chain()
Expand Down
Loading

0 comments on commit c393205

Please sign in to comment.