forked from robinhood-unofficial/pyrh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Schema loading capabilities to SessionManager get and post
* Remove typing-extensions since it is no longer used * move doc --> docs in pyproject.toml * Re-factor SessionManager to leverage get / post method automatic Schema building. * Add beginning of portfolio model.
- Loading branch information
1 parent
7ccb517
commit 963b2ed
Showing
5 changed files
with
130 additions
and
136 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
"""pyrh models and schemas.""" | ||
|
||
from .oauth import Challenge, OAuth | ||
from .sessionmanager import SessionManager | ||
from .oauth import Challenge, ChallengeSchema, OAuth, OAuthSchema | ||
from .portfolio import PortfolioSchema | ||
from .sessionmanager import SessionManager, SessionManagerSchema | ||
|
||
|
||
__all__ = ["OAuth", "Challenge", "SessionManager"] | ||
__all__ = [ | ||
"OAuth", | ||
"OAuthSchema", | ||
"Challenge", | ||
"ChallengeSchema", | ||
"SessionManager", | ||
"SessionManagerSchema", | ||
"Portfolio", | ||
"PortfolioSchema", | ||
] |
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,38 @@ | ||
"""Current portfolio.""" | ||
|
||
from marshmallow import fields | ||
|
||
from .base import BaseModel, BaseSchema | ||
|
||
|
||
class Portfolio(BaseModel): | ||
"""Robinhood portfolio data class.""" | ||
|
||
pass | ||
|
||
|
||
class PortfolioSchema(BaseSchema): | ||
"""Robinhood portfolio schema data loader.""" | ||
|
||
__model__ = Portfolio | ||
|
||
url = fields.URL() | ||
account = fields.URL() | ||
start_date = fields.NaiveDateTime() | ||
market_value = fields.Float() | ||
equity = fields.Float() | ||
extended_hours_market_value = fields.Float() | ||
extended_hours_equity = fields.Float() | ||
extended_hours_portfolio_equity = fields.Float() | ||
last_core_market_value = fields.Float() | ||
last_core_equity = fields.Float() | ||
last_core_portfolio_equity = fields.Float() | ||
excess_margin = fields.Float() | ||
excess_maintenance = fields.Float() | ||
excess_margin_with_uncleared_deposits = fields.Float() | ||
portfolio_equity_previous_close = fields.Float() | ||
adjusted_equity_previous_close = fields.Float() | ||
adjusted_portfolio_equity_previous_close = fields.Float() | ||
withdrawable_amount = fields.Float() | ||
unwithdrawable_deposits = fields.Float() | ||
unwithdrawable_grants = fields.Float() |
Oops, something went wrong.