diff --git a/HISTORY.rst b/HISTORY.rst index 79dd454c..af51aaba 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,6 +5,7 @@ History 0.14.0 (2020-12-XX - Unreleased) -------------------------------- * Feature (Name #Number) +* Feature: Added 3 new methods for fundamentals-endpoint: definitions, daily and statements * Development: Run tests in Github Actions instead of Travis.org * [/news] Fix bug in get_news() when sources list is empty (#566) diff --git a/tests/fixtures/fundamentals_daily.yaml b/tests/fixtures/fundamentals_daily.yaml new file mode 100644 index 00000000..6dedd1b3 --- /dev/null +++ b/tests/fixtures/fundamentals_daily.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Token 0000000000000000000000000000000000000000 + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - tiingo-python-client 0.13.0 + method: GET + uri: https://api.tiingo.com/tiingo/fundamentals/GOOGL/daily?startDate=2020-1-1&endDate=2020-4-1&format=json + response: + body: + string: '[{"date":"2019-12-31T00:00:00.000Z","marketCap":923760472316.1099853516,"enterpriseVal":920030472316.1099853516,"peRatio":27.0147236789,"pbRatio":4.5857391821,"trailingPEG1Y":1.3434349073},{"date":"2020-01-02T00:00:00.000Z","marketCap":943961417697.3199462891,"enterpriseVal":940231417697.3199462891,"peRatio":27.6054860831,"pbRatio":4.686020878,"trailingPEG1Y":1.372813362},{"date":"2020-01-03T00:00:00.000Z","marketCap":939023255562.4799804688,"enterpriseVal":935293255562.4799804688,"peRatio":27.4610730133,"pbRatio":4.6615068137,"trailingPEG1Y":1.365631739},{"date":"2020-01-06T00:00:00.000Z","marketCap":964052013086.6899414062,"enterpriseVal":960322013086.6899414062,"peRatio":28.1930213796,"pbRatio":4.7857547735,"trailingPEG1Y":1.4020313335},{"date":"2020-01-07T00:00:00.000Z","marketCap":962189856974.3900146484,"enterpriseVal":958459856974.3900146484,"peRatio":28.1385639371,"pbRatio":4.7765106431,"trailingPEG1Y":1.3993231796},{"date":"2020-01-08T00:00:00.000Z","marketCap":969038453342.9599609375,"enterpriseVal":965308453342.9599609375,"peRatio":28.338846309,"pbRatio":4.8105085004,"trailingPEG1Y":1.4092831678},{"date":"2020-01-09T00:00:00.000Z","marketCap":979211343215.7099609375,"enterpriseVal":975481343215.7099609375,"peRatio":28.6363453005,"pbRatio":4.8610088423,"trailingPEG1Y":1.4240777122},{"date":"2020-01-10T00:00:00.000Z","marketCap":985535777123.0400390625,"enterpriseVal":981805777123.0400390625,"peRatio":28.8212989109,"pbRatio":4.8924046481,"trailingPEG1Y":1.4332754053},{"date":"2020-01-13T00:00:00.000Z","marketCap":993170617183.4699707031,"enterpriseVal":989440617183.4699707031,"peRatio":29.0445744252,"pbRatio":4.9303055827,"trailingPEG1Y":1.4443788363},{"date":"2020-01-14T00:00:00.000Z","marketCap":986659967664.9100341797,"enterpriseVal":982929967664.9100341797,"peRatio":28.8541750706,"pbRatio":4.8979853639,"trailingPEG1Y":1.4349103278},{"date":"2020-01-15T00:00:00.000Z","marketCap":992598176600.8000488281,"enterpriseVal":988868176600.8000488281,"peRatio":29.027833804,"pbRatio":4.9274638685,"trailingPEG1Y":1.4435463297},{"date":"2020-01-16T00:00:00.000Z","marketCap":1000157151041.8399658203,"enterpriseVal":996427151041.8399658203,"peRatio":29.2488906817,"pbRatio":4.9649881904,"trailingPEG1Y":1.4545394285},{"date":"2020-01-17T00:00:00.000Z","marketCap":1020406374544.4799804688,"enterpriseVal":1016676374544.4799804688,"peRatio":29.8410649455,"pbRatio":5.0655095489,"trailingPEG1Y":1.4839880946},{"date":"2020-01-21T00:00:00.000Z","marketCap":1022289221280.25,"enterpriseVal":1018559221280.25,"peRatio":29.8961274708,"pbRatio":5.0748563918,"trailingPEG1Y":1.4867263391},{"date":"2020-01-22T00:00:00.000Z","marketCap":1023613421182.3299560547,"enterpriseVal":1019883421182.3299560547,"peRatio":29.9348527632,"pbRatio":5.0814299956,"trailingPEG1Y":1.4886521374},{"date":"2020-01-23T00:00:00.000Z","marketCap":1023972058655.8100585938,"enterpriseVal":1020242058655.8100585938,"peRatio":29.9453408633,"pbRatio":5.0832103467,"trailingPEG1Y":1.4891737078},{"date":"2020-01-24T00:00:00.000Z","marketCap":1011199047100.3299560547,"enterpriseVal":1007469047100.3299560547,"peRatio":29.5718031464,"pbRatio":5.0198024598,"trailingPEG1Y":1.4705977781},{"date":"2020-01-27T00:00:00.000Z","marketCap":987446211356.7700195312,"enterpriseVal":983716211356.7700195312,"peRatio":28.877168213,"pbRatio":4.9018884411,"trailingPEG1Y":1.4360537706},{"date":"2020-01-28T00:00:00.000Z","marketCap":1000391644774.5,"enterpriseVal":996661644774.5,"peRatio":29.2557482856,"pbRatio":4.966152266,"trailingPEG1Y":1.4548804553},{"date":"2020-01-29T00:00:00.000Z","marketCap":1004667706958.3000488281,"enterpriseVal":1000937706958.3000488281,"peRatio":29.3807987092,"pbRatio":4.9873795284,"trailingPEG1Y":1.461099179},{"date":"2020-01-30T00:00:00.000Z","marketCap":1002977972708.25,"enterpriseVal":999247972708.25,"peRatio":29.3313836224,"pbRatio":4.978991336,"trailingPEG1Y":1.4586417801},{"date":"2020-01-31T00:00:00.000Z","marketCap":988170383178.2199707031,"enterpriseVal":984440383178.2199707031,"peRatio":28.8983461073,"pbRatio":4.9054833807,"trailingPEG1Y":1.4371069416},{"date":"2020-02-03T00:00:00.000Z","marketCap":1022530611887.4000244141,"enterpriseVal":1018800611887.4000244141,"peRatio":29.9031867689,"pbRatio":5.076054705,"trailingPEG1Y":1.4870773961},{"date":"2020-02-04T00:00:00.000Z","marketCap":993410187346.9000244141,"enterpriseVal":989680187346.9000244141,"peRatio":29.1530859217,"pbRatio":4.9487253684,"trailingPEG1Y":1.4497750837},{"date":"2020-02-05T00:00:00.000Z","marketCap":993850050444.5,"enterpriseVal":990120050444.5,"peRatio":29.1659943526,"pbRatio":4.9509165697,"trailingPEG1Y":1.4504170165},{"date":"2020-02-06T00:00:00.000Z","marketCap":1014413650257.3000488281,"enterpriseVal":1010683650257.3000488281,"peRatio":29.7694634933,"pbRatio":5.0533552293,"trailingPEG1Y":1.4804273737},{"date":"2020-02-07T00:00:00.000Z","marketCap":1016571728579.9000244141,"enterpriseVal":1012841728579.9000244141,"peRatio":29.832795482,"pbRatio":5.0641058106,"trailingPEG1Y":1.4835768564},{"date":"2020-02-10T00:00:00.000Z","marketCap":1036881032539.4000244141,"enterpriseVal":1033151032539.4000244141,"peRatio":30.4288019363,"pbRatio":5.165277682,"trailingPEG1Y":1.5132160963},{"date":"2020-02-11T00:00:00.000Z","marketCap":1037843233065.4000244141,"enterpriseVal":1034113233065.4000244141,"peRatio":30.4570391287,"pbRatio":5.1700709347,"trailingPEG1Y":1.5146203242},{"date":"2020-02-12T00:00:00.000Z","marketCap":1043733274856.6999511719,"enterpriseVal":1040003274856.6999511719,"peRatio":30.6298910851,"pbRatio":5.1994124893,"trailingPEG1Y":1.5232162053},{"date":"2020-02-13T00:00:00.000Z","marketCap":1040131895745.0999755859,"enterpriseVal":1036401895745.0999755859,"peRatio":30.5242033078,"pbRatio":5.1814720289,"trailingPEG1Y":1.5179603807},{"date":"2020-02-14T00:00:00.000Z","marketCap":1043802003465.6999511719,"enterpriseVal":1040072003465.6999511719,"peRatio":30.6319080274,"pbRatio":5.1997548645,"trailingPEG1Y":1.5233165073},{"date":"2020-02-18T00:00:00.000Z","marketCap":1044289976589.5999755859,"enterpriseVal":1040559976589.5999755859,"peRatio":30.6462283179,"pbRatio":5.2021857284,"trailingPEG1Y":1.5240286515},{"date":"2020-02-19T00:00:00.000Z","marketCap":1048021940058.3000488281,"enterpriseVal":1044291940058.3000488281,"peRatio":30.7557482856,"pbRatio":5.2207767018,"trailingPEG1Y":1.5294750499},{"date":"2020-02-20T00:00:00.000Z","marketCap":1042606125669.0999755859,"enterpriseVal":1038876125669.0999755859,"peRatio":30.5968132311,"pbRatio":5.1937975361,"trailingPEG1Y":1.5215712526},{"date":"2020-02-21T00:00:00.000Z","marketCap":1019561423071.4000244141,"enterpriseVal":1015831423071.4000244141,"peRatio":29.9205324728,"pbRatio":5.0789991317,"trailingPEG1Y":1.4879399932},{"date":"2020-02-24T00:00:00.000Z","marketCap":975850027747.4000244141,"enterpriseVal":972120027747.4000244141,"peRatio":28.6377571601,"pbRatio":4.861248505,"trailingPEG1Y":1.4241479236},{"date":"2020-02-25T00:00:00.000Z","marketCap":952798452288.8000488281,"enterpriseVal":949068452288.8000488281,"peRatio":27.9612747075,"pbRatio":4.7464158631,"trailingPEG1Y":1.3905066341},{"date":"2020-02-26T00:00:00.000Z","marketCap":955650689562.3000488281,"enterpriseVal":951920689562.3000488281,"peRatio":28.0449778136,"pbRatio":4.7606244339,"trailingPEG1Y":1.3946691669},{"date":"2020-02-27T00:00:00.000Z","marketCap":903746844045.5,"enterpriseVal":900016844045.5,"peRatio":26.521782977,"pbRatio":4.5020626834,"trailingPEG1Y":1.3189210994},{"date":"2020-02-28T00:00:00.000Z","marketCap":920447896032.5,"enterpriseVal":916717896032.5,"peRatio":27.0118999597,"pbRatio":4.5852598568,"trailingPEG1Y":1.3432944845},{"date":"2020-03-02T00:00:00.000Z","marketCap":952798452288.8000488281,"enterpriseVal":949068452288.8000488281,"peRatio":27.9612747075,"pbRatio":4.7464158631,"trailingPEG1Y":1.3905066341},{"date":"2020-03-03T00:00:00.000Z","marketCap":919396348314.8000488281,"enterpriseVal":915666348314.8000488281,"peRatio":26.9810407422,"pbRatio":4.5800215162,"trailingPEG1Y":1.3417598639},{"date":"2020-03-04T00:00:00.000Z","marketCap":949554461944.0,"enterpriseVal":945824461944.0,"peRatio":27.8660750303,"pbRatio":4.7302557537,"trailingPEG1Y":1.3857723799},{"date":"2020-03-05T00:00:00.000Z","marketCap":903616259688.4000244141,"enterpriseVal":899886259688.4000244141,"peRatio":26.5179507866,"pbRatio":4.5014121705,"trailingPEG1Y":1.3187305256},{"date":"2020-03-06T00:00:00.000Z","marketCap":890544078256.5999755859,"enterpriseVal":886814078256.5999755859,"peRatio":26.1343283582,"pbRatio":4.4362924076,"trailingPEG1Y":1.2996530859},{"date":"2020-03-09T00:00:00.000Z","marketCap":835595555361.0999755859,"enterpriseVal":831865555361.0999755859,"peRatio":24.521782977,"pbRatio":4.1625634357,"trailingPEG1Y":1.2194616399},{"date":"2020-03-10T00:00:00.000Z","marketCap":876406603385.3000488281,"enterpriseVal":872676603385.3000488281,"peRatio":25.7194433239,"pbRatio":4.3658658291,"trailingPEG1Y":1.2790209653},{"date":"2020-03-11T00:00:00.000Z","marketCap":832234726381.0,"enterpriseVal":828504726381.0,"peRatio":24.4231544978,"pbRatio":4.1458212885,"trailingPEG1Y":1.2145568723},{"date":"2020-03-12T00:00:00.000Z","marketCap":763952853339.5,"enterpriseVal":760222853339.5,"peRatio":22.4193223074,"pbRatio":3.805671528,"trailingPEG1Y":1.1149068391},{"date":"2020-03-13T00:00:00.000Z","marketCap":834550880504.3000488281,"enterpriseVal":830820880504.3000488281,"peRatio":24.4911254538,"pbRatio":4.1573593327,"trailingPEG1Y":1.2179370496},{"date":"2020-03-16T00:00:00.000Z","marketCap":737457974570.0,"enterpriseVal":733727974570.0,"peRatio":21.6417910448,"pbRatio":3.6736858886,"trailingPEG1Y":1.0762404195},{"date":"2020-03-17T00:00:00.000Z","marketCap":768427085785.4000244141,"enterpriseVal":764697085785.4000244141,"peRatio":22.5506252521,"pbRatio":3.8279601534,"trailingPEG1Y":1.121436499},{"date":"2020-03-18T00:00:00.000Z","marketCap":749959708547.0999755859,"enterpriseVal":746229708547.0999755859,"peRatio":22.008672852,"pbRatio":3.7359639374,"trailingPEG1Y":1.0944853526},{"date":"2020-03-19T00:00:00.000Z","marketCap":764035327670.3000488281,"enterpriseVal":760305327670.3000488281,"peRatio":22.4217426382,"pbRatio":3.8060823782,"trailingPEG1Y":1.1150272015},{"date":"2020-03-20T00:00:00.000Z","marketCap":734165874198.9000244141,"enterpriseVal":730435874198.9000244141,"peRatio":21.5451795079,"pbRatio":3.6572861166,"trailingPEG1Y":1.0714359539},{"date":"2020-03-23T00:00:00.000Z","marketCap":724488886051.6999511719,"enterpriseVal":720758886051.6999511719,"peRatio":21.2611940299,"pbRatio":3.6090796885,"trailingPEG1Y":1.0573134328},{"date":"2020-03-24T00:00:00.000Z","marketCap":776640154560.9000244141,"enterpriseVal":772910154560.9000244141,"peRatio":22.7916498588,"pbRatio":3.8688739898,"trailingPEG1Y":1.1334225876},{"date":"2020-03-25T00:00:00.000Z","marketCap":757128102465.8000488281,"enterpriseVal":753398102465.8000488281,"peRatio":22.2190399355,"pbRatio":3.7716736707,"trailingPEG1Y":1.1049468508},{"date":"2020-03-26T00:00:00.000Z","marketCap":799258739782.8000488281,"enterpriseVal":795528739782.8000488281,"peRatio":23.4554255748,"pbRatio":3.9815496679,"trailingPEG1Y":1.1664319745},{"date":"2020-03-27T00:00:00.000Z","marketCap":763066254283.4000244141,"enterpriseVal":759336254283.4000244141,"peRatio":22.3933037515,"pbRatio":3.8012548879,"trailingPEG1Y":1.1136129433},{"date":"2020-03-30T00:00:00.000Z","marketCap":787842917827.9000244141,"enterpriseVal":784112917827.9000244141,"peRatio":23.1204114562,"pbRatio":3.9246811472,"trailingPEG1Y":1.149771813},{"date":"2020-03-31T00:00:00.000Z","marketCap":798592072275.5,"enterpriseVal":794440072275.5,"peRatio":23.2576060849,"pbRatio":3.921221612,"trailingPEG1Y":5.8633649024},{"date":"2020-04-01T00:00:00.000Z","marketCap":757457999789.0,"enterpriseVal":753305999789.0,"peRatio":22.0596477182,"pbRatio":3.7192463863,"trailingPEG1Y":5.5613532932}]' + headers: + allow: + - GET, HEAD, OPTIONS + content-length: + - '11840' + content-type: + - application/json + date: + - Sat, 06 Feb 2021 16:23:38 GMT + server: + - nginx/1.14.0 (Ubuntu) + vary: + - Accept, Cookie, Origin + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/fundamentals_daily_csv.yaml b/tests/fixtures/fundamentals_daily_csv.yaml new file mode 100644 index 00000000..ac533356 --- /dev/null +++ b/tests/fixtures/fundamentals_daily_csv.yaml @@ -0,0 +1,170 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Token 0000000000000000000000000000000000000000 + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - tiingo-python-client 0.13.0 + method: GET + uri: https://api.tiingo.com/tiingo/fundamentals/GOOGL/daily?startDate=2020-1-1&endDate=2020-4-1&format=csv + response: + body: + string: 'date,marketCap,enterpriseVal,peRatio,pbRatio,trailingPEG1Y + + 2019-12-31,923760472316.11,920030472316.11,27.0147236789028,4.58573918207776,1.34343490727517 + + 2020-01-02,943961417697.32,940231417697.32,27.605486083098,4.68602087795653,1.37281336197028 + + 2020-01-03,939023255562.48,935293255562.48,27.4610730133118,4.66150681368572,1.36563173904037 + + 2020-01-06,964052013086.69,960322013086.69,28.1930213795885,4.78575477351639,1.40203133347143 + + 2020-01-07,962189856974.39,958459856974.39,28.1385639370714,4.77651064313494,1.39932317957328 + + 2020-01-08,969038453342.96,965308453342.96,28.3388463089956,4.81050850042671,1.4092831677987 + + 2020-01-09,979211343215.71,975481343215.71,28.6363453005244,4.86100884232538,1.4240777122423 + + 2020-01-10,985535777123.04,981805777123.04,28.8212989108512,4.89240464810237,1.43327540529638 + + 2020-01-13,993170617183.47,989440617183.47,29.0445744251714,4.93030558266632,1.4443788362788 + + 2020-01-14,986659967664.91,982929967664.91,28.854175070593,4.89798536385117,1.4349103278349 + + 2020-01-15,992598176600.8,988868176600.8,29.0278338039532,4.92746386851202,1.44354632971011 + + 2020-01-16,1000157151041.84,996427151041.84,29.2488906817265,4.96498819035672,1.45453942849667 + + 2020-01-17,1020406374544.48,1016676374544.48,29.8410649455426,5.065509548875,1.48398809458915 + + 2020-01-21,1022289221280.25,1018559221280.25,29.8961274707543,5.07485639181625,1.48672633908616 + + 2020-01-22,1023613421182.33,1019883421182.33,29.934852763211,5.08142999564306,1.48865213741374 + + 2020-01-23,1023972058655.81,1020242058655.81,29.9453408632513,5.08321034667948,1.48917370779412 + + 2020-01-24,1011199047100.33,1007469047100.33,29.57180314643,5.01980245976672,1.47059777809274 + + 2020-01-27,987446211356.77,983716211356.77,28.8771682129891,4.90188844112334,1.43605377059189 + + 2020-01-28,1000391644774.5,996661644774.5,29.255748285599,4.96615226603438,1.45488045528384 + + 2020-01-29,1004667706958.3,1000937706958.3,29.3807987091569,4.98737952839179,1.46109917904997 + + 2020-01-30,1002977972708.25,999247972708.25,29.3313836224284,4.97899133600862,1.45864178014239 + + 2020-01-31,988170383178.22,984440383178.22,28.8983461073013,4.90548338071613,1.43710694155228 + + 2020-02-03,1022530611887.4,1018800611887.4,29.9031867688584,5.07605470501384,1.48707739607296 + + 2020-02-04,993410187346.9,989680187346.9,29.1530859217426,4.94872536838935,1.44977508367585 + + 2020-02-05,993850050444.5,990120050444.5,29.1659943525615,4.95091656966496,1.45041701645171 + + 2020-02-06,1014413650257.3,1010683650257.3,29.7694634933441,5.05335522929939,1.48042737372306 + + 2020-02-07,1016571728579.9,1012841728579.9,29.8327954820492,5.06410581055782,1.48357685640461 + + 2020-02-10,1036881032539.4,1033151032539.4,30.4288019362646,5.1652776819548,1.51321609628992 + + 2020-02-11,1037843233065.4,1034113233065.4,30.4570391286809,5.17007093474518,1.51462032423711 + + 2020-02-12,1043733274856.7,1040003274856.7,30.629891085115,5.1994124893263,1.52321620531383 + + 2020-02-13,1040131895745.1,1036401895745.1,30.5242033077854,5.1814720288823,1.51796038071149 + + 2020-02-14,1043802003465.7,1040072003465.7,30.6319080274304,5.19975486452561,1.52331650731005 + + 2020-02-18,1044289976589.6,1040559976589.6,30.6462283178701,5.20218572844073,1.52402865148327 + + 2020-02-19,1048021940058.3,1044291940058.3,30.755748285599,5.22077670176343,1.52947504987844 + + 2020-02-20,1042606125669.1,1038876125669.1,30.5968132311416,5.19379753605757,1.52157125257569 + + 2020-02-21,1019561423071.4,1015831423071.4,29.9205324727713,5.07899913172793,1.48793999324052 + + 2020-02-24,975850027747.4,972120027747.4,28.6377571601452,4.86124850496489,1.42414792363965 + + 2020-02-25,952798452288.8,949068452288.8,27.9612747075434,4.74641586311533,1.39050663410486 + + 2020-02-26,955650689562.3,951920689562.3,28.0449778136345,4.76062443388682,1.39466916694831 + + 2020-02-27,903746844045.5,900016844045.5,26.5217829770069,4.50206268336568,1.3189210993971 + + 2020-02-28,920447896032.5,916717896032.5,27.0118999596612,4.58525985679872,1.34329448448045 + + 2020-03-02,952798452288.8,949068452288.8,27.9612747075434,4.74641586311533,1.39050663410486 + + 2020-03-03,919396348314.8,915666348314.8,26.9810407422348,4.58002151624923,1.34175986393816 + + 2020-03-04,949554461944.0,945824461944.0,27.8660750302541,4.73025575370776,1.38577237988291 + + 2020-03-05,903616259688.4,899886259688.4,26.5179507866075,4.50141217048698,1.31873052560427 + + 2020-03-06,890544078256.6,886814078256.6,26.134328358209,4.43629240757766,1.29965308592175 + + 2020-03-09,835595555361.1,831865555361.1,24.5217829770069,4.16256343572695,1.21946163993764 + + 2020-03-10,876406603385.3,872676603385.3,25.7194433239209,4.36586582907898,1.27902096529769 + + 2020-03-11,832234726381.0,828504726381.0,24.4231544977814,4.14582128848055,1.2145568723221 + + 2020-03-12,763952853339.5,760222853339.5,22.419322307382,3.80567152796313,1.11490683906981 + + 2020-03-13,834550880504.3,830820880504.3,24.491125453812,4.15735933269739,1.21793704959498 + + 2020-03-16,737457974570.0,733727974570.0,21.6417910447761,3.67368588862799,1.076240419524 + + 2020-03-17,768427085785.4,764697085785.4,22.5506252521178,3.8279601534384,1.12143649902424 + + 2020-03-18,749959708547.1,746229708547.1,22.0086728519564,3.73596393738301,1.09448535263783 + + 2020-03-19,764035327670.3,760305327670.3,22.4217426381606,3.8060823782023,1.11502720146528 + + 2020-03-20,734165874198.9,730435874198.9,21.5451795078661,3.6572861165809,1.07143595390469 + + 2020-03-23,724488886051.7,720758886051.7,21.2611940298507,3.60907968851763,1.05731343283582 + + 2020-03-24,776640154560.9,772910154560.9,22.791649858814,3.8688739897563,1.13342258757345 + + 2020-03-25,757128102465.8,753398102465.8,22.2190399354578,3.77167367067135,1.10494685084439 + + 2020-03-26,799258739782.8,795528739782.8,23.4554255748286,3.98154966785019,1.16643197453202 + + 2020-03-27,763066254283.4,759336254283.4,22.3933037515127,3.80125488789199,1.11361294331847 + + 2020-03-30,787842917827.9,784112917827.9,23.1204114562324,3.92468114724431,1.14977181295858 + + 2020-03-31,798592072275.5,794440072275.5,23.2576060848679,3.92122161198621,5.86336490244826 + + 2020-04-01,757457999789.0,753305999789.0,22.0596477181745,3.7192463863075,5.56135329316082 + +' + headers: + allow: + - GET, HEAD, OPTIONS + content-length: + - '5994' + content-type: + - text/csv + date: + - Sat, 06 Feb 2021 16:23:38 GMT + server: + - nginx/1.14.0 (Ubuntu) + vary: + - Accept, Cookie, Origin + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/fundamentals_definitions.yaml b/tests/fixtures/fundamentals_definitions.yaml new file mode 100644 index 00000000..ed6b7b49 --- /dev/null +++ b/tests/fixtures/fundamentals_definitions.yaml @@ -0,0 +1,202 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Token 0000000000000000000000000000000000000000 + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - tiingo-python-client 0.13.0 + method: GET + uri: https://api.tiingo.com/tiingo/fundamentals/definitions?tickers=GOOGL&format=json + response: + body: + string: '[{"dataCode":"rps","name":"Revenue Per Share","description":"Revenue + per share","statementType":"overview","units":"$"},{"dataCode":"roa","name":"Return + on Assets ROA","description":"Net Income\/Total Assets","statementType":"overview","units":"%"},{"dataCode":"assetTurnover","name":"Asset + Turnover","description":"Revenue over assets","statementType":"overview","units":null},{"dataCode":"bookVal","name":"Book + Value","description":"Book value of the share, assets - liabilities","statementType":"overview","units":"$"},{"dataCode":"bvps","name":"Book + Value Per Share","description":"Book Value per each share","statementType":"overview","units":"$"},{"dataCode":"revenue","name":"Revenue","description":"Revenue","statementType":"incomeStatement","units":"$"},{"dataCode":"epsDil","name":"Earnings + Per Share Diluted","description":"EPS for diluted shares","statementType":"incomeStatement","units":"$"},{"dataCode":"netinc","name":"Net + Income","description":"Net income","statementType":"incomeStatement","units":"$"},{"dataCode":"profitMargin","name":"Profit + Margin","description":"This field is marked for DEPRECATION. Please use grossMargin + instead. Profit Margin is calculated by the (Revenue - COGS)\/Revenue","statementType":"overview","units":"%"},{"dataCode":"revenueQoQ","name":"Revenue + QoQ Growth","description":"Revenue Quarter-over-Quarter Growth rate","statementType":"overview","units":"%"},{"dataCode":"debtEquity","name":"Debt + to Equity Ratio","description":"Debt\/Equity ratio","statementType":"overview","units":""},{"dataCode":"grossMargin","name":"Gross + Margin","description":"The margin of good sold, basically how much of the + money the company keeps after selling their goods and services. (Rev.-Cost + of Rev.)\/Rev.","statementType":"overview","units":"%"},{"dataCode":"roe","name":"Return + on Equity ROE","description":"Return on Shareholder''s equity; ROE=Net Income\/Shareholder''s + Equity","statementType":"overview","units":"%"},{"dataCode":"currentRatio","name":"Current + Ratio","description":"Ability for a company to pay off its short-term liabilities, + Current Assets\/Current Liabilities","statementType":"overview","units":""},{"dataCode":"fxRate","name":"FX + Rate","description":"The exchange rate used for the conversion of foreign + currency to USD for non-US companies that do not report in USD.","statementType":"overview","units":null},{"dataCode":"sharesBasic","name":"Shares + Outstanding","description":"Outstanding shares","statementType":"balanceSheet","units":""},{"dataCode":"piotroskiFScore","name":"Piotroski + F-Score","description":"0-9 point scale to determine strength of company''s + financial position","statementType":"overview","units":null},{"dataCode":"longTermDebtEquity","name":"Long-term + Debt to Equity","description":"Long term debt to equity","statementType":"overview","units":null},{"dataCode":"opMargin","name":"Operating + Margin","description":"Operating margin, or how much money a company makes + on each dollar of revenue. In other words Operating Income\/Revenue","statementType":"overview","units":"%"},{"dataCode":"epsQoQ","name":"Earnings + Per Share QoQ Growth","description":"Earnings Per Share Quarter-over-Quarter + Growth rate","statementType":"overview","units":"%"},{"dataCode":"shareswaDil","name":"Weighted + Average Shares Diluted","description":"Used to calculated diluted EPS. Considers + all outstanding common stock plus all instruments that can be converted into + shares (like stock options) ","statementType":"incomeStatement","units":""},{"dataCode":"eps","name":"Earnings + Per Share","description":"Earnings per basic share (not diluted)","statementType":"incomeStatement","units":"$"},{"dataCode":"ppeq","name":"Property, + Plant & Equipment","description":"A component of assets representing the total + amount of marketable and non-marketable securties, loans receivable and other + invested assets.","statementType":"balanceSheet","units":"$"},{"dataCode":"ebitda","name":"EBITDA","description":"EBITDA + is a non-GAAP accounting metric that is widely used when assessing the performance + of companies, calculated by adding Depreciation\/Amortization back to Earnings + before interest and taxes","statementType":"incomeStatement","units":"$"},{"dataCode":"freeCashFlow","name":"Free + Cash Flow","description":"Operating Cash Flow - Capex, How much cash is left + over after reinvesting it in the business. Used as a measure to evaluate financial + performance of a company","statementType":"cashFlow","units":"$"},{"dataCode":"issrepayDebt","name":"Issuance + or Repayment of Debt Securities","description":"Representing the net cash + inflow (outflow) from issuance (repayment) of debt securities.","statementType":"cashFlow","units":"$"},{"dataCode":"capex","name":"Capital + Expenditure","description":"Money uses to upgrade or acquire property or materials + to maintain and increase size","statementType":"cashFlow","units":"$"},{"dataCode":"rnd","name":"Research + & Development","description":"The aggregate costs incurred in a planned search + or critical investigation aimed at discovery of new knowledge with the hope + that such knowledge will be useful in developing a new product or service.","statementType":"incomeStatement","units":"$"},{"dataCode":"sga","name":"Selling, + General & Administrative","description":"The aggregate total costs related + to selling a firm''s product and services, as well as all other general and + administrative expenses. Direct selling expenses (for example, credit, warranty, + and advertising) are expenses that can be directly linked to the sale of specific + products. Indirect selling expenses are expenses that cannot be directly linked + to the sale of specific products, for example telephone expenses, Internet, + and postal charges. General and administrative expenses include salaries","statementType":"incomeStatement","units":"$"},{"dataCode":"investmentsCurrent","name":"Current + Investments","description":"The current portion of Investments, reported if + the company operates a classified balance sheet that segments current and + non-current assets.","statementType":"balanceSheet","units":"$"},{"dataCode":"payDiv","name":"Payment + of Dividends & Other Cash Distributions","description":"Representing dividends + and dividend equivalents paid on common stock and restricted stock units.","statementType":"cashFlow","units":"$"},{"dataCode":"peRatio","name":"Price + to Earnings Ratio","description":"P\/E Ratio","statementType":"overview","units":""},{"dataCode":"investmentsAcqDisposals","name":"Investment + Acquisitions & Disposals","description":"A component of cash flow from financing, + representing the net cash inflow (outflow) associated with the acquisition + & disposal of investments, including marketable securities and loan originations.","statementType":"cashFlow","units":"$"},{"dataCode":"taxLiabilities","name":"Tax + Liabilities","description":"A component of liabilities representing outstanding + tax liabilities.","statementType":"balanceSheet","units":"$"},{"dataCode":"ncff","name":"Net + Cash Flow from Financing","description":"Net Cash flow from financing activities + like issuing stock or debt minus dividends or acquiring debt","statementType":"cashFlow","units":"$"},{"dataCode":"opinc","name":"Operating + Income","description":"Operating income is a measure of financial performance + before the deduction of interest expense, tax expenses and other Non-Operating + items. It is calculated as gross profit minus operating expenses","statementType":"incomeStatement","units":"$"},{"dataCode":"nonControllingInterests","name":"Net + Income to Non-Controlling Interests","description":"The portion of income + which is attributable to non-controlling interest shareholders, subtracted + from consolidated income in order to obtain net income","statementType":"incomeStatement","units":"$"},{"dataCode":"assetsNonCurrent","name":"Other + Assets","description":"Assets that cannot be easily converted into cash and + where the value of the item will be realized in a year","statementType":"balanceSheet","units":"$"},{"dataCode":"taxAssets","name":"Tax + Assets","description":"A component of assets representing tax assets and receivables.","statementType":"balanceSheet","units":"$"},{"dataCode":"issrepayEquity","name":"Issuance + or Repayment of Equity","description":"Representing the net cash inflow (outflow) + from issuance (repayment) of equity.","statementType":"cashFlow","units":"$"},{"dataCode":"ncfx","name":"Effect + of Exchange Rate Changes on Cash","description":"Cash flow from exchange rate + changes","statementType":"cashFlow","units":"$"},{"dataCode":"ncfo","name":"Net + Cash Flow from Operations","description":"Cash flow generating from a company''s + operations","statementType":"cashFlow","units":"$"},{"dataCode":"grossProfit","name":"Gross + Profit","description":"Aggregate revenue [REVENUE] less cost of revenue [COR] + directly attributable to the revenue generation activity.","statementType":"incomeStatement","units":"$"},{"dataCode":"debtCurrent","name":"Current + Debt","description":"Current debt - debt due within a year","statementType":"balanceSheet","units":"$"},{"dataCode":"retainedEarnings","name":"Accumulated + Retained Earnings or Deficit","description":"A component of Shareholder''s + Equity representing the cumulative amount of the entities undistributed earnings + or deficit. May only be reported annually by certain companies, rather than + quarterly.","statementType":"balanceSheet","units":"$"},{"dataCode":"liabilitiesNonCurrent","name":"Other + Liabilities","description":"Long-term liabilities (like debt) that are not + due within a year","statementType":"balanceSheet","units":"$"},{"dataCode":"sbcomp","name":"Shared-based + Compensation","description":"A component of cash flow from operating activities, + representing the total amount of noncash, equity-based employee remuneration. + This may include the value of stock or unit options, amortization of restricted + stock or units, and adjustment for officers'' compensation. As noncash, this + element is an add back when calculating net cash generated by operating activities + using the indirect method.","statementType":"cashFlow","units":"$"},{"dataCode":"businessAcqDisposals","name":"Business + Acquisitions & Disposals","description":"A component of cash flow from investing, + representing the net cash inflow (outflow) associated with the acquisition + & disposal of businesses, joint-ventures, affiliates, and other named investments.","statementType":"cashFlow","units":"$"},{"dataCode":"liabilitiesCurrent","name":"Current + Liabilities","description":"Debt or liabilities that are due within a year","statementType":"balanceSheet","units":"$"},{"dataCode":"acctRec","name":"Accounts + Receivable","description":"Amount company will receive based on work already + completed and delivered","statementType":"balanceSheet","units":"$"},{"dataCode":"cashAndEq","name":"Cash + and Equivalents","description":"Cash or assets that can be converted to cash + immediately","statementType":"balanceSheet","units":"$"},{"dataCode":"accoci","name":"Accumulated + Other Comprehensive Income","description":"Unrealized gains and losses - such + as items that have changed in value but haven''t been bought or sold yet","statementType":"balanceSheet","units":"$"},{"dataCode":"depamor","name":"Depreciation, + Amortization & Accretion","description":"Depreciation, Amortization, and Accretion","statementType":"cashFlow","units":"$"},{"dataCode":"assetsCurrent","name":"Current + Assets","description":"Assets that can easily be converted to cash and can + be used to fund day-to-day operations","statementType":"balanceSheet","units":"$"},{"dataCode":"shareswa","name":"Weighted + Average Shares","description":"Weighted average shares (undiluted)","statementType":"incomeStatement","units":""},{"dataCode":"investments","name":"Investments","description":"A + component of assets representing the total amount of marketable and non-marketable + securties, loans receivable and other invested assets.","statementType":"balanceSheet","units":"$"},{"dataCode":"prefDVDs","name":"Preferred + Dividends Income Statement Impact","description":"Impact of dividend on company''s + preferred shares","statementType":"incomeStatement","units":"$"},{"dataCode":"intangibles","name":"Intangible + Assets","description":"Goodwill and Intangible Assets","statementType":"balanceSheet","units":"$"},{"dataCode":"opex","name":"Operating + Expenses","description":"Operating expenses represents the total expenditure + on SG&A, R&D and other operating expense items, it excludes cost of revenue.","statementType":"incomeStatement","units":"$"},{"dataCode":"inventory","name":"Inventory","description":"A + component of Total Assets representing the amount after valuation and reserves + of inventory expected to be sold, or consumed within one year or operating + cycle, if longer.","statementType":"balanceSheet","units":"$"},{"dataCode":"deposits","name":"Deposits","description":"Deposit + liabilities, both domestic and international including deposits such as savings + deposts","statementType":"balanceSheet","units":"$"},{"dataCode":"ebt","name":"Earnings + before tax","description":"Revenue - Expenses and excluding tax","statementType":"incomeStatement","units":"$"},{"dataCode":"netMargin","name":"Net + Margin","description":"Net Profit Margin, or the Net Income as a proportion + of Revenue. In other words, Net Income\/Revenue","statementType":"overview","units":"%"},{"dataCode":"investmentsNonCurrent","name":"Non-Current + Investments","description":"The non-current portion of investments, reported + if the company operates a classified balance sheet that segments current and + non-current assets.","statementType":"balanceSheet","units":"$"},{"dataCode":"totalAssets","name":"Total + Assets","description":"Total assets","statementType":"balanceSheet","units":"$"},{"dataCode":"deferredRev","name":"Deferred + Revenue","description":"Revenue that was received, but not yet paid out including + sales, license fees, and royalties, but excluding interest income.","statementType":"balanceSheet","units":"$"},{"dataCode":"taxExp","name":"Tax + Expense","description":"Tax expenses","statementType":"incomeStatement","units":"$"},{"dataCode":"debt","name":"Total + Debt","description":"Debt","statementType":"balanceSheet","units":"$"},{"dataCode":"costRev","name":"Cost + of Revenue","description":"The aggregate cost of goods produced and sold and + services rendered during the reporting period.","statementType":"incomeStatement","units":"$"},{"dataCode":"acctPay","name":"Accounts + Payable","description":"Short-term debt the company must pay off within a + year","statementType":"balanceSheet","units":"$"},{"dataCode":"ncf","name":"Net + Cash Flow to Change in Cash & Cash Equivalents","description":"Net Cash flow + - Total cash minux liabilities","statementType":"cashFlow","units":"$"},{"dataCode":"netIncDiscOps","name":"Net + Income from Discontinued Operations","description":"Net income from discontinued + operations","statementType":"incomeStatement","units":"$"},{"dataCode":"totalLiabilities","name":"Total + Liabilities","description":"Total Liabilities","statementType":"balanceSheet","units":"$"},{"dataCode":"ncfi","name":"Net + Cash Flow from Investing","description":"Cash flow from investments made by + the company","statementType":"cashFlow","units":"$"},{"dataCode":"debtNonCurrent","name":"Non-Current + Debt","description":"Longer-term debt, typically greater than a year","statementType":"balanceSheet","units":"$"},{"dataCode":"ebit","name":"Earning + Before Interest & Taxes EBIT","description":"Earning Before Interest & Taxes + (EBIT)","statementType":"incomeStatement","units":"$"},{"dataCode":"netIncComStock","name":"Net + Income Common Stock","description":"Net Income applied to common share holders. + Used in calculating EPS (earnings per share).","statementType":"incomeStatement","units":"$"},{"dataCode":"intexp","name":"Interest + Expense","description":"Interest expense","statementType":"incomeStatement","units":"$"},{"dataCode":"consolidatedIncome","name":"Consolidated + Income","description":"The portion of profit or loss for the period, net of + income taxes, which is attributable to the consolidated entity.","statementType":"incomeStatement","units":"$"},{"dataCode":"equity","name":"Shareholders + Equity","description":"Shareholders Equity","statementType":"balanceSheet","units":"$"},{"dataCode":"marketCap","name":"Market + Capitalization","description":"Size of the company (shares outstanding * share + price)","statementType":"overview","units":"$"},{"dataCode":"enterpriseVal","name":"Enterprise + Value","description":"An alternative to marketcap that''s the theoretical + takeover price of a company (marketcap + debt - cash and cash equivalents)","statementType":"overview","units":"$"},{"dataCode":"pbRatio","name":"Price + to Book Ratio","description":"Price\/Book value per share ratio","statementType":"overview","units":null},{"dataCode":"trailingPEG1Y","name":"PEG + Ratio","description":"PEG ratio using the trailing 1 year EPS growth rate + in the denominator","statementType":"overview","units":null}]' + headers: + allow: + - GET, HEAD, OPTIONS + content-length: + - '17003' + content-type: + - application/json + date: + - Sat, 06 Feb 2021 16:23:39 GMT + server: + - nginx/1.14.0 (Ubuntu) + vary: + - Accept, Cookie, Origin + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/fundamentals_statements.yaml b/tests/fixtures/fundamentals_statements.yaml new file mode 100644 index 00000000..86c7087a --- /dev/null +++ b/tests/fixtures/fundamentals_statements.yaml @@ -0,0 +1,175 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Token 0000000000000000000000000000000000000000 + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - tiingo-python-client 0.13.0 + method: GET + uri: https://api.tiingo.com/tiingo/fundamentals/GOOGL/statements?startDate=2020-1-1&endDate=2020-4-1&asReported=false&format=json + response: + body: + string: '[{"date": "2020-03-31", "statementData": {"cashFlow": [{"value": -1847000000.0, + "dataCode": "ncfi"}, {"value": -9737000000.0, "dataCode": "issrepayEquity"}, + {"value": 5446000000.0, "dataCode": "freeCashFlow"}, {"value": -272000000.0, + "dataCode": "ncfx"}, {"value": 11451000000.0, "dataCode": "ncfo"}, {"value": + -49000000.0, "dataCode": "issrepayDebt"}, {"value": 3108000000.0, "dataCode": + "depamor"}, {"value": -6005000000.0, "dataCode": "capex"}, {"value": 3191000000.0, + "dataCode": "sbcomp"}, {"value": 1146000000.0, "dataCode": "ncf"}, {"value": + -190000000.0, "dataCode": "businessAcqDisposals"}, {"value": 0.0, "dataCode": + "payDiv"}, {"value": 3936000000.0, "dataCode": "investmentsAcqDisposals"}, + {"value": -8186000000.0, "dataCode": "ncff"}], "incomeStatement": [{"value": + 14200000000.0, "dataCode": "opex"}, {"value": 6836000000.0, "dataCode": "netinc"}, + {"value": 0.0, "dataCode": "prefDVDs"}, {"value": 0.0, "dataCode": "intexp"}, + {"value": 22177000000.0, "dataCode": "grossProfit"}, {"value": 687286090.0, + "dataCode": "shareswa"}, {"value": 0.0, "dataCode": "netIncDiscOps"}, {"value": + 41159000000.0, "dataCode": "revenue"}, {"value": 6820000000.0, "dataCode": + "rnd"}, {"value": 6836000000.0, "dataCode": "netIncComStock"}, {"value": 7380000000.0, + "dataCode": "sga"}, {"value": 18982000000.0, "dataCode": "costRev"}, {"value": + 9.87, "dataCode": "epsDil"}, {"value": 9.96, "dataCode": "eps"}, {"value": + 921000000.0, "dataCode": "taxExp"}, {"value": 7757000000.0, "dataCode": "ebit"}, + {"value": 6836000000.0, "dataCode": "consolidatedIncome"}, {"value": 7977000000.0, + "dataCode": "opinc"}, {"value": 7757000000.0, "dataCode": "ebt"}, {"value": + 0.0, "dataCode": "nonControllingInterests"}, {"value": 10865000000.0, "dataCode": + "ebitda"}], "overview": [{"value": 0.129119730854069, "dataCode": "roa"}, + {"value": 0.538812896328871, "dataCode": "grossMargin"}, {"value": 296.323471350919, + "dataCode": "bvps"}, {"value": 0.174295876869016, "dataCode": "roe"}, {"value": + 59.8862694864085, "dataCode": "rps"}, {"value": 3.65816516957376, "dataCode": + "currentRatio"}, {"value": 0.538812896328871, "dataCode": "profitMargin"}, + {"value": 5.0, "dataCode": "piotroskiFScore"}, {"value": 203659000000.0, "dataCode": + "bookVal"}, {"value": 0.076068329904399, "dataCode": "longTermDebtEquity"}, + {"value": 0.132639863507526, "dataCode": "revenueQoQ"}, {"value": 0.0396659707724427, + "dataCode": "epsQoQ"}], "balanceSheet": [{"value": 2640000000.0, "dataCode": + "taxAssets"}, {"value": 22574000000.0, "dataCode": "intangibles"}, {"value": + 69744000000.0, "dataCode": "totalLiabilities"}, {"value": 109952000000.0, + "dataCode": "investments"}, {"value": 0.0, "dataCode": "debtCurrent"}, {"value": + 147018000000.0, "dataCode": "assetsCurrent"}, {"value": 151068000000.0, "dataCode": + "retainedEarnings"}, {"value": 29555000000.0, "dataCode": "liabilitiesNonCurrent"}, + {"value": -1097000000.0, "dataCode": "accoci"}, {"value": 19644000000.0, "dataCode": + "cashAndEq"}, {"value": 21825000000.0, "dataCode": "acctRec"}, {"value": 687286090.0, + "dataCode": "sharesBasic"}, {"value": 40189000000.0, "dataCode": "liabilitiesCurrent"}, + {"value": 4099000000.0, "dataCode": "acctPay"}, {"value": 97585000000.0, "dataCode": + "investmentsCurrent"}, {"value": 15492000000.0, "dataCode": "debt"}, {"value": + 7270000000.0, "dataCode": "deferredRev"}, {"value": 12199000000.0, "dataCode": + "taxLiabilities"}, {"value": 273403000000.0, "dataCode": "totalAssets"}, {"value": + 87966000000.0, "dataCode": "ppeq"}, {"value": 12367000000.0, "dataCode": "investmentsNonCurrent"}, + {"value": 15492000000.0, "dataCode": "debtNonCurrent"}, {"value": 203659000000.0, + "dataCode": "equity"}, {"value": 0.0, "dataCode": "deposits"}, {"value": 126385000000.0, + "dataCode": "assetsNonCurrent"}, {"value": 889000000.0, "dataCode": "inventory"}]}, + "quarter": 1, "year": 2020}, {"date": "2019-12-31", "statementData": {"balanceSheet": + [{"value": 74467000000.0, "dataCode": "totalLiabilities"}, {"value": 689687449.0, + "dataCode": "sharesBasic"}, {"value": 84587000000.0, "dataCode": "ppeq"}, + {"value": 101177000000.0, "dataCode": "investmentsCurrent"}, {"value": 11860000000.0, + "dataCode": "taxLiabilities"}, {"value": 123331000000.0, "dataCode": "assetsNonCurrent"}, + {"value": 2887000000.0, "dataCode": "taxAssets"}, {"value": 0.0, "dataCode": + "debtCurrent"}, {"value": 152122000000.0, "dataCode": "retainedEarnings"}, + {"value": 29246000000.0, "dataCode": "liabilitiesNonCurrent"}, {"value": 45221000000.0, + "dataCode": "liabilitiesCurrent"}, {"value": 25326000000.0, "dataCode": "acctRec"}, + {"value": 18498000000.0, "dataCode": "cashAndEq"}, {"value": -1232000000.0, + "dataCode": "accoci"}, {"value": 152578000000.0, "dataCode": "assetsCurrent"}, + {"value": 114255000000.0, "dataCode": "investments"}, {"value": 22603000000.0, + "dataCode": "intangibles"}, {"value": 999000000.0, "dataCode": "inventory"}, + {"value": 0.0, "dataCode": "deposits"}, {"value": 13078000000.0, "dataCode": + "investmentsNonCurrent"}, {"value": 275909000000.0, "dataCode": "totalAssets"}, + {"value": 8182000000.0, "dataCode": "deferredRev"}, {"value": 14768000000.0, + "dataCode": "debt"}, {"value": 5561000000.0, "dataCode": "acctPay"}, {"value": + 14768000000.0, "dataCode": "debtNonCurrent"}, {"value": 201442000000.0, "dataCode": + "equity"}], "overview": [{"value": 0.543787303309821, "dataCode": "grossMargin"}, + {"value": 0.131910509188086, "dataCode": "roa"}, {"value": 201442000000.0, + "dataCode": "bookVal"}, {"value": 292.077230478933, "dataCode": "bvps"}, {"value": + 0.543787303309821, "dataCode": "profitMargin"}, {"value": 0.173108259496894, + "dataCode": "revenueQoQ"}, {"value": 66.8056234266777, "dataCode": "rps"}, + {"value": 0.177925719651588, "dataCode": "roe"}, {"value": 3.374051878552, + "dataCode": "currentRatio"}, {"value": 4.0, "dataCode": "piotroskiFScore"}, + {"value": 0.073311424628429, "dataCode": "longTermDebtEquity"}, {"value": + 0.201086956521739, "dataCode": "epsQoQ"}], "cashFlow": [{"value": 8375000000.0, + "dataCode": "freeCashFlow"}, {"value": -47000000.0, "dataCode": "issrepayDebt"}, + {"value": -6052000000.0, "dataCode": "capex"}, {"value": 0.0, "dataCode": + "payDiv"}, {"value": 3370000000.0, "dataCode": "investmentsAcqDisposals"}, + {"value": -7326000000.0, "dataCode": "ncff"}, {"value": -7297000000.0, "dataCode": + "issrepayEquity"}, {"value": 68000000.0, "dataCode": "ncfx"}, {"value": 14427000000.0, + "dataCode": "ncfo"}, {"value": 2645000000.0, "dataCode": "sbcomp"}, {"value": + -2142000000.0, "dataCode": "businessAcqDisposals"}, {"value": 3413000000.0, + "dataCode": "depamor"}, {"value": 2466000000.0, "dataCode": "ncf"}, {"value": + -4703000000.0, "dataCode": "ncfi"}], "incomeStatement": [{"value": 46075000000.0, + "dataCode": "revenue"}, {"value": 15.33, "dataCode": "epsDil"}, {"value": + 10671000000.0, "dataCode": "netinc"}, {"value": 15.47, "dataCode": "eps"}, + {"value": 14117000000.0, "dataCode": "ebitda"}, {"value": 7222000000.0, "dataCode": + "rnd"}, {"value": 8567000000.0, "dataCode": "sga"}, {"value": 9266000000.0, + "dataCode": "opinc"}, {"value": 0.0, "dataCode": "nonControllingInterests"}, + {"value": 25055000000.0, "dataCode": "grossProfit"}, {"value": 689687449.0, + "dataCode": "shareswa"}, {"value": 0.0, "dataCode": "prefDVDs"}, {"value": + 15789000000.0, "dataCode": "opex"}, {"value": 10704000000.0, "dataCode": "ebt"}, + {"value": 33000000.0, "dataCode": "taxExp"}, {"value": 21020000000.0, "dataCode": + "costRev"}, {"value": 0.0, "dataCode": "netIncDiscOps"}, {"value": 10704000000.0, + "dataCode": "ebit"}, {"value": 10671000000.0, "dataCode": "netIncComStock"}, + {"value": 0.0, "dataCode": "intexp"}, {"value": 10671000000.0, "dataCode": + "consolidatedIncome"}]}, "quarter": 4, "year": 2019}, {"date": "2019-12-31", + "statementData": {"cashFlow": [{"value": -23161000000.0, "dataCode": "issrepayEquity"}, + {"value": 30972000000.0, "dataCode": "freeCashFlow"}, {"value": -23209000000.0, + "dataCode": "ncff"}, {"value": -4017000000.0, "dataCode": "investmentsAcqDisposals"}, + {"value": 0.0, "dataCode": "payDiv"}, {"value": 1797000000.0, "dataCode": + "ncf"}, {"value": -2515000000.0, "dataCode": "businessAcqDisposals"}, {"value": + 10794000000.0, "dataCode": "sbcomp"}, {"value": 11781000000.0, "dataCode": + "depamor"}, {"value": -23548000000.0, "dataCode": "capex"}, {"value": -268000000.0, + "dataCode": "issrepayDebt"}, {"value": 54520000000.0, "dataCode": "ncfo"}, + {"value": -29491000000.0, "dataCode": "ncfi"}, {"value": -23000000.0, "dataCode": + "ncfx"}], "incomeStatement": [{"value": 39625000000.0, "dataCode": "ebt"}, + {"value": 34343000000.0, "dataCode": "consolidatedIncome"}, {"value": 0.0, + "dataCode": "nonControllingInterests"}, {"value": 51406000000.0, "dataCode": + "ebitda"}, {"value": 34231000000.0, "dataCode": "opinc"}, {"value": 39625000000.0, + "dataCode": "ebit"}, {"value": 49.16, "dataCode": "epsDil"}, {"value": 5282000000.0, + "dataCode": "taxExp"}, {"value": 34343000000.0, "dataCode": "netIncComStock"}, + {"value": 71896000000.0, "dataCode": "costRev"}, {"value": 34343000000.0, + "dataCode": "netinc"}, {"value": 49.59, "dataCode": "eps"}, {"value": 28015000000.0, + "dataCode": "sga"}, {"value": 0.0, "dataCode": "intexp"}, {"value": 26018000000.0, + "dataCode": "rnd"}, {"value": 0.0, "dataCode": "netIncDiscOps"}, {"value": + 689687449.0, "dataCode": "shareswa"}, {"value": 161857000000.0, "dataCode": + "revenue"}, {"value": 89961000000.0, "dataCode": "grossProfit"}, {"value": + 0.0, "dataCode": "prefDVDs"}, {"value": 55730000000.0, "dataCode": "opex"}], + "balanceSheet": [{"value": 999000000.0, "dataCode": "inventory"}, {"value": + 2887000000.0, "dataCode": "taxAssets"}, {"value": 0.0, "dataCode": "deposits"}, + {"value": 14768000000.0, "dataCode": "debtNonCurrent"}, {"value": 123331000000.0, + "dataCode": "assetsNonCurrent"}, {"value": 13078000000.0, "dataCode": "investmentsNonCurrent"}, + {"value": 275909000000.0, "dataCode": "totalAssets"}, {"value": 8182000000.0, + "dataCode": "deferredRev"}, {"value": 11860000000.0, "dataCode": "taxLiabilities"}, + {"value": 84587000000.0, "dataCode": "ppeq"}, {"value": 14768000000.0, "dataCode": + "debt"}, {"value": 101177000000.0, "dataCode": "investmentsCurrent"}, {"value": + 5561000000.0, "dataCode": "acctPay"}, {"value": 25326000000.0, "dataCode": + "acctRec"}, {"value": 45221000000.0, "dataCode": "liabilitiesCurrent"}, {"value": + 18498000000.0, "dataCode": "cashAndEq"}, {"value": -1232000000.0, "dataCode": + "accoci"}, {"value": 201442000000.0, "dataCode": "equity"}, {"value": 29246000000.0, + "dataCode": "liabilitiesNonCurrent"}, {"value": 152578000000.0, "dataCode": + "assetsCurrent"}, {"value": 152122000000.0, "dataCode": "retainedEarnings"}, + {"value": 74467000000.0, "dataCode": "totalLiabilities"}, {"value": 0.0, "dataCode": + "debtCurrent"}, {"value": 114255000000.0, "dataCode": "investments"}, {"value": + 22603000000.0, "dataCode": "intangibles"}, {"value": 689687449.0, "dataCode": + "sharesBasic"}]}, "quarter": 0, "year": 2019}]' + headers: + allow: + - GET, HEAD, OPTIONS + content-length: + - '10825' + content-type: + - application/json + date: + - Sat, 06 Feb 2021 16:23:39 GMT + server: + - nginx/1.14.0 (Ubuntu) + vary: + - Accept, Cookie, Origin + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/fundamentals_statements_csv.yaml b/tests/fixtures/fundamentals_statements_csv.yaml new file mode 100644 index 00000000..93fa58b6 --- /dev/null +++ b/tests/fixtures/fundamentals_statements_csv.yaml @@ -0,0 +1,456 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Token 0000000000000000000000000000000000000000 + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - tiingo-python-client 0.13.0 + method: GET + uri: https://api.tiingo.com/tiingo/fundamentals/GOOGL/statements?startDate=2020-1-1&endDate=2020-4-1&asReported=false&format=csv + response: + body: + string: 'date,year,quarter,statementType,dataCode,value + + 2020-03-31,2020,1,cashFlow,ncfi,-1847000000.0 + + 2020-03-31,2020,1,balanceSheet,taxAssets,2640000000.0 + + 2020-03-31,2020,1,incomeStatement,opex,14200000000.0 + + 2020-03-31,2020,1,incomeStatement,netinc,6836000000.0 + + 2020-03-31,2020,1,cashFlow,issrepayEquity,-9737000000.0 + + 2020-03-31,2020,1,balanceSheet,intangibles,22574000000.0 + + 2020-03-31,2020,1,cashFlow,freeCashFlow,5446000000.0 + + 2020-03-31,2020,1,cashFlow,ncfx,-272000000.0 + + 2020-03-31,2020,1,incomeStatement,prefDVDs,0.0 + + 2020-03-31,2020,1,balanceSheet,totalLiabilities,69744000000.0 + + 2020-03-31,2020,1,cashFlow,ncfo,11451000000.0 + + 2020-03-31,2020,1,balanceSheet,investments,109952000000.0 + + 2020-03-31,2020,1,incomeStatement,intexp,0.0 + + 2020-03-31,2020,1,incomeStatement,grossProfit,22177000000.0 + + 2020-03-31,2020,1,incomeStatement,shareswa,687286090.0 + + 2020-03-31,2020,1,cashFlow,issrepayDebt,-49000000.0 + + 2020-03-31,2020,1,balanceSheet,debtCurrent,0.0 + + 2020-03-31,2020,1,balanceSheet,assetsCurrent,147018000000.0 + + 2020-03-31,2020,1,incomeStatement,netIncDiscOps,0.0 + + 2020-03-31,2020,1,balanceSheet,retainedEarnings,151068000000.0 + + 2020-03-31,2020,1,cashFlow,depamor,3108000000.0 + + 2020-03-31,2020,1,incomeStatement,revenue,41159000000.0 + + 2020-03-31,2020,1,balanceSheet,liabilitiesNonCurrent,29555000000.0 + + 2020-03-31,2020,1,balanceSheet,accoci,-1097000000.0 + + 2020-03-31,2020,1,cashFlow,capex,-6005000000.0 + + 2020-03-31,2020,1,cashFlow,sbcomp,3191000000.0 + + 2020-03-31,2020,1,balanceSheet,cashAndEq,19644000000.0 + + 2020-03-31,2020,1,cashFlow,ncf,1146000000.0 + + 2020-03-31,2020,1,cashFlow,businessAcqDisposals,-190000000.0 + + 2020-03-31,2020,1,balanceSheet,acctRec,21825000000.0 + + 2020-03-31,2020,1,balanceSheet,sharesBasic,687286090.0 + + 2020-03-31,2020,1,balanceSheet,liabilitiesCurrent,40189000000.0 + + 2020-03-31,2020,1,incomeStatement,rnd,6820000000.0 + + 2020-03-31,2020,1,balanceSheet,acctPay,4099000000.0 + + 2020-03-31,2020,1,incomeStatement,netIncComStock,6836000000.0 + + 2020-03-31,2020,1,incomeStatement,sga,7380000000.0 + + 2020-03-31,2020,1,incomeStatement,costRev,18982000000.0 + + 2020-03-31,2020,1,incomeStatement,epsDil,9.87 + + 2020-03-31,2020,1,balanceSheet,investmentsCurrent,97585000000.0 + + 2020-03-31,2020,1,balanceSheet,debt,15492000000.0 + + 2020-03-31,2020,1,incomeStatement,eps,9.96 + + 2020-03-31,2020,1,cashFlow,payDiv,0.0 + + 2020-03-31,2020,1,incomeStatement,taxExp,921000000.0 + + 2020-03-31,2020,1,incomeStatement,ebit,7757000000.0 + + 2020-03-31,2020,1,cashFlow,investmentsAcqDisposals,3936000000.0 + + 2020-03-31,2020,1,balanceSheet,deferredRev,7270000000.0 + + 2020-03-31,2020,1,incomeStatement,consolidatedIncome,6836000000.0 + + 2020-03-31,2020,1,balanceSheet,taxLiabilities,12199000000.0 + + 2020-03-31,2020,1,balanceSheet,totalAssets,273403000000.0 + + 2020-03-31,2020,1,balanceSheet,ppeq,87966000000.0 + + 2020-03-31,2020,1,cashFlow,ncff,-8186000000.0 + + 2020-03-31,2020,1,balanceSheet,investmentsNonCurrent,12367000000.0 + + 2020-03-31,2020,1,balanceSheet,debtNonCurrent,15492000000.0 + + 2020-03-31,2020,1,incomeStatement,opinc,7977000000.0 + + 2020-03-31,2020,1,incomeStatement,ebt,7757000000.0 + + 2020-03-31,2020,1,balanceSheet,equity,203659000000.0 + + 2020-03-31,2020,1,incomeStatement,nonControllingInterests,0.0 + + 2020-03-31,2020,1,balanceSheet,deposits,0.0 + + 2020-03-31,2020,1,incomeStatement,ebitda,10865000000.0 + + 2020-03-31,2020,1,balanceSheet,assetsNonCurrent,126385000000.0 + + 2020-03-31,2020,1,balanceSheet,inventory,889000000.0 + + 2020-03-31,2020,1,overview,roa,0.129119730854069 + + 2020-03-31,2020,1,overview,grossMargin,0.538812896328871 + + 2020-03-31,2020,1,overview,bvps,296.323471350919 + + 2020-03-31,2020,1,overview,roe,0.174295876869016 + + 2020-03-31,2020,1,overview,rps,59.8862694864085 + + 2020-03-31,2020,1,overview,currentRatio,3.65816516957376 + + 2020-03-31,2020,1,overview,profitMargin,0.538812896328871 + + 2020-03-31,2020,1,overview,piotroskiFScore,5.0 + + 2020-03-31,2020,1,overview,bookVal,203659000000.0 + + 2020-03-31,2020,1,overview,longTermDebtEquity,0.076068329904399 + + 2020-03-31,2020,1,overview,revenueQoQ,0.132639863507526 + + 2020-03-31,2020,1,overview,epsQoQ,0.0396659707724427 + + 2019-12-31,2019,4,balanceSheet,totalLiabilities,74467000000.0 + + 2019-12-31,2019,4,incomeStatement,revenue,46075000000.0 + + 2019-12-31,2019,4,incomeStatement,epsDil,15.33 + + 2019-12-31,2019,4,incomeStatement,netinc,10671000000.0 + + 2019-12-31,2019,4,balanceSheet,sharesBasic,689687449.0 + + 2019-12-31,2019,4,incomeStatement,eps,15.47 + + 2019-12-31,2019,4,balanceSheet,ppeq,84587000000.0 + + 2019-12-31,2019,4,incomeStatement,ebitda,14117000000.0 + + 2019-12-31,2019,4,cashFlow,freeCashFlow,8375000000.0 + + 2019-12-31,2019,4,cashFlow,issrepayDebt,-47000000.0 + + 2019-12-31,2019,4,cashFlow,capex,-6052000000.0 + + 2019-12-31,2019,4,incomeStatement,rnd,7222000000.0 + + 2019-12-31,2019,4,incomeStatement,sga,8567000000.0 + + 2019-12-31,2019,4,balanceSheet,investmentsCurrent,101177000000.0 + + 2019-12-31,2019,4,cashFlow,payDiv,0.0 + + 2019-12-31,2019,4,cashFlow,investmentsAcqDisposals,3370000000.0 + + 2019-12-31,2019,4,balanceSheet,taxLiabilities,11860000000.0 + + 2019-12-31,2019,4,cashFlow,ncff,-7326000000.0 + + 2019-12-31,2019,4,incomeStatement,opinc,9266000000.0 + + 2019-12-31,2019,4,incomeStatement,nonControllingInterests,0.0 + + 2019-12-31,2019,4,balanceSheet,assetsNonCurrent,123331000000.0 + + 2019-12-31,2019,4,balanceSheet,taxAssets,2887000000.0 + + 2019-12-31,2019,4,cashFlow,issrepayEquity,-7297000000.0 + + 2019-12-31,2019,4,cashFlow,ncfx,68000000.0 + + 2019-12-31,2019,4,cashFlow,ncfo,14427000000.0 + + 2019-12-31,2019,4,incomeStatement,grossProfit,25055000000.0 + + 2019-12-31,2019,4,balanceSheet,debtCurrent,0.0 + + 2019-12-31,2019,4,balanceSheet,retainedEarnings,152122000000.0 + + 2019-12-31,2019,4,balanceSheet,liabilitiesNonCurrent,29246000000.0 + + 2019-12-31,2019,4,cashFlow,sbcomp,2645000000.0 + + 2019-12-31,2019,4,cashFlow,businessAcqDisposals,-2142000000.0 + + 2019-12-31,2019,4,balanceSheet,liabilitiesCurrent,45221000000.0 + + 2019-12-31,2019,4,balanceSheet,acctRec,25326000000.0 + + 2019-12-31,2019,4,balanceSheet,cashAndEq,18498000000.0 + + 2019-12-31,2019,4,balanceSheet,accoci,-1232000000.0 + + 2019-12-31,2019,4,cashFlow,depamor,3413000000.0 + + 2019-12-31,2019,4,balanceSheet,assetsCurrent,152578000000.0 + + 2019-12-31,2019,4,incomeStatement,shareswa,689687449.0 + + 2019-12-31,2019,4,balanceSheet,investments,114255000000.0 + + 2019-12-31,2019,4,incomeStatement,prefDVDs,0.0 + + 2019-12-31,2019,4,balanceSheet,intangibles,22603000000.0 + + 2019-12-31,2019,4,incomeStatement,opex,15789000000.0 + + 2019-12-31,2019,4,balanceSheet,inventory,999000000.0 + + 2019-12-31,2019,4,balanceSheet,deposits,0.0 + + 2019-12-31,2019,4,incomeStatement,ebt,10704000000.0 + + 2019-12-31,2019,4,balanceSheet,investmentsNonCurrent,13078000000.0 + + 2019-12-31,2019,4,balanceSheet,totalAssets,275909000000.0 + + 2019-12-31,2019,4,balanceSheet,deferredRev,8182000000.0 + + 2019-12-31,2019,4,incomeStatement,taxExp,33000000.0 + + 2019-12-31,2019,4,balanceSheet,debt,14768000000.0 + + 2019-12-31,2019,4,incomeStatement,costRev,21020000000.0 + + 2019-12-31,2019,4,balanceSheet,acctPay,5561000000.0 + + 2019-12-31,2019,4,cashFlow,ncf,2466000000.0 + + 2019-12-31,2019,4,incomeStatement,netIncDiscOps,0.0 + + 2019-12-31,2019,4,cashFlow,ncfi,-4703000000.0 + + 2019-12-31,2019,4,balanceSheet,debtNonCurrent,14768000000.0 + + 2019-12-31,2019,4,incomeStatement,ebit,10704000000.0 + + 2019-12-31,2019,4,incomeStatement,netIncComStock,10671000000.0 + + 2019-12-31,2019,4,incomeStatement,intexp,0.0 + + 2019-12-31,2019,4,incomeStatement,consolidatedIncome,10671000000.0 + + 2019-12-31,2019,4,balanceSheet,equity,201442000000.0 + + 2019-12-31,2019,4,overview,grossMargin,0.543787303309821 + + 2019-12-31,2019,4,overview,roa,0.131910509188086 + + 2019-12-31,2019,4,overview,bookVal,201442000000.0 + + 2019-12-31,2019,4,overview,bvps,292.077230478933 + + 2019-12-31,2019,4,overview,profitMargin,0.543787303309821 + + 2019-12-31,2019,4,overview,revenueQoQ,0.173108259496894 + + 2019-12-31,2019,4,overview,rps,66.8056234266777 + + 2019-12-31,2019,4,overview,roe,0.177925719651588 + + 2019-12-31,2019,4,overview,currentRatio,3.374051878552 + + 2019-12-31,2019,4,overview,piotroskiFScore,4.0 + + 2019-12-31,2019,4,overview,longTermDebtEquity,0.073311424628429 + + 2019-12-31,2019,4,overview,epsQoQ,0.201086956521739 + + 2019-12-31,2019,0,cashFlow,issrepayEquity,-23161000000.0 + + 2019-12-31,2019,0,balanceSheet,inventory,999000000.0 + + 2019-12-31,2019,0,cashFlow,freeCashFlow,30972000000.0 + + 2019-12-31,2019,0,balanceSheet,taxAssets,2887000000.0 + + 2019-12-31,2019,0,balanceSheet,deposits,0.0 + + 2019-12-31,2019,0,balanceSheet,debtNonCurrent,14768000000.0 + + 2019-12-31,2019,0,balanceSheet,assetsNonCurrent,123331000000.0 + + 2019-12-31,2019,0,incomeStatement,ebt,39625000000.0 + + 2019-12-31,2019,0,incomeStatement,consolidatedIncome,34343000000.0 + + 2019-12-31,2019,0,incomeStatement,nonControllingInterests,0.0 + + 2019-12-31,2019,0,balanceSheet,investmentsNonCurrent,13078000000.0 + + 2019-12-31,2019,0,incomeStatement,ebitda,51406000000.0 + + 2019-12-31,2019,0,incomeStatement,opinc,34231000000.0 + + 2019-12-31,2019,0,balanceSheet,totalAssets,275909000000.0 + + 2019-12-31,2019,0,incomeStatement,ebit,39625000000.0 + + 2019-12-31,2019,0,cashFlow,ncff,-23209000000.0 + + 2019-12-31,2019,0,balanceSheet,deferredRev,8182000000.0 + + 2019-12-31,2019,0,incomeStatement,epsDil,49.16 + + 2019-12-31,2019,0,balanceSheet,taxLiabilities,11860000000.0 + + 2019-12-31,2019,0,incomeStatement,taxExp,5282000000.0 + + 2019-12-31,2019,0,balanceSheet,ppeq,84587000000.0 + + 2019-12-31,2019,0,cashFlow,investmentsAcqDisposals,-4017000000.0 + + 2019-12-31,2019,0,balanceSheet,debt,14768000000.0 + + 2019-12-31,2019,0,incomeStatement,netIncComStock,34343000000.0 + + 2019-12-31,2019,0,cashFlow,payDiv,0.0 + + 2019-12-31,2019,0,incomeStatement,costRev,71896000000.0 + + 2019-12-31,2019,0,incomeStatement,netinc,34343000000.0 + + 2019-12-31,2019,0,balanceSheet,investmentsCurrent,101177000000.0 + + 2019-12-31,2019,0,balanceSheet,acctPay,5561000000.0 + + 2019-12-31,2019,0,incomeStatement,eps,49.59 + + 2019-12-31,2019,0,incomeStatement,sga,28015000000.0 + + 2019-12-31,2019,0,cashFlow,ncf,1797000000.0 + + 2019-12-31,2019,0,balanceSheet,acctRec,25326000000.0 + + 2019-12-31,2019,0,incomeStatement,intexp,0.0 + + 2019-12-31,2019,0,balanceSheet,liabilitiesCurrent,45221000000.0 + + 2019-12-31,2019,0,balanceSheet,cashAndEq,18498000000.0 + + 2019-12-31,2019,0,incomeStatement,rnd,26018000000.0 + + 2019-12-31,2019,0,cashFlow,businessAcqDisposals,-2515000000.0 + + 2019-12-31,2019,0,balanceSheet,accoci,-1232000000.0 + + 2019-12-31,2019,0,incomeStatement,netIncDiscOps,0.0 + + 2019-12-31,2019,0,cashFlow,sbcomp,10794000000.0 + + 2019-12-31,2019,0,cashFlow,depamor,11781000000.0 + + 2019-12-31,2019,0,balanceSheet,equity,201442000000.0 + + 2019-12-31,2019,0,balanceSheet,liabilitiesNonCurrent,29246000000.0 + + 2019-12-31,2019,0,balanceSheet,assetsCurrent,152578000000.0 + + 2019-12-31,2019,0,cashFlow,capex,-23548000000.0 + + 2019-12-31,2019,0,balanceSheet,retainedEarnings,152122000000.0 + + 2019-12-31,2019,0,incomeStatement,shareswa,689687449.0 + + 2019-12-31,2019,0,balanceSheet,totalLiabilities,74467000000.0 + + 2019-12-31,2019,0,balanceSheet,debtCurrent,0.0 + + 2019-12-31,2019,0,balanceSheet,investments,114255000000.0 + + 2019-12-31,2019,0,incomeStatement,revenue,161857000000.0 + + 2019-12-31,2019,0,incomeStatement,grossProfit,89961000000.0 + + 2019-12-31,2019,0,incomeStatement,prefDVDs,0.0 + + 2019-12-31,2019,0,cashFlow,issrepayDebt,-268000000.0 + + 2019-12-31,2019,0,cashFlow,ncfo,54520000000.0 + + 2019-12-31,2019,0,balanceSheet,intangibles,22603000000.0 + + 2019-12-31,2019,0,cashFlow,ncfi,-29491000000.0 + + 2019-12-31,2019,0,cashFlow,ncfx,-23000000.0 + + 2019-12-31,2019,0,incomeStatement,opex,55730000000.0 + + 2019-12-31,2019,0,balanceSheet,sharesBasic,689687449.0 + +' + headers: + allow: + - GET, HEAD, OPTIONS + content-length: + - '11225' + content-type: + - text/csv + date: + - Sat, 06 Feb 2021 16:23:40 GMT + server: + - nginx/1.14.0 (Ubuntu) + vary: + - Accept, Cookie, Origin + x-frame-options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_tiingo.py b/tests/test_tiingo.py index bb805a33..ac7e1d51 100644 --- a/tests/test_tiingo.py +++ b/tests/test_tiingo.py @@ -226,3 +226,44 @@ def test_news_bulk_as_objects(self): """Fails because this API key lacks institutional license""" with self.assertRaises(RestClientError): assert self._client.get_bulk_news(file_id="1", fmt="object") + +# FUNDAMENTALS ENDPOINTS +class TestFundamentals(TestCase): + + def setUp(self): + self._client = TiingoClient() + + @vcr.use_cassette('tests/fixtures/fundamentals_definitions.yaml') + def test_definitions(self): + definitions = self._client.get_fundamentals_definitions("GOOGL") + assert len(definitions) > 1 + + @vcr.use_cassette('tests/fixtures/fundamentals_daily.yaml') + def test_daily(self): + daily = self._client.get_fundamentals_daily("GOOGL", + startDate='2020-1-1', + endDate='2020-4-1') + assert len(daily) > 1 + + @vcr.use_cassette('tests/fixtures/fundamentals_daily_csv.yaml') + def test_daily_with_csv(self): + daily = self._client.get_fundamentals_daily("GOOGL", + startDate='2020-1-1', + endDate='2020-4-1', + fmt='csv') + assert len(daily) > 1 + + @vcr.use_cassette('tests/fixtures/fundamentals_statements.yaml') + def test_statements(self): + statements = self._client.get_fundamentals_statements("GOOGL", + startDate='2020-1-1', + endDate='2020-4-1') + assert len(statements) > 1 + + @vcr.use_cassette('tests/fixtures/fundamentals_statements_csv.yaml') + def test_statements_with_csv(self): + statements = self._client.get_fundamentals_statements("GOOGL", + startDate='2020-1-1', + endDate='2020-4-1', + fmt='csv') + assert len(statements) > 1 diff --git a/tiingo/api.py b/tiingo/api.py index bfef0501..49702a46 100644 --- a/tiingo/api.py +++ b/tiingo/api.py @@ -428,3 +428,85 @@ def get_crypto_metadata(self, tickers=[], fmt='json'): return response.content.decode("utf-8") else: return response.json() + + # FUNDAMENTAL DEFINITIONS + # tiingo/fundamentals/definitions + def get_fundamentals_definitions(self, tickers=[], fmt='json'): + """Return definitions for fundamentals for specified tickers + https://api.tiingo.com/documentation/fundamentals + + Args: + tickers [string] : optional, either list or string + fmt (string): 'csv' or 'json' + """ + url = "tiingo/fundamentals/definitions" + params = { + 'tickers': tickers, + 'format': fmt + } + response = self._request('GET', url, params=params) + if fmt == 'json': + return response.json() + elif fmt == 'csv': + return response.content.decode("utf-8") + + # FUNDAMENTAL DAILY + # tiingo/fundamentals//daily + def get_fundamentals_daily(self, ticker, fmt='json', + startDate=None, endDate=None): + """Returns metrics which rely on daily price-updates + https://api.tiingo.com/documentation/fundamentals + + # Dates are in YYYY-MM-DD Format. + + Args: + tickers [string] : List of unique Stock Tickers to search + startDate, endDate [date]: Boundaries of search window + fmt (string): 'csv' or 'json' + """ + url = 'tiingo/fundamentals/{}/daily'.format(ticker) + params = { + 'startDate': startDate, + 'endDate': endDate, + 'format': fmt + } + response = self._request('GET', url, params=params) + if fmt == 'json': + return response.json() + elif fmt == 'csv': + return response.content.decode("utf-8") + + # FUNDAMENTAL STATEMENTS + # tiingo/fundamentals//statements + def get_fundamentals_statements(self, ticker, asReported=False, fmt='json', + startDate=None, endDate=None): + """Returns data that is extracted from quarterly and annual statements. + https://api.tiingo.com/documentation/fundamentals + + # Dates are in YYYY-MM-DD Format. + + Args: + tickers [string] : List of unique Stock Tickers to search + startDate, endDate [date]: Boundaries of search window + asReported [bool]: get most-recent data (False) or data \ + as it was reported on the release-date + (True) + fmt (string): 'csv' or 'json' + """ + if asReported: + asReported = 'true' + else: + asReported = 'false' + + url = 'tiingo/fundamentals/{}/statements'.format(ticker) + params = { + 'startDate': startDate, + 'endDate': endDate, + 'asReported': asReported, + 'format': fmt + } + response = self._request('GET', url, params=params) + if fmt == 'json': + return response.json() + elif fmt == 'csv': + return response.content.decode("utf-8")