finance_dev 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- finance_dev/__init__.py +18 -0
- finance_dev/_hooks/__init__.py +7 -0
- finance_dev/_hooks/clientcredentials.py +319 -0
- finance_dev/_hooks/oauth2scopes.py +50 -0
- finance_dev/_hooks/registration.py +13 -0
- finance_dev/_hooks/sdkhooks.py +82 -0
- finance_dev/_hooks/types.py +125 -0
- finance_dev/_version.py +16 -0
- finance_dev/accounts.py +797 -0
- finance_dev/alternativedata.py +4830 -0
- finance_dev/analytics.py +3757 -0
- finance_dev/basesdk.py +393 -0
- finance_dev/calendar.py +1523 -0
- finance_dev/chart.py +1881 -0
- finance_dev/company.py +1105 -0
- finance_dev/corporateactions.py +1795 -0
- finance_dev/economy.py +1153 -0
- finance_dev/errors/__init__.py +94 -0
- finance_dev/errors/apierror.py +41 -0
- finance_dev/errors/authenticationerrorenvelope.py +43 -0
- finance_dev/errors/badrequest.py +34 -0
- finance_dev/errors/errorenvelope.py +42 -0
- finance_dev/errors/errorresponse.py +45 -0
- finance_dev/errors/financedevapierror.py +31 -0
- finance_dev/errors/forbidden.py +34 -0
- finance_dev/errors/internalservererror.py +35 -0
- finance_dev/errors/no_response_error.py +18 -0
- finance_dev/errors/notfound.py +34 -0
- finance_dev/errors/orderhistorybadrequest.py +35 -0
- finance_dev/errors/predorderserrorenvelope.py +42 -0
- finance_dev/errors/responsevalidationerror.py +28 -0
- finance_dev/errors/unauthorized.py +34 -0
- finance_dev/estimates.py +1906 -0
- finance_dev/etf.py +1108 -0
- finance_dev/filings.py +586 -0
- finance_dev/financials.py +4079 -0
- finance_dev/history.py +477 -0
- finance_dev/httpclient.py +126 -0
- finance_dev/indices.py +2308 -0
- finance_dev/logos.py +692 -0
- finance_dev/market.py +1825 -0
- finance_dev/markets.py +952 -0
- finance_dev/models/__init__.py +4568 -0
- finance_dev/models/accountbalancev2.py +340 -0
- finance_dev/models/accountitem.py +78 -0
- finance_dev/models/accountposition.py +147 -0
- finance_dev/models/aggregatetechnicalindicatorsresponse.py +192 -0
- finance_dev/models/analystinsightitem.py +161 -0
- finance_dev/models/analystinsightsresponse.py +39 -0
- finance_dev/models/apperror.py +123 -0
- finance_dev/models/authenticationerrordetail.py +58 -0
- finance_dev/models/bankbranchesresponse.py +96 -0
- finance_dev/models/basicfinancials.py +243 -0
- finance_dev/models/bullbearanalysisresponse.py +150 -0
- finance_dev/models/cancelorderop.py +40 -0
- finance_dev/models/cancelordrequest_union.py +287 -0
- finance_dev/models/cancelordresponse.py +115 -0
- finance_dev/models/cashflowstatement.py +290 -0
- finance_dev/models/cashflowstatementsresponse.py +61 -0
- finance_dev/models/chartbars.py +111 -0
- finance_dev/models/chartconfig.py +81 -0
- finance_dev/models/chartresolution.py +46 -0
- finance_dev/models/companyesgresponse.py +408 -0
- finance_dev/models/companyexecutive.py +70 -0
- finance_dev/models/companyexecutiveresponse.py +39 -0
- finance_dev/models/companypeersresponse.py +38 -0
- finance_dev/models/companypresentationresponse.py +96 -0
- finance_dev/models/companyprofile.py +255 -0
- finance_dev/models/conferencecallsresponse.py +169 -0
- finance_dev/models/congressionaltradingresponse.py +138 -0
- finance_dev/models/covid19uscasesresponse.py +79 -0
- finance_dev/models/createconfigwatchlistop.py +40 -0
- finance_dev/models/createwatchlistrequest.py +43 -0
- finance_dev/models/dailymarketsummaryresponse.py +73 -0
- finance_dev/models/deleteconfigwatchlistbyidop.py +53 -0
- finance_dev/models/dividenditem.py +125 -0
- finance_dev/models/dividendsresponse.py +61 -0
- finance_dev/models/earningrelease.py +291 -0
- finance_dev/models/earningscallliveresponse.py +103 -0
- finance_dev/models/earningsqualityscoreresponse.py +140 -0
- finance_dev/models/earningssurprisesresponse.py +125 -0
- finance_dev/models/ebitdaestimatesresponse.py +176 -0
- finance_dev/models/ebitestimatesresponse.py +176 -0
- finance_dev/models/economicscalendarevent.py +160 -0
- finance_dev/models/economicsindicator.py +87 -0
- finance_dev/models/epsestimatesresponse.py +176 -0
- finance_dev/models/equitydetailsdto.py +569 -0
- finance_dev/models/errorcode.py +48 -0
- finance_dev/models/etblistresponse.py +43 -0
- finance_dev/models/etbsearchrequest.py +21 -0
- finance_dev/models/etbsearchresponse.py +43 -0
- finance_dev/models/etfcountryallocationresponse.py +113 -0
- finance_dev/models/etfholdingsresponse.py +163 -0
- finance_dev/models/etfprofileresponse.py +234 -0
- finance_dev/models/etfsectorallocationresponse.py +113 -0
- finance_dev/models/exchangecode.py +90 -0
- finance_dev/models/fdaadvisorycommitteecalendarresponse.py +88 -0
- finance_dev/models/filingsimilarityrecord.py +115 -0
- finance_dev/models/filingssimilarityindexdatawrapper.py +52 -0
- finance_dev/models/filingssimilarityindexresponse.py +42 -0
- finance_dev/models/financialratiosresponse.py +252 -0
- finance_dev/models/financialsreporteddatawrapper.py +49 -0
- finance_dev/models/financialsreportedresponse.py +42 -0
- finance_dev/models/financialsrevenuebreakdowndatawrapper.py +49 -0
- finance_dev/models/financialsrevenuebreakdownresponse.py +42 -0
- finance_dev/models/financialsstatementsdatawrapper.py +44 -0
- finance_dev/models/financialsstatementsresponse.py +42 -0
- finance_dev/models/financialstatement.py +171 -0
- finance_dev/models/financialstatementtype.py +14 -0
- finance_dev/models/getaccountbalanceop.py +53 -0
- finance_dev/models/getaccountpositionsop.py +53 -0
- finance_dev/models/getaccountsresponse.py +22 -0
- finance_dev/models/getaggregatetechnicalindicatorsop.py +94 -0
- finance_dev/models/getanalystinsightsop.py +164 -0
- finance_dev/models/getbankbranchesop.py +53 -0
- finance_dev/models/getbaseeventop.py +87 -0
- finance_dev/models/getbullbearanalysisop.py +91 -0
- finance_dev/models/getcashflowstatementsop.py +564 -0
- finance_dev/models/getchartconfigop.py +40 -0
- finance_dev/models/getcharthistoryop.py +122 -0
- finance_dev/models/getcharttimeop.py +39 -0
- finance_dev/models/getcompanyesgop.py +53 -0
- finance_dev/models/getcompanyexecutivesop.py +56 -0
- finance_dev/models/getcompanymetricsop.py +68 -0
- finance_dev/models/getcompanypeersop.py +53 -0
- finance_dev/models/getcompanypresentationop.py +56 -0
- finance_dev/models/getcompanyprofileop.py +86 -0
- finance_dev/models/getconferencecallsop.py +111 -0
- finance_dev/models/getconfigwatchlistbyidop.py +53 -0
- finance_dev/models/getconfigwatchlistsop.py +40 -0
- finance_dev/models/getcongressionaltradingop.py +73 -0
- finance_dev/models/getcovid19uscasesop.py +43 -0
- finance_dev/models/getdailymarketsummaryop.py +92 -0
- finance_dev/models/getdividendsop.py +294 -0
- finance_dev/models/getearningscalendarop.py +87 -0
- finance_dev/models/getearningscallliveop.py +91 -0
- finance_dev/models/getearningsqualityscoreop.py +81 -0
- finance_dev/models/getearningssurprisesop.py +80 -0
- finance_dev/models/getebitdaestimatesop.py +91 -0
- finance_dev/models/getebitestimatesop.py +88 -0
- finance_dev/models/geteconomicscalendarop.py +92 -0
- finance_dev/models/geteconomicscalendarresponse.py +56 -0
- finance_dev/models/getepsestimatesop.py +88 -0
- finance_dev/models/getequitydetailsop.py +56 -0
- finance_dev/models/getequitydetailsresponse.py +45 -0
- finance_dev/models/getetblistop.py +40 -0
- finance_dev/models/getetfcountryallocationop.py +80 -0
- finance_dev/models/getetfholdingsop.py +96 -0
- finance_dev/models/getetfprofileop.py +77 -0
- finance_dev/models/getetfsectorallocationop.py +80 -0
- finance_dev/models/geteventcontractsop.py +87 -0
- finance_dev/models/getfdaadvisorycommitteecalendarop.py +47 -0
- finance_dev/models/getfilingssimilarityindexop.py +102 -0
- finance_dev/models/getfinancialratiosop.py +612 -0
- finance_dev/models/getfinancialstatementsop.py +117 -0
- finance_dev/models/getfundownershipop.py +77 -0
- finance_dev/models/gethistoricaldataop.py +61 -0
- finance_dev/models/gethistoricalesgop.py +53 -0
- finance_dev/models/gethistorybatchop.py +74 -0
- finance_dev/models/gethistoryop.py +123 -0
- finance_dev/models/getincomestatementsop.py +564 -0
- finance_dev/models/getindexbarop.py +140 -0
- finance_dev/models/getindexbarsop.py +149 -0
- finance_dev/models/getindexchartbarsop.py +178 -0
- finance_dev/models/getindexrealtimevaluesop.py +94 -0
- finance_dev/models/getinflationexpectationsop.py +157 -0
- finance_dev/models/getinflationop.py +154 -0
- finance_dev/models/getinsidertransactionsop.py +90 -0
- finance_dev/models/getinstitutionalownershipop.py +99 -0
- finance_dev/models/getinstitutionalportfolioop.py +75 -0
- finance_dev/models/getinvestmentthemeop.py +68 -0
- finance_dev/models/getipocalendarop.py +63 -0
- finance_dev/models/getlobbyingop.py +70 -0
- finance_dev/models/getmarketbreadthop.py +40 -0
- finance_dev/models/getmarketholidaysop.py +65 -0
- finance_dev/models/getmarketstatusop.py +65 -0
- finance_dev/models/getmergersandacquisitionsop.py +113 -0
- finance_dev/models/getnetinflowop.py +40 -0
- finance_dev/models/getnewsbyidop.py +73 -0
- finance_dev/models/getnewsop.py +98 -0
- finance_dev/models/getnewssentimentop.py +53 -0
- finance_dev/models/getoptionchainsnapshotop.py +244 -0
- finance_dev/models/getoptioncontractsnapshotop.py +69 -0
- finance_dev/models/getoptiondetailsop.py +56 -0
- finance_dev/models/getoptiondetailsresponse.py +45 -0
- finance_dev/models/getoptionlasttradeop.py +56 -0
- finance_dev/models/getoptionopencloseop.py +66 -0
- finance_dev/models/getoptionpreviousdayop.py +56 -0
- finance_dev/models/getoptionquotesop.py +177 -0
- finance_dev/models/getoptionsactivityop.py +111 -0
- finance_dev/models/getoptionsetfstopvolumeop.py +70 -0
- finance_dev/models/getoptionsstockstopgainersop.py +70 -0
- finance_dev/models/getoptionsstockstopvolumeop.py +70 -0
- finance_dev/models/getoptionsunusualactivityop.py +100 -0
- finance_dev/models/getoptiontradesop.py +177 -0
- finance_dev/models/getordersv2response.py +66 -0
- finance_dev/models/getownershipdataop.py +77 -0
- finance_dev/models/getpositionsresponse.py +39 -0
- finance_dev/models/getpredictionorderop.py +88 -0
- finance_dev/models/getpricetargetop.py +53 -0
- finance_dev/models/getquotesop.py +53 -0
- finance_dev/models/getratingsop.py +164 -0
- finance_dev/models/getratingsresponse.py +39 -0
- finance_dev/models/getreportedfinancialsop.py +127 -0
- finance_dev/models/getrevenuebreakdownop.py +85 -0
- finance_dev/models/getrevenueestimatesop.py +91 -0
- finance_dev/models/getsecfilingsop.py +113 -0
- finance_dev/models/getsectortickersop.py +124 -0
- finance_dev/models/getsectorwisechangeop.py +84 -0
- finance_dev/models/getshortinterestop.py +334 -0
- finance_dev/models/getshortvolumeop.py +333 -0
- finance_dev/models/getsocialsentimentop.py +90 -0
- finance_dev/models/getspinoffsop.py +112 -0
- finance_dev/models/getstockaggregatesop.py +174 -0
- finance_dev/models/getstocklastquoteop.py +56 -0
- finance_dev/models/getstocklasttradeop.py +56 -0
- finance_dev/models/getstockopencloseop.py +90 -0
- finance_dev/models/getstockpreviousdayop.py +80 -0
- finance_dev/models/getstockquotesop.py +177 -0
- finance_dev/models/getstocksnapshotsop.py +82 -0
- finance_dev/models/getstocksplitsop.py +243 -0
- finance_dev/models/getstocktradesop.py +177 -0
- finance_dev/models/getsupplychainop.py +53 -0
- finance_dev/models/getsupportresistancelevelsop.py +90 -0
- finance_dev/models/getsymbolinfoop.py +53 -0
- finance_dev/models/gettechnicalindicatorop.py +172 -0
- finance_dev/models/gettechnicalpatternsop.py +88 -0
- finance_dev/models/gettenderoffersop.py +112 -0
- finance_dev/models/gettickhistoryop.py +104 -0
- finance_dev/models/gettopgainersop.py +78 -0
- finance_dev/models/gettoplosersop.py +78 -0
- finance_dev/models/gettopmostactiveop.py +78 -0
- finance_dev/models/gettranscriptop.py +53 -0
- finance_dev/models/gettreasuryyieldsop.py +157 -0
- finance_dev/models/getunifiedsnapshotop.py +223 -0
- finance_dev/models/getupgradesdowngradesop.py +91 -0
- finance_dev/models/getusaspendingop.py +70 -0
- finance_dev/models/getuseraccountsop.py +40 -0
- finance_dev/models/getusptopatentsop.py +70 -0
- finance_dev/models/getvisaapplicationsop.py +73 -0
- finance_dev/models/historicalesgresponse.py +439 -0
- finance_dev/models/httpmetadata.py +24 -0
- finance_dev/models/incomestatement.py +296 -0
- finance_dev/models/incomestatementsresponse.py +61 -0
- finance_dev/models/indexbarresponse.py +194 -0
- finance_dev/models/indexbarsresponse.py +123 -0
- finance_dev/models/indexchartbarsresponse.py +213 -0
- finance_dev/models/indexgroupsresponse.py +78 -0
- finance_dev/models/indexlistresponse.py +95 -0
- finance_dev/models/indexsearchresponse.py +93 -0
- finance_dev/models/indicesbygroupresponse.py +93 -0
- finance_dev/models/indicesidentifiertype.py +28 -0
- finance_dev/models/indicesrealtimeindexinfo.py +67 -0
- finance_dev/models/indicesrealtimeindexvalue.py +157 -0
- finance_dev/models/indicesrealtimevaluesitem.py +80 -0
- finance_dev/models/indicesrealtimevaluesresponse.py +42 -0
- finance_dev/models/inflationexpectationsresponse.py +140 -0
- finance_dev/models/inflationresponse.py +132 -0
- finance_dev/models/insidertransaction.py +97 -0
- finance_dev/models/insidertransactionsresponse.py +39 -0
- finance_dev/models/institutionalholding.py +77 -0
- finance_dev/models/institutionalownershipresponse.py +39 -0
- finance_dev/models/institutionalportfolioresponse.py +39 -0
- finance_dev/models/investmentthemeid.py +35 -0
- finance_dev/models/investmentthemeresponse.py +80 -0
- finance_dev/models/ipocalendarresponse.py +39 -0
- finance_dev/models/ipoitem.py +93 -0
- finance_dev/models/listactiveordersop.py +87 -0
- finance_dev/models/listcategoriesop.py +79 -0
- finance_dev/models/listindexgroupsop.py +40 -0
- finance_dev/models/listindicesbygroupop.py +58 -0
- finance_dev/models/listindicesop.py +91 -0
- finance_dev/models/listoptioncontractsop.py +66 -0
- finance_dev/models/listoptionexpirydatesop.py +56 -0
- finance_dev/models/listorderhistoryop.py +139 -0
- finance_dev/models/listpredictionordersop.py +134 -0
- finance_dev/models/listtranscriptsop.py +53 -0
- finance_dev/models/lobbyingresponse.py +166 -0
- finance_dev/models/logosearchresponse.py +152 -0
- finance_dev/models/logosyncresponse.py +277 -0
- finance_dev/models/marketbreadth.py +97 -0
- finance_dev/models/marketbreadthresponse.py +44 -0
- finance_dev/models/marketholiday.py +56 -0
- finance_dev/models/marketholidayresponse.py +39 -0
- finance_dev/models/marketstatus.py +67 -0
- finance_dev/models/mergersandacquisitionsresponse.py +186 -0
- finance_dev/models/metricseriespoint.py +43 -0
- finance_dev/models/netinflow.py +81 -0
- finance_dev/models/netinflowresponse.py +44 -0
- finance_dev/models/newsitem.py +102 -0
- finance_dev/models/newslistresponse.py +128 -0
- finance_dev/models/newssentimentresponse.py +176 -0
- finance_dev/models/newstypeenum.py +16 -0
- finance_dev/models/optionchainsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotrow.py +164 -0
- finance_dev/models/optioncontractsresponse.py +131 -0
- finance_dev/models/optiondetailsdto.py +72 -0
- finance_dev/models/optionexpirydatesresponse.py +53 -0
- finance_dev/models/optionlasttraderesponse.py +169 -0
- finance_dev/models/optionopencloseresponse.py +97 -0
- finance_dev/models/optionpreviousdayresponse.py +89 -0
- finance_dev/models/optionquotesresponse.py +138 -0
- finance_dev/models/optionsactivityresponse.py +265 -0
- finance_dev/models/optionsnapshotcontractdetails.py +85 -0
- finance_dev/models/optionsnapshotdaybar.py +107 -0
- finance_dev/models/optionsnapshotgreeks.py +67 -0
- finance_dev/models/optionsnapshotlastquote.py +116 -0
- finance_dev/models/optionsnapshotlasttrade.py +102 -0
- finance_dev/models/optionsnapshotunderlying.py +86 -0
- finance_dev/models/optionsscreeneritem.py +151 -0
- finance_dev/models/optionsunusualactivityresponse.py +62 -0
- finance_dev/models/optionsunusualactivitytrade.py +103 -0
- finance_dev/models/optiontradesresponse.py +132 -0
- finance_dev/models/orderrequesttimeinforceenum.py +29 -0
- finance_dev/models/ordersideenum.py +20 -0
- finance_dev/models/ordertypeenum.py +20 -0
- finance_dev/models/ordleg.py +162 -0
- finance_dev/models/ordresponse.py +202 -0
- finance_dev/models/ownershipdataresponse.py +39 -0
- finance_dev/models/ownershiprecord.py +74 -0
- finance_dev/models/placeorderop.py +40 -0
- finance_dev/models/placeordrequest_union.py +335 -0
- finance_dev/models/placepredictionorderop.py +114 -0
- finance_dev/models/predmdbaseevent.py +62 -0
- finance_dev/models/predmdbaseeventhit.py +53 -0
- finance_dev/models/predmdbaseeventsearchresult.py +46 -0
- finance_dev/models/predmdbaseeventwithevents.py +32 -0
- finance_dev/models/predmdbatchhistoryrequest.py +16 -0
- finance_dev/models/predmdbatchhistoryresponse.py +16 -0
- finance_dev/models/predmdcategory.py +48 -0
- finance_dev/models/predmdcontract.py +177 -0
- finance_dev/models/predmdcontracthit.py +157 -0
- finance_dev/models/predmdcontractsearchresult.py +46 -0
- finance_dev/models/predmdevent.py +136 -0
- finance_dev/models/predmdeventhit.py +73 -0
- finance_dev/models/predmdeventsearchresult.py +46 -0
- finance_dev/models/predmdeventwithcontracts.py +22 -0
- finance_dev/models/predmdhistoryrequest.py +59 -0
- finance_dev/models/predmdhistoryresponse.py +53 -0
- finance_dev/models/predmdtick.py +53 -0
- finance_dev/models/predordersapperror.py +78 -0
- finance_dev/models/predordersorder.py +267 -0
- finance_dev/models/predordersorderdetail.py +26 -0
- finance_dev/models/predordersorderpage.py +45 -0
- finance_dev/models/predordersorderreport.py +88 -0
- finance_dev/models/predordersplaceorderrequest.py +159 -0
- finance_dev/models/previeworderop.py +40 -0
- finance_dev/models/previeworderresponse.py +127 -0
- finance_dev/models/pricetargetresponse.py +89 -0
- finance_dev/models/quotedata.py +49 -0
- finance_dev/models/quotesresponse.py +62 -0
- finance_dev/models/quotevalues.py +114 -0
- finance_dev/models/rating.py +193 -0
- finance_dev/models/ratingsaccuracy.py +242 -0
- finance_dev/models/replaceconfigwatchlistsop.py +40 -0
- finance_dev/models/replaceorderop.py +40 -0
- finance_dev/models/replaceordrequest_union.py +367 -0
- finance_dev/models/replaceordresponse.py +144 -0
- finance_dev/models/reportedbsitem.py +53 -0
- finance_dev/models/reportedfiling.py +110 -0
- finance_dev/models/reportedreport.py +39 -0
- finance_dev/models/reportingfrequency.py +16 -0
- finance_dev/models/revenuebreakdownaxis.py +52 -0
- finance_dev/models/revenuebreakdowndatapoint.py +58 -0
- finance_dev/models/revenuebreakdownentry.py +51 -0
- finance_dev/models/revenuebreakdowninner.py +75 -0
- finance_dev/models/revenueestimatesresponse.py +176 -0
- finance_dev/models/screenclause.py +70 -0
- finance_dev/models/screengroup.py +75 -0
- finance_dev/models/searchetbsymbolsop.py +40 -0
- finance_dev/models/searchindicesop.py +55 -0
- finance_dev/models/searchlogosop.py +158 -0
- finance_dev/models/searchmarketsymbolsop.py +80 -0
- finance_dev/models/searchop.py +232 -0
- finance_dev/models/searchsymbolitem.py +76 -0
- finance_dev/models/searchsymbolresponseitem.py +71 -0
- finance_dev/models/searchsymbolsop.py +77 -0
- finance_dev/models/secfiling.py +91 -0
- finance_dev/models/secfilingsresponse.py +39 -0
- finance_dev/models/sectoravgchange.py +50 -0
- finance_dev/models/security.py +59 -0
- finance_dev/models/securitytypeenum.py +16 -0
- finance_dev/models/shortinterestresponse.py +126 -0
- finance_dev/models/shortvolumeresponse.py +198 -0
- finance_dev/models/socialsentimentresponse.py +124 -0
- finance_dev/models/sortorderenum.py +13 -0
- finance_dev/models/spinoffsresponse.py +136 -0
- finance_dev/models/stockaggregatesresponse.py +92 -0
- finance_dev/models/stocklastquoteresponse.py +175 -0
- finance_dev/models/stocklasttraderesponse.py +169 -0
- finance_dev/models/stockohlcbar.py +85 -0
- finance_dev/models/stockopencloseresponse.py +109 -0
- finance_dev/models/stockpreviousdayresponse.py +86 -0
- finance_dev/models/stockquotesresponse.py +170 -0
- finance_dev/models/stockscreenerop.py +144 -0
- finance_dev/models/stockscreenerrequest.py +131 -0
- finance_dev/models/stockscreenerresponse.py +197 -0
- finance_dev/models/stocksnapshotsresponse.py +454 -0
- finance_dev/models/stocksplitsresponse.py +144 -0
- finance_dev/models/stocktradesresponse.py +164 -0
- finance_dev/models/supplychainresponse.py +158 -0
- finance_dev/models/supportresistancelevelsresponse.py +68 -0
- finance_dev/models/symboldetails.py +119 -0
- finance_dev/models/symbolerror.py +43 -0
- finance_dev/models/symbolinfo.py +183 -0
- finance_dev/models/synclogosop.py +146 -0
- finance_dev/models/technicalindicatorresponse.py +43 -0
- finance_dev/models/technicalindicatortype.py +21 -0
- finance_dev/models/technicalpatternsresponse.py +249 -0
- finance_dev/models/tenderofferidentifiertype.py +26 -0
- finance_dev/models/tenderoffersresponse.py +548 -0
- finance_dev/models/tickchartbars.py +104 -0
- finance_dev/models/tickresolution.py +20 -0
- finance_dev/models/timeinforceenum.py +26 -0
- finance_dev/models/tradeorderlegv2.py +164 -0
- finance_dev/models/tradeorderv2.py +434 -0
- finance_dev/models/transcriptresponse.py +162 -0
- finance_dev/models/transcriptsresponse.py +89 -0
- finance_dev/models/treasuryyieldsresponse.py +160 -0
- finance_dev/models/unifiedsnapshotresponse.py +308 -0
- finance_dev/models/updateconfigwatchlistbyidop.py +65 -0
- finance_dev/models/updatewatchlistrequest_union.py +134 -0
- finance_dev/models/upgradesdowngradesresponse.py +98 -0
- finance_dev/models/usaspendingresponse.py +222 -0
- finance_dev/models/usptopatentsresponse.py +134 -0
- finance_dev/models/visaapplicationsresponse.py +228 -0
- finance_dev/models/watchlist.py +68 -0
- finance_dev/models/watchlistrequest.py +43 -0
- finance_dev/models/watchlistresponse.py +44 -0
- finance_dev/news_sdk.py +829 -0
- finance_dev/options.py +3443 -0
- finance_dev/orders.py +1907 -0
- finance_dev/ownership.py +1386 -0
- finance_dev/predictions.py +29 -0
- finance_dev/predictions_orders.py +852 -0
- finance_dev/py.typed +1 -0
- finance_dev/sdk.py +347 -0
- finance_dev/sdkconfiguration.py +50 -0
- finance_dev/signals.py +338 -0
- finance_dev/stocks.py +3131 -0
- finance_dev/technicalanalysis_sdk.py +1137 -0
- finance_dev/types/__init__.py +25 -0
- finance_dev/types/base64fileinput.py +44 -0
- finance_dev/types/basemodel.py +78 -0
- finance_dev/utils/__init__.py +181 -0
- finance_dev/utils/annotations.py +80 -0
- finance_dev/utils/datetimes.py +42 -0
- finance_dev/utils/dynamic_imports.py +55 -0
- finance_dev/utils/enums.py +135 -0
- finance_dev/utils/eventstreaming.py +327 -0
- finance_dev/utils/forms.py +240 -0
- finance_dev/utils/headers.py +137 -0
- finance_dev/utils/logger.py +23 -0
- finance_dev/utils/metadata.py +120 -0
- finance_dev/utils/queryparams.py +218 -0
- finance_dev/utils/requestbodies.py +68 -0
- finance_dev/utils/retries.py +373 -0
- finance_dev/utils/security.py +199 -0
- finance_dev/utils/serializers.py +327 -0
- finance_dev/utils/unmarshal_json_response.py +39 -0
- finance_dev/utils/url.py +155 -0
- finance_dev/utils/values.py +143 -0
- finance_dev/watchlist_sdk.py +1583 -0
- finance_dev/websocket/__init__.py +57 -0
- finance_dev/websocket/account.py +5 -0
- finance_dev/websocket/auth.py +124 -0
- finance_dev/websocket/chart.py +5 -0
- finance_dev/websocket/codec.py +66 -0
- finance_dev/websocket/config.py +52 -0
- finance_dev/websocket/errors.py +54 -0
- finance_dev/websocket/market.py +5 -0
- finance_dev/websocket/models/__init__.py +52 -0
- finance_dev/websocket/models/account.py +60 -0
- finance_dev/websocket/models/chart.py +44 -0
- finance_dev/websocket/models/common.py +85 -0
- finance_dev/websocket/models/market.py +113 -0
- finance_dev/websocket/resources.py +327 -0
- finance_dev/websocket/sdk.py +13 -0
- finance_dev/websocket/transport/async_connection.py +493 -0
- finance_dev/websocket/transport/base.py +78 -0
- finance_dev/websocket/transport/sync_connection.py +470 -0
- finance_dev-0.9.0.dist-info/METADATA +913 -0
- finance_dev-0.9.0.dist-info/RECORD +486 -0
- finance_dev-0.9.0.dist-info/WHEEL +5 -0
- finance_dev-0.9.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: bdd1603013e1
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from datetime import date, datetime
|
|
6
|
+
from finance_dev.types import BaseModel, UNSET_SENTINEL
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import model_serializer
|
|
9
|
+
from typing import Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AccountBalanceV2TypedDict(TypedDict):
|
|
14
|
+
r"""Response body for GET /v2/accounts/{id}/balance. Returned as the **top-level JSON object**. Numeric amounts are decimal strings."""
|
|
15
|
+
|
|
16
|
+
account_id: NotRequired[str]
|
|
17
|
+
r"""Account these balances belong to. Match it to the account selected by the user."""
|
|
18
|
+
amount_available_to_withdraw: NotRequired[str]
|
|
19
|
+
r"""Cash currently available to withdraw from the account, returned as a decimal string."""
|
|
20
|
+
balance: NotRequired[str]
|
|
21
|
+
r"""Total account balance (net account value), returned as a decimal string. Use this as the headline portfolio value."""
|
|
22
|
+
cash_balance: NotRequired[str]
|
|
23
|
+
r"""Current cash balance in the account, returned as a decimal string. Can be negative on a margin account."""
|
|
24
|
+
cost_of_positions: NotRequired[str]
|
|
25
|
+
r"""Aggregate cost basis of all currently open positions, returned as a decimal string."""
|
|
26
|
+
credit: NotRequired[str]
|
|
27
|
+
r"""Total margin credit line extended to the account. Decimal string."""
|
|
28
|
+
credit_remaining: NotRequired[str]
|
|
29
|
+
r"""How much of the credit line is still available to draw against. Decimal string."""
|
|
30
|
+
day_open_pnl: NotRequired[str]
|
|
31
|
+
r"""Open (unrealized) profit/loss generated during the current trading day, returned as a decimal string."""
|
|
32
|
+
day_realized_pnl: NotRequired[str]
|
|
33
|
+
r"""Profit/loss realized from positions closed during the current trading day, returned as a decimal string."""
|
|
34
|
+
day_total_pnl: NotRequired[str]
|
|
35
|
+
r"""Total profit/loss for the current trading day, combining day open and day realized P&L (`dayOpenPnl` + `dayRealizedPnl`). Decimal string."""
|
|
36
|
+
day_trade_buying_power: NotRequired[str]
|
|
37
|
+
r"""How much the user can use for same-day round-trip trades. Typically up to 4× equity for pattern day traders. Resets at end of day. Decimal string."""
|
|
38
|
+
day_trade_overnight_reg_t_buying_power: NotRequired[str]
|
|
39
|
+
r"""Reg T overnight buying power available for day-trade-related calculations, returned as a decimal string."""
|
|
40
|
+
funds_available_for_withdrawal: NotRequired[str]
|
|
41
|
+
r"""Cash available to withdraw right now, returned as a decimal string. The lower of `creditRemaining` and `smaCreditRemaining`, adjusted by the clearing firm's previous-close haircut (`sodNetFundsAvailable` minus `sodGrossFundsAvailable`) and floored at zero. Derived at read time. Until the start-of-day funds data has loaded (see `sodFundsAvailableDate`) the haircut is zero and this equals the lower of the two credit figures."""
|
|
42
|
+
gross_margin: NotRequired[str]
|
|
43
|
+
r"""Total amount currently borrowed from the broker on margin (before offsets). Use this in risk and account-health displays. Decimal string."""
|
|
44
|
+
held_back_funds: NotRequired[str]
|
|
45
|
+
r"""Funds reserved or held back by the brokerage, returned as a decimal string. Subtract this from available cash displays when explaining restricted funds."""
|
|
46
|
+
intraday_margin_balance: NotRequired[str]
|
|
47
|
+
r"""Margin loan currently outstanding, returned as a positive decimal string and rolled forward through today's trading: the start-of-day margin trade balance (sign-inverted) plus `valueSold` minus `valueBought`. Derived at read time, not stored."""
|
|
48
|
+
maint_req: NotRequired[str]
|
|
49
|
+
r"""**Maintenance requirement** — the minimum equity that must be held to support current positions. Drop below this and the account may receive a margin call. Decimal string."""
|
|
50
|
+
net_buying_power: NotRequired[str]
|
|
51
|
+
r"""Total purchasing power available right now across all instruments — the main number to show as 'Buying Power' in a trading UI. Decimal string."""
|
|
52
|
+
open_pnl: NotRequired[str]
|
|
53
|
+
r"""Total open (unrealized) profit/loss across all currently held positions, returned as a decimal string. Mirrors `unrealizedPl`."""
|
|
54
|
+
option_buying_power: NotRequired[str]
|
|
55
|
+
r"""How much the user can spend specifically on options. Usually lower than stock buying power because options require cash. Decimal string."""
|
|
56
|
+
pdt: NotRequired[str]
|
|
57
|
+
r"""**Pattern Day Trader** flag balance — relates to FINRA Rule 4210 (four-day-trades-in-five-days rule, $25,000 minimum equity). Decimal string."""
|
|
58
|
+
pdt_credit_remaining: NotRequired[str]
|
|
59
|
+
r"""Remaining day-trade buying power for a PDT-flagged account. Decimal string."""
|
|
60
|
+
pending_orders_count: NotRequired[int]
|
|
61
|
+
r"""Number of orders currently pending. Use this to explain why available buying power may be reserved."""
|
|
62
|
+
pending_orders_margin_requirements: NotRequired[str]
|
|
63
|
+
r"""Estimated margin requirement reserved by pending orders, returned as a decimal string."""
|
|
64
|
+
realized_pl: NotRequired[str]
|
|
65
|
+
r"""Cumulative profit/loss from positions that have already been **closed**. Locked in — does not move with the market. Decimal string."""
|
|
66
|
+
settled_funds: NotRequired[str]
|
|
67
|
+
r"""Cash that has fully settled (T+1/T+2 has passed) and is freely available with no restrictions. Decimal string."""
|
|
68
|
+
sma: NotRequired[str]
|
|
69
|
+
r"""**Special Memorandum Account** — a Reg T concept. Effectively a stored-up pool of 'extra' buying power that grew from past gains in a margin account. Decimal string."""
|
|
70
|
+
sma_credit_remaining: NotRequired[str]
|
|
71
|
+
r"""Remaining SMA-based buying power still available to draw against, returned as a decimal string."""
|
|
72
|
+
sod_funds_available_date: NotRequired[date]
|
|
73
|
+
r"""Business date (YYYY-MM-DD) of the start-of-day funds data behind `sodGrossFundsAvailable` and `sodNetFundsAvailable`. Omitted when that data has not loaded for the account, which is the only way to tell a genuine zero from an unloaded one."""
|
|
74
|
+
sod_gross_funds_available: NotRequired[str]
|
|
75
|
+
r"""Gross funds available at the previous close, as reported by the clearing firm, returned as a decimal string. `\"0\"` until the start-of-day load has run; check `sodFundsAvailableDate` before relying on it."""
|
|
76
|
+
sod_margin_trade_balance: NotRequired[str]
|
|
77
|
+
r"""Start-of-day margin trade-date balance as reported by the clearing firm, returned as a decimal string. Negative while a margin loan is outstanding. `\"0\"` until the start-of-day load has run for the account."""
|
|
78
|
+
sod_net_funds_available: NotRequired[str]
|
|
79
|
+
r"""Net funds available to withdraw at the previous close, as reported by the clearing firm, returned as a decimal string. Previous-close only; for the live figure use `fundsAvailableForWithdrawal`. `\"0\"` until the start-of-day load has run."""
|
|
80
|
+
sod_positions_market_value: NotRequired[str]
|
|
81
|
+
r"""Market value of positions at the start of the day, returned as a decimal string. Use this for daily performance comparisons."""
|
|
82
|
+
sod_ttl_equity: NotRequired[str]
|
|
83
|
+
r"""Total account equity at the start of the day, returned as a decimal string. Use this as the baseline for day-over-day equity changes."""
|
|
84
|
+
sod_ttl_equity_updated_at: NotRequired[datetime]
|
|
85
|
+
r"""When start-of-day total equity (`sodTtlEquity`) was last updated, in RFC3339 format. Omitted when not set."""
|
|
86
|
+
start_of_day_cash: NotRequired[str]
|
|
87
|
+
r"""Cash balance when today's trading session opened. Useful as the baseline for calculating today's cash change. Decimal string."""
|
|
88
|
+
stock_buying_power: NotRequired[str]
|
|
89
|
+
r"""How much the user can spend specifically on stocks. On a margin account this is typically up to 2× cash. Decimal string."""
|
|
90
|
+
unrealized_pl: NotRequired[str]
|
|
91
|
+
r"""Profit/loss on positions the user currently **holds open** — paper gains/losses based on current market prices. Changes with the market. Decimal string."""
|
|
92
|
+
unsettled_funds: NotRequired[str]
|
|
93
|
+
r"""Cash from recent sales that hasn't settled yet. Usable for most trades, but cash accounts may restrict using it for new buys. Decimal string."""
|
|
94
|
+
value_bought: NotRequired[str]
|
|
95
|
+
r"""Total value bought for the reporting window, returned as a decimal string. Use this in trading activity summaries."""
|
|
96
|
+
value_sold: NotRequired[str]
|
|
97
|
+
r"""Total value sold for the reporting window, returned as a decimal string. Use this in trading activity summaries."""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class AccountBalanceV2(BaseModel):
|
|
101
|
+
r"""Response body for GET /v2/accounts/{id}/balance. Returned as the **top-level JSON object**. Numeric amounts are decimal strings."""
|
|
102
|
+
|
|
103
|
+
account_id: Annotated[Optional[str], pydantic.Field(alias="accountId")] = None
|
|
104
|
+
r"""Account these balances belong to. Match it to the account selected by the user."""
|
|
105
|
+
|
|
106
|
+
amount_available_to_withdraw: Annotated[
|
|
107
|
+
Optional[str], pydantic.Field(alias="amountAvailableToWithdraw")
|
|
108
|
+
] = None
|
|
109
|
+
r"""Cash currently available to withdraw from the account, returned as a decimal string."""
|
|
110
|
+
|
|
111
|
+
balance: Optional[str] = None
|
|
112
|
+
r"""Total account balance (net account value), returned as a decimal string. Use this as the headline portfolio value."""
|
|
113
|
+
|
|
114
|
+
cash_balance: Annotated[Optional[str], pydantic.Field(alias="cashBalance")] = None
|
|
115
|
+
r"""Current cash balance in the account, returned as a decimal string. Can be negative on a margin account."""
|
|
116
|
+
|
|
117
|
+
cost_of_positions: Annotated[
|
|
118
|
+
Optional[str], pydantic.Field(alias="costOfPositions")
|
|
119
|
+
] = None
|
|
120
|
+
r"""Aggregate cost basis of all currently open positions, returned as a decimal string."""
|
|
121
|
+
|
|
122
|
+
credit: Optional[str] = None
|
|
123
|
+
r"""Total margin credit line extended to the account. Decimal string."""
|
|
124
|
+
|
|
125
|
+
credit_remaining: Annotated[
|
|
126
|
+
Optional[str], pydantic.Field(alias="creditRemaining")
|
|
127
|
+
] = None
|
|
128
|
+
r"""How much of the credit line is still available to draw against. Decimal string."""
|
|
129
|
+
|
|
130
|
+
day_open_pnl: Annotated[Optional[str], pydantic.Field(alias="dayOpenPnl")] = None
|
|
131
|
+
r"""Open (unrealized) profit/loss generated during the current trading day, returned as a decimal string."""
|
|
132
|
+
|
|
133
|
+
day_realized_pnl: Annotated[
|
|
134
|
+
Optional[str], pydantic.Field(alias="dayRealizedPnl")
|
|
135
|
+
] = None
|
|
136
|
+
r"""Profit/loss realized from positions closed during the current trading day, returned as a decimal string."""
|
|
137
|
+
|
|
138
|
+
day_total_pnl: Annotated[Optional[str], pydantic.Field(alias="dayTotalPnl")] = None
|
|
139
|
+
r"""Total profit/loss for the current trading day, combining day open and day realized P&L (`dayOpenPnl` + `dayRealizedPnl`). Decimal string."""
|
|
140
|
+
|
|
141
|
+
day_trade_buying_power: Annotated[
|
|
142
|
+
Optional[str], pydantic.Field(alias="dayTradeBuyingPower")
|
|
143
|
+
] = None
|
|
144
|
+
r"""How much the user can use for same-day round-trip trades. Typically up to 4× equity for pattern day traders. Resets at end of day. Decimal string."""
|
|
145
|
+
|
|
146
|
+
day_trade_overnight_reg_t_buying_power: Annotated[
|
|
147
|
+
Optional[str], pydantic.Field(alias="dayTradeOvernightRegTBuyingPower")
|
|
148
|
+
] = None
|
|
149
|
+
r"""Reg T overnight buying power available for day-trade-related calculations, returned as a decimal string."""
|
|
150
|
+
|
|
151
|
+
funds_available_for_withdrawal: Annotated[
|
|
152
|
+
Optional[str], pydantic.Field(alias="fundsAvailableForWithdrawal")
|
|
153
|
+
] = None
|
|
154
|
+
r"""Cash available to withdraw right now, returned as a decimal string. The lower of `creditRemaining` and `smaCreditRemaining`, adjusted by the clearing firm's previous-close haircut (`sodNetFundsAvailable` minus `sodGrossFundsAvailable`) and floored at zero. Derived at read time. Until the start-of-day funds data has loaded (see `sodFundsAvailableDate`) the haircut is zero and this equals the lower of the two credit figures."""
|
|
155
|
+
|
|
156
|
+
gross_margin: Annotated[Optional[str], pydantic.Field(alias="grossMargin")] = None
|
|
157
|
+
r"""Total amount currently borrowed from the broker on margin (before offsets). Use this in risk and account-health displays. Decimal string."""
|
|
158
|
+
|
|
159
|
+
held_back_funds: Annotated[Optional[str], pydantic.Field(alias="heldBackFunds")] = (
|
|
160
|
+
None
|
|
161
|
+
)
|
|
162
|
+
r"""Funds reserved or held back by the brokerage, returned as a decimal string. Subtract this from available cash displays when explaining restricted funds."""
|
|
163
|
+
|
|
164
|
+
intraday_margin_balance: Annotated[
|
|
165
|
+
Optional[str], pydantic.Field(alias="intradayMarginBalance")
|
|
166
|
+
] = None
|
|
167
|
+
r"""Margin loan currently outstanding, returned as a positive decimal string and rolled forward through today's trading: the start-of-day margin trade balance (sign-inverted) plus `valueSold` minus `valueBought`. Derived at read time, not stored."""
|
|
168
|
+
|
|
169
|
+
maint_req: Annotated[Optional[str], pydantic.Field(alias="maintReq")] = None
|
|
170
|
+
r"""**Maintenance requirement** — the minimum equity that must be held to support current positions. Drop below this and the account may receive a margin call. Decimal string."""
|
|
171
|
+
|
|
172
|
+
net_buying_power: Annotated[
|
|
173
|
+
Optional[str], pydantic.Field(alias="netBuyingPower")
|
|
174
|
+
] = None
|
|
175
|
+
r"""Total purchasing power available right now across all instruments — the main number to show as 'Buying Power' in a trading UI. Decimal string."""
|
|
176
|
+
|
|
177
|
+
open_pnl: Annotated[Optional[str], pydantic.Field(alias="openPnl")] = None
|
|
178
|
+
r"""Total open (unrealized) profit/loss across all currently held positions, returned as a decimal string. Mirrors `unrealizedPl`."""
|
|
179
|
+
|
|
180
|
+
option_buying_power: Annotated[
|
|
181
|
+
Optional[str], pydantic.Field(alias="optionBuyingPower")
|
|
182
|
+
] = None
|
|
183
|
+
r"""How much the user can spend specifically on options. Usually lower than stock buying power because options require cash. Decimal string."""
|
|
184
|
+
|
|
185
|
+
pdt: Optional[str] = None
|
|
186
|
+
r"""**Pattern Day Trader** flag balance — relates to FINRA Rule 4210 (four-day-trades-in-five-days rule, $25,000 minimum equity). Decimal string."""
|
|
187
|
+
|
|
188
|
+
pdt_credit_remaining: Annotated[
|
|
189
|
+
Optional[str], pydantic.Field(alias="pdtCreditRemaining")
|
|
190
|
+
] = None
|
|
191
|
+
r"""Remaining day-trade buying power for a PDT-flagged account. Decimal string."""
|
|
192
|
+
|
|
193
|
+
pending_orders_count: Annotated[
|
|
194
|
+
Optional[int], pydantic.Field(alias="pendingOrdersCount")
|
|
195
|
+
] = None
|
|
196
|
+
r"""Number of orders currently pending. Use this to explain why available buying power may be reserved."""
|
|
197
|
+
|
|
198
|
+
pending_orders_margin_requirements: Annotated[
|
|
199
|
+
Optional[str], pydantic.Field(alias="pendingOrdersMarginRequirements")
|
|
200
|
+
] = None
|
|
201
|
+
r"""Estimated margin requirement reserved by pending orders, returned as a decimal string."""
|
|
202
|
+
|
|
203
|
+
realized_pl: Annotated[Optional[str], pydantic.Field(alias="realizedPl")] = None
|
|
204
|
+
r"""Cumulative profit/loss from positions that have already been **closed**. Locked in — does not move with the market. Decimal string."""
|
|
205
|
+
|
|
206
|
+
settled_funds: Annotated[Optional[str], pydantic.Field(alias="settledFunds")] = None
|
|
207
|
+
r"""Cash that has fully settled (T+1/T+2 has passed) and is freely available with no restrictions. Decimal string."""
|
|
208
|
+
|
|
209
|
+
sma: Optional[str] = None
|
|
210
|
+
r"""**Special Memorandum Account** — a Reg T concept. Effectively a stored-up pool of 'extra' buying power that grew from past gains in a margin account. Decimal string."""
|
|
211
|
+
|
|
212
|
+
sma_credit_remaining: Annotated[
|
|
213
|
+
Optional[str], pydantic.Field(alias="smaCreditRemaining")
|
|
214
|
+
] = None
|
|
215
|
+
r"""Remaining SMA-based buying power still available to draw against, returned as a decimal string."""
|
|
216
|
+
|
|
217
|
+
sod_funds_available_date: Annotated[
|
|
218
|
+
Optional[date], pydantic.Field(alias="sodFundsAvailableDate")
|
|
219
|
+
] = None
|
|
220
|
+
r"""Business date (YYYY-MM-DD) of the start-of-day funds data behind `sodGrossFundsAvailable` and `sodNetFundsAvailable`. Omitted when that data has not loaded for the account, which is the only way to tell a genuine zero from an unloaded one."""
|
|
221
|
+
|
|
222
|
+
sod_gross_funds_available: Annotated[
|
|
223
|
+
Optional[str], pydantic.Field(alias="sodGrossFundsAvailable")
|
|
224
|
+
] = None
|
|
225
|
+
r"""Gross funds available at the previous close, as reported by the clearing firm, returned as a decimal string. `\"0\"` until the start-of-day load has run; check `sodFundsAvailableDate` before relying on it."""
|
|
226
|
+
|
|
227
|
+
sod_margin_trade_balance: Annotated[
|
|
228
|
+
Optional[str], pydantic.Field(alias="sodMarginTradeBalance")
|
|
229
|
+
] = None
|
|
230
|
+
r"""Start-of-day margin trade-date balance as reported by the clearing firm, returned as a decimal string. Negative while a margin loan is outstanding. `\"0\"` until the start-of-day load has run for the account."""
|
|
231
|
+
|
|
232
|
+
sod_net_funds_available: Annotated[
|
|
233
|
+
Optional[str], pydantic.Field(alias="sodNetFundsAvailable")
|
|
234
|
+
] = None
|
|
235
|
+
r"""Net funds available to withdraw at the previous close, as reported by the clearing firm, returned as a decimal string. Previous-close only; for the live figure use `fundsAvailableForWithdrawal`. `\"0\"` until the start-of-day load has run."""
|
|
236
|
+
|
|
237
|
+
sod_positions_market_value: Annotated[
|
|
238
|
+
Optional[str], pydantic.Field(alias="sodPositionsMarketValue")
|
|
239
|
+
] = None
|
|
240
|
+
r"""Market value of positions at the start of the day, returned as a decimal string. Use this for daily performance comparisons."""
|
|
241
|
+
|
|
242
|
+
sod_ttl_equity: Annotated[Optional[str], pydantic.Field(alias="sodTtlEquity")] = (
|
|
243
|
+
None
|
|
244
|
+
)
|
|
245
|
+
r"""Total account equity at the start of the day, returned as a decimal string. Use this as the baseline for day-over-day equity changes."""
|
|
246
|
+
|
|
247
|
+
sod_ttl_equity_updated_at: Annotated[
|
|
248
|
+
Optional[datetime], pydantic.Field(alias="sodTtlEquityUpdatedAt")
|
|
249
|
+
] = None
|
|
250
|
+
r"""When start-of-day total equity (`sodTtlEquity`) was last updated, in RFC3339 format. Omitted when not set."""
|
|
251
|
+
|
|
252
|
+
start_of_day_cash: Annotated[
|
|
253
|
+
Optional[str], pydantic.Field(alias="startOfDayCash")
|
|
254
|
+
] = None
|
|
255
|
+
r"""Cash balance when today's trading session opened. Useful as the baseline for calculating today's cash change. Decimal string."""
|
|
256
|
+
|
|
257
|
+
stock_buying_power: Annotated[
|
|
258
|
+
Optional[str], pydantic.Field(alias="stockBuyingPower")
|
|
259
|
+
] = None
|
|
260
|
+
r"""How much the user can spend specifically on stocks. On a margin account this is typically up to 2× cash. Decimal string."""
|
|
261
|
+
|
|
262
|
+
unrealized_pl: Annotated[Optional[str], pydantic.Field(alias="unrealizedPl")] = None
|
|
263
|
+
r"""Profit/loss on positions the user currently **holds open** — paper gains/losses based on current market prices. Changes with the market. Decimal string."""
|
|
264
|
+
|
|
265
|
+
unsettled_funds: Annotated[
|
|
266
|
+
Optional[str], pydantic.Field(alias="unsettledFunds")
|
|
267
|
+
] = None
|
|
268
|
+
r"""Cash from recent sales that hasn't settled yet. Usable for most trades, but cash accounts may restrict using it for new buys. Decimal string."""
|
|
269
|
+
|
|
270
|
+
value_bought: Annotated[Optional[str], pydantic.Field(alias="valueBought")] = None
|
|
271
|
+
r"""Total value bought for the reporting window, returned as a decimal string. Use this in trading activity summaries."""
|
|
272
|
+
|
|
273
|
+
value_sold: Annotated[Optional[str], pydantic.Field(alias="valueSold")] = None
|
|
274
|
+
r"""Total value sold for the reporting window, returned as a decimal string. Use this in trading activity summaries."""
|
|
275
|
+
|
|
276
|
+
@model_serializer(mode="wrap")
|
|
277
|
+
def serialize_model(self, handler):
|
|
278
|
+
optional_fields = set(
|
|
279
|
+
[
|
|
280
|
+
"accountId",
|
|
281
|
+
"amountAvailableToWithdraw",
|
|
282
|
+
"balance",
|
|
283
|
+
"cashBalance",
|
|
284
|
+
"costOfPositions",
|
|
285
|
+
"credit",
|
|
286
|
+
"creditRemaining",
|
|
287
|
+
"dayOpenPnl",
|
|
288
|
+
"dayRealizedPnl",
|
|
289
|
+
"dayTotalPnl",
|
|
290
|
+
"dayTradeBuyingPower",
|
|
291
|
+
"dayTradeOvernightRegTBuyingPower",
|
|
292
|
+
"fundsAvailableForWithdrawal",
|
|
293
|
+
"grossMargin",
|
|
294
|
+
"heldBackFunds",
|
|
295
|
+
"intradayMarginBalance",
|
|
296
|
+
"maintReq",
|
|
297
|
+
"netBuyingPower",
|
|
298
|
+
"openPnl",
|
|
299
|
+
"optionBuyingPower",
|
|
300
|
+
"pdt",
|
|
301
|
+
"pdtCreditRemaining",
|
|
302
|
+
"pendingOrdersCount",
|
|
303
|
+
"pendingOrdersMarginRequirements",
|
|
304
|
+
"realizedPl",
|
|
305
|
+
"settledFunds",
|
|
306
|
+
"sma",
|
|
307
|
+
"smaCreditRemaining",
|
|
308
|
+
"sodFundsAvailableDate",
|
|
309
|
+
"sodGrossFundsAvailable",
|
|
310
|
+
"sodMarginTradeBalance",
|
|
311
|
+
"sodNetFundsAvailable",
|
|
312
|
+
"sodPositionsMarketValue",
|
|
313
|
+
"sodTtlEquity",
|
|
314
|
+
"sodTtlEquityUpdatedAt",
|
|
315
|
+
"startOfDayCash",
|
|
316
|
+
"stockBuyingPower",
|
|
317
|
+
"unrealizedPl",
|
|
318
|
+
"unsettledFunds",
|
|
319
|
+
"valueBought",
|
|
320
|
+
"valueSold",
|
|
321
|
+
]
|
|
322
|
+
)
|
|
323
|
+
serialized = handler(self)
|
|
324
|
+
m = {}
|
|
325
|
+
|
|
326
|
+
for n, f in type(self).model_fields.items():
|
|
327
|
+
k = f.alias or n
|
|
328
|
+
val = serialized.get(k, serialized.get(n))
|
|
329
|
+
|
|
330
|
+
if val != UNSET_SENTINEL:
|
|
331
|
+
if val is not None or k not in optional_fields:
|
|
332
|
+
m[k] = val
|
|
333
|
+
|
|
334
|
+
return m
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
try:
|
|
338
|
+
AccountBalanceV2.model_rebuild()
|
|
339
|
+
except NameError:
|
|
340
|
+
pass
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 9f4ff8f87f18
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from finance_dev import models, utils
|
|
7
|
+
from finance_dev.types import BaseModel
|
|
8
|
+
from pydantic import field_serializer
|
|
9
|
+
from typing_extensions import TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AccountItemStatus(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
13
|
+
r"""Account status. **OPEN** = account open for trading; **SUSPENDED** = account suspended; **CLOSED** = account closed; **PENDING_APEX_VERIFICATION** = sent to Apex, awaiting verification; **CANCELED** = account canceled; **REJECTED** = application/account rejected."""
|
|
14
|
+
|
|
15
|
+
NEW = "NEW"
|
|
16
|
+
PENDING_PLAID_VERIFICATION = "PENDING_PLAID_VERIFICATION"
|
|
17
|
+
PENDING_APEX_VERIFICATION = "PENDING_APEX_VERIFICATION"
|
|
18
|
+
READY_FOR_BACK_OFFICE = "READY_FOR_BACK_OFFICE"
|
|
19
|
+
BACK_OFFICE = "BACK_OFFICE"
|
|
20
|
+
OPEN = "OPEN"
|
|
21
|
+
CANCELED = "CANCELED"
|
|
22
|
+
REJECTED = "REJECTED"
|
|
23
|
+
SUSPENDED = "SUSPENDED"
|
|
24
|
+
CLOSED = "CLOSED"
|
|
25
|
+
ERROR = "ERROR"
|
|
26
|
+
AWAITING_REVIEW = "AWAITING_REVIEW"
|
|
27
|
+
AWAITING_APEX = "AWAITING_APEX"
|
|
28
|
+
RETURNED_APEX = "RETURNED_APEX"
|
|
29
|
+
PENDING_CLOSE = "PENDING_CLOSE"
|
|
30
|
+
STERLING_PENDING = "STERLING_PENDING"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class AccountItemTypedDict(TypedDict):
|
|
34
|
+
r"""User account item returned by GET /v2/users/me/accounts. Use `trading_account_id` as the `tradingAccountId` in order API requests. Account type and class are empty when broker metadata is unavailable (e.g. simulation accounts)."""
|
|
35
|
+
|
|
36
|
+
account_class: str
|
|
37
|
+
r"""Account class (for example MARGIN or CASH). Empty for simulation accounts or when broker metadata is unavailable."""
|
|
38
|
+
account_type: str
|
|
39
|
+
r"""Account type (for example INDIVIDUAL or JOINT). Empty for simulation accounts or when broker metadata is unavailable."""
|
|
40
|
+
broker_account_id: str
|
|
41
|
+
r"""Broker account identifier. Empty for simulation accounts and for accounts not yet opened with the broker."""
|
|
42
|
+
is_sim: bool
|
|
43
|
+
r"""Whether this is a simulation (paper trading) account."""
|
|
44
|
+
status: AccountItemStatus
|
|
45
|
+
r"""Account status. **OPEN** = account open for trading; **SUSPENDED** = account suspended; **CLOSED** = account closed; **PENDING_APEX_VERIFICATION** = sent to Apex, awaiting verification; **CANCELED** = account canceled; **REJECTED** = application/account rejected."""
|
|
46
|
+
trading_account_id: str
|
|
47
|
+
r"""Trading account identifier. Pass this value as `tradingAccountId` when placing, replacing, or canceling orders. Empty until the trading account has been created."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class AccountItem(BaseModel):
|
|
51
|
+
r"""User account item returned by GET /v2/users/me/accounts. Use `trading_account_id` as the `tradingAccountId` in order API requests. Account type and class are empty when broker metadata is unavailable (e.g. simulation accounts)."""
|
|
52
|
+
|
|
53
|
+
account_class: str
|
|
54
|
+
r"""Account class (for example MARGIN or CASH). Empty for simulation accounts or when broker metadata is unavailable."""
|
|
55
|
+
|
|
56
|
+
account_type: str
|
|
57
|
+
r"""Account type (for example INDIVIDUAL or JOINT). Empty for simulation accounts or when broker metadata is unavailable."""
|
|
58
|
+
|
|
59
|
+
broker_account_id: str
|
|
60
|
+
r"""Broker account identifier. Empty for simulation accounts and for accounts not yet opened with the broker."""
|
|
61
|
+
|
|
62
|
+
is_sim: bool
|
|
63
|
+
r"""Whether this is a simulation (paper trading) account."""
|
|
64
|
+
|
|
65
|
+
status: AccountItemStatus
|
|
66
|
+
r"""Account status. **OPEN** = account open for trading; **SUSPENDED** = account suspended; **CLOSED** = account closed; **PENDING_APEX_VERIFICATION** = sent to Apex, awaiting verification; **CANCELED** = account canceled; **REJECTED** = application/account rejected."""
|
|
67
|
+
|
|
68
|
+
trading_account_id: str
|
|
69
|
+
r"""Trading account identifier. Pass this value as `tradingAccountId` when placing, replacing, or canceling orders. Empty until the trading account has been created."""
|
|
70
|
+
|
|
71
|
+
@field_serializer("status")
|
|
72
|
+
def serialize_status(self, value):
|
|
73
|
+
if isinstance(value, str):
|
|
74
|
+
try:
|
|
75
|
+
return models.AccountItemStatus(value)
|
|
76
|
+
except ValueError:
|
|
77
|
+
return value
|
|
78
|
+
return value
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 4e662fb20d35
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from finance_dev import models, utils
|
|
8
|
+
from finance_dev.types import BaseModel, UNSET_SENTINEL
|
|
9
|
+
import pydantic
|
|
10
|
+
from pydantic import field_serializer, model_serializer
|
|
11
|
+
from typing import Optional
|
|
12
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AccountPositionSecurityType(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
16
|
+
r"""Indicates whether the position is an equity/stock position or an option position. Use this value to decide which position details and actions should be shown in the UI.
|
|
17
|
+
- `EQUITY` — a stock or ETF position.
|
|
18
|
+
- `OPTION` — an option contract position.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
EQUITY = "EQUITY"
|
|
22
|
+
OPTION = "OPTION"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class AccountPositionTypedDict(TypedDict):
|
|
26
|
+
r"""One open position in the account positions list. Field names and types are stable across REST and WebSocket order updates."""
|
|
27
|
+
|
|
28
|
+
account_id: NotRequired[str]
|
|
29
|
+
r"""Account this position belongs to. Match it to the account selected by the user."""
|
|
30
|
+
average_price: NotRequired[str]
|
|
31
|
+
r"""Average entry price per share or contract, returned as a decimal string. This value can be used with quantity and current market price to calculate position-level profit/loss."""
|
|
32
|
+
cost_basis: NotRequired[str]
|
|
33
|
+
r"""Total cost basis of the position, returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
34
|
+
created_at: NotRequired[datetime]
|
|
35
|
+
r"""Timestamp when the current net position was established, returned in RFC3339 format. If the position is closed and reopened, this resets to the new establishment time rather than the first lot's open time. Omitted when not available."""
|
|
36
|
+
market_value: NotRequired[str]
|
|
37
|
+
r"""Current market value of the position (`quantity` × `price`), returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
38
|
+
price: NotRequired[str]
|
|
39
|
+
r"""Current market price per share or contract, returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
40
|
+
quantity: NotRequired[str]
|
|
41
|
+
r"""Current position quantity, returned as a decimal string. Positive values represent long positions. Negative values may represent short positions, depending on brokerage conventions."""
|
|
42
|
+
security_type: NotRequired[AccountPositionSecurityType]
|
|
43
|
+
r"""Indicates whether the position is an equity/stock position or an option position. Use this value to decide which position details and actions should be shown in the UI.
|
|
44
|
+
- `EQUITY` — a stock or ETF position.
|
|
45
|
+
- `OPTION` — an option contract position.
|
|
46
|
+
"""
|
|
47
|
+
symbol: NotRequired[str]
|
|
48
|
+
r"""Symbol for the held instrument. Use this to link the position to quotes, charts, and research."""
|
|
49
|
+
today_pl: NotRequired[str]
|
|
50
|
+
r"""Profit or loss for the current trading day, returned as a decimal string."""
|
|
51
|
+
today_realized_pn_l: NotRequired[str]
|
|
52
|
+
r"""Profit or loss realized today from closed activity in this symbol, returned as a decimal string."""
|
|
53
|
+
unrealized_pl: NotRequired[str]
|
|
54
|
+
r"""Profit or loss on the open position at current market prices, returned as a decimal string."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AccountPosition(BaseModel):
|
|
58
|
+
r"""One open position in the account positions list. Field names and types are stable across REST and WebSocket order updates."""
|
|
59
|
+
|
|
60
|
+
account_id: Annotated[Optional[str], pydantic.Field(alias="accountId")] = None
|
|
61
|
+
r"""Account this position belongs to. Match it to the account selected by the user."""
|
|
62
|
+
|
|
63
|
+
average_price: Annotated[Optional[str], pydantic.Field(alias="averagePrice")] = None
|
|
64
|
+
r"""Average entry price per share or contract, returned as a decimal string. This value can be used with quantity and current market price to calculate position-level profit/loss."""
|
|
65
|
+
|
|
66
|
+
cost_basis: Annotated[Optional[str], pydantic.Field(alias="costBasis")] = None
|
|
67
|
+
r"""Total cost basis of the position, returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
68
|
+
|
|
69
|
+
created_at: Annotated[Optional[datetime], pydantic.Field(alias="createdAt")] = None
|
|
70
|
+
r"""Timestamp when the current net position was established, returned in RFC3339 format. If the position is closed and reopened, this resets to the new establishment time rather than the first lot's open time. Omitted when not available."""
|
|
71
|
+
|
|
72
|
+
market_value: Annotated[Optional[str], pydantic.Field(alias="marketValue")] = None
|
|
73
|
+
r"""Current market value of the position (`quantity` × `price`), returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
74
|
+
|
|
75
|
+
price: Optional[str] = None
|
|
76
|
+
r"""Current market price per share or contract, returned as a decimal string. Omitted when unavailable (for example, on a closed position with zero quantity)."""
|
|
77
|
+
|
|
78
|
+
quantity: Optional[str] = None
|
|
79
|
+
r"""Current position quantity, returned as a decimal string. Positive values represent long positions. Negative values may represent short positions, depending on brokerage conventions."""
|
|
80
|
+
|
|
81
|
+
security_type: Annotated[
|
|
82
|
+
Optional[AccountPositionSecurityType], pydantic.Field(alias="securityType")
|
|
83
|
+
] = None
|
|
84
|
+
r"""Indicates whether the position is an equity/stock position or an option position. Use this value to decide which position details and actions should be shown in the UI.
|
|
85
|
+
- `EQUITY` — a stock or ETF position.
|
|
86
|
+
- `OPTION` — an option contract position.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
symbol: Optional[str] = None
|
|
90
|
+
r"""Symbol for the held instrument. Use this to link the position to quotes, charts, and research."""
|
|
91
|
+
|
|
92
|
+
today_pl: Annotated[Optional[str], pydantic.Field(alias="todayPl")] = None
|
|
93
|
+
r"""Profit or loss for the current trading day, returned as a decimal string."""
|
|
94
|
+
|
|
95
|
+
today_realized_pn_l: Annotated[
|
|
96
|
+
Optional[str], pydantic.Field(alias="todayRealizedPnL")
|
|
97
|
+
] = None
|
|
98
|
+
r"""Profit or loss realized today from closed activity in this symbol, returned as a decimal string."""
|
|
99
|
+
|
|
100
|
+
unrealized_pl: Annotated[Optional[str], pydantic.Field(alias="unrealizedPl")] = None
|
|
101
|
+
r"""Profit or loss on the open position at current market prices, returned as a decimal string."""
|
|
102
|
+
|
|
103
|
+
@field_serializer("security_type")
|
|
104
|
+
def serialize_security_type(self, value):
|
|
105
|
+
if isinstance(value, str):
|
|
106
|
+
try:
|
|
107
|
+
return models.AccountPositionSecurityType(value)
|
|
108
|
+
except ValueError:
|
|
109
|
+
return value
|
|
110
|
+
return value
|
|
111
|
+
|
|
112
|
+
@model_serializer(mode="wrap")
|
|
113
|
+
def serialize_model(self, handler):
|
|
114
|
+
optional_fields = set(
|
|
115
|
+
[
|
|
116
|
+
"accountId",
|
|
117
|
+
"averagePrice",
|
|
118
|
+
"costBasis",
|
|
119
|
+
"createdAt",
|
|
120
|
+
"marketValue",
|
|
121
|
+
"price",
|
|
122
|
+
"quantity",
|
|
123
|
+
"securityType",
|
|
124
|
+
"symbol",
|
|
125
|
+
"todayPl",
|
|
126
|
+
"todayRealizedPnL",
|
|
127
|
+
"unrealizedPl",
|
|
128
|
+
]
|
|
129
|
+
)
|
|
130
|
+
serialized = handler(self)
|
|
131
|
+
m = {}
|
|
132
|
+
|
|
133
|
+
for n, f in type(self).model_fields.items():
|
|
134
|
+
k = f.alias or n
|
|
135
|
+
val = serialized.get(k, serialized.get(n))
|
|
136
|
+
|
|
137
|
+
if val != UNSET_SENTINEL:
|
|
138
|
+
if val is not None or k not in optional_fields:
|
|
139
|
+
m[k] = val
|
|
140
|
+
|
|
141
|
+
return m
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
try:
|
|
145
|
+
AccountPosition.model_rebuild()
|
|
146
|
+
except NameError:
|
|
147
|
+
pass
|