equities


Nameequities JSON
Version 4.2.6 PyPI version JSON
download
home_pagehttps://github.com/ljc-codes/equities.git
Summaryequities aims to democratize access to public company data.
upload_time2020-12-01 01:19:57
maintainer
docs_urlNone
authorTiger_Shark
requires_python>=3.6
license
keywords sec stock stockmarket equities equity data financials financial company public companies xbrl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🐋 equities 


--------------------------------------------------------------------------------------------------------------------

Democratizing Access to U.S. Public Company Data

--------------------------------------------------------------------------------------------------------------------

## Overview: 

**equities** is an intuitive package for accessing high fidelity public company financial data. 

**equities** takes the approach of composing already existing stable and highly maintained libraries and apis. 

All data is served back to the user as dictionary objects or **pandas** dataframes. 

###### Data Sources: 

    Financial Statements:
    Sec Xbrl Financial Statement Data:
        - https://www.sec.gov/dera/data/financial-statement-data-sets.html

    Prices, Recommendations, Major Holders, etc:
    Yfinance Pypi Package
        - https://pypi.org/project/yfinance/

    Trend Data
    pytrends Pypi Package
        - https://pypi.org/project/pytrends/

## Install: 

    pip3 install equities

## TUTORIAL: 

#### Instantiating a Universe

We begin by initializing a universe client.

    from equities import Universe
    u = Universe(verbose=True)

The verbose optional argument defaults to False. 
The results of initializing with the verbose=True looks something like this: 

    ----------------------------------------
    🐋	Welcome to equities.
    ----------------------------------------
    Initializing Universe...
    > ✨	Auth success. apis connected.
    > 🌌	Universe initialized. size: 7896
    Success. You're good to go!
    ----------------------------------------


#### Essential Methods 

To get the number of companies in the universe call: 

    len(u)

"CIK" numbers are the sec's official unique identifier for public companies. It stands for "Central Index Key" A full list of the cik numbers in the universe is found in:

    u.ciks

Similarly, if we want the names of companies in the universe we can call: 

    u.names

Finally, to get tickers we call:

    u.tickers

To get a dictionary mapping "cik" numbers to the names of companies execute:

    u.cik_to_name()

We can get get a map of cik numbers to tickers through :

    u.cik_to_ticker()


The inverses of both of these dictionaries are also accessible through u.name_to_cik() and u.ticker_to_cik()

## Search: 

You can search for companies by names, ticker or ciks by using the search function. Note that in all universe queries handle for case and whitespace.

    u.search("netflix")

Here are the results of this query.

    > 🛰️     Search query: "netflix" found 1 matches.
    {'NETFLIX INC': '1065280'}

Let's find the ticker of this company. 

    u.cik_to_ticker()['1065280']

Here are results:

    'nflx'

## Queries: 

#### Company 

company data can be obtained by passing a "cik" or "ticker" into the "company()" function on the universe. 

    u.company('nflx')

    # we can also pass in a query like this: u.company("Netflix",search=True). 
    # It returns the first result of the search query. 

The above requests returns a dictionary. Here are it's keys: 

    dict_keys(
        ['name',
         'sic',
         'business_address',
         'mailing_address',
         'phone',
         'country_incorporated',
         'state_incorporated', 'ein',
         'former_name',
         'income',
         'balance',
         'cash',
         'equity',
         'prices',
         'actions',
         'dividends',
         'splits',
         'major_holders',
         'institutional_holders',
         'events',
         'recommendations',
         'esg']
    )

Now see below the full response from the request.

 Observe that the keys, "income","balance","cash","equity" are dataframes and encode the income statement, balance sheet, cashflow statement and equity statement respectively of the company in question. Other keys also map to dataframes for example "prices" and "institutional holders". Naming conventions and structure is chosen for simplicity. 

    > 📦    Fetching company: 1065280 ...
    {
        "name " : " NETFLIX INC ",
        "sic " : " 7841.0 ",
        "business_address " :  
            {
                'country': 'US',
                'city': 'LOS GATOS',
                'zip': '95032',
                'adr1': '100 WINCHESTER CIRCLE',
                'adr2': '.'
            },
        "mailing_address " : 
            {
                'country': 'US',
                'city': 'LOS GATOS',
                'zip': '95032-7606',
                'adr1': '100 WINCHESTER CIRCLE',
                'adr2': 'nan',
                'state': 'CA'
            },
        "phone " : "408-540-3700 ",
        "country_incorporated " : " US ",
        "state_incorporated " : " DE ",
        "ein " : " 770467272.0 ",
        "former_name " : " NETFLIX COM INC ",
            "income " :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3
            Revenues                                             None   None   None   None   None  ...  3.700856e+09  3.907270e+09  3.999374e+09  5.767691e+09  6.148286e+09
            CostOfRevenue                                        None   None   None   None   None  ...  2.300579e+09  5.876271e+09  8.974190e+09  2.870614e+09  3.643707e+09
            MarketingExpense                                     None   None   None   None   None  ...  6.165780e+08  5.920070e+08  5.103300e+08  5.038300e+08  1.219728e+09
            ResearchAndDevelopmentExpense                        None   None   None   None   None  ...  2.823100e+08  5.814050e+08  8.900250e+08  4.538170e+08  3.832330e+08
            GeneralAndAdministrativeExpense                      None   None   None   None   None  ...  2.019520e+08  1.515240e+08  1.686280e+08  2.520870e+08  2.246570e+08
            OperatingIncomeLoss                                  None   None   None   None   None  ...  4.465780e+08  4.622130e+08  4.806680e+08  4.590840e+08  7.064190e+08
            InterestExpense                                      None   None   None   None   None  ...  1.355290e+08  2.875620e+08  4.482220e+08  1.355290e+08  1.891510e+08
            NonoperatingIncomeExpense                            None   None   None   None   None  ...  7.610400e+07  6.802800e+07  7.004000e+06  2.169700e+07  2.263400e+07
            IncomeLossFromContinuingOperationsBeforeIncomeT...   None   None   None   None   None  ...  3.996590e+08  7.282520e+08  1.107062e+09  7.958700e+08  9.005750e+08
            IncomeTaxExpenseBenefit                              None   None   None   None   None  ...  9.492000e+06  4.428700e+07  6.329520e+08  8.680300e+07  3.154060e+08
            NetIncomeLoss                                        None   None   None   None   None  ...  2.901240e+08  3.843490e+08  4.028350e+08  3.440520e+08  2.706500e+08
            EarningsPerShareBasic                                None   None   None   None   None  ...  7.900000e-01  8.800000e-01  9.200000e-01  7.900000e-01  6.200000e-01
            EarningsPerShareDiluted                              None   None   None   None   None  ...  7.600000e-01  1.360000e+00  2.830000e+00  7.600000e-01  1.360000e+00
            WeightedAverageNumberOfSharesOutstandingBasic        None   None   None   None   None  ...  4.341740e+08  4.375870e+08  4.380900e+08  4.369470e+08  4.375870e+08
            WeightedAverageNumberOfDilutedSharesOutstanding      None   None   None   None   None  ...  4.503590e+08  4.520630e+08  4.518960e+08  4.519220e+08  4.520630e+08
            GainsLossesOnExtinguishmentOfDebt                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            OtherNonoperatingIncome                              None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            CostOfGoodsSoldSubscription                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            FulfillmentExpense                                   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            GrossProfit                                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            OperatingExpenses                                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            TechnologyandDevelopmentExpense                      None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN

            [22 rows x 44 columns] ,
            "balance " :                                                  2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3
            CommonStockParOrStatedValuePerShare               None   None   None   None   None  ...  1.000000e-03  1.000000e-03  1.000000e-03  1.000000e-03  1.000000e-03
            CommonStockSharesAuthorized                       None   None   None   None   None  ...  4.990000e+09  4.990000e+09  4.990000e+09  4.990000e+09  4.990000e+09
            CommonStockSharesIssued                           None   None   None   None   None  ...  4.365986e+08  4.378349e+08  4.382513e+08  4.397806e+08  4.410154e+08
            CashAndCashEquivalentsAtCarryingValue             None   None   None   None   None  ...  3.794483e+09  3.794483e+09  3.794483e+09  5.151884e+09  7.153248e+09
            AvailableForSaleSecuritiesCurrent                 None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            CommonStockSharesOutstanding                      None   None   None   None   None  ...  4.365986e+08  4.365986e+08  4.382513e+08  4.397806e+08  4.388066e+08
            ContentAssetsNetCurrent                           None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            OtherAssetsCurrent                                None   None   None   None   None  ...  8.203500e+08  7.484660e+08  7.484660e+08  1.295897e+09  1.160067e+09
            AssetsCurrent                                     None   None   None   None   None  ...  9.694135e+09  9.694135e+09  9.694135e+09  6.178504e+09  8.564139e+09
            ContentAssetsNetNoncurrent                        None   None   None   None   None  ...  2.088878e+10           NaN  2.323499e+10  2.526689e+10  2.515512e+10
            PropertyPlantAndEquipmentNet                      None   None   None   None   None  ...  4.343720e+08  4.182810e+08  4.819920e+08  5.652210e+08  7.519410e+08
            OtherAssetsNoncurrent                             None   None   None   None   None  ...  1.726568e+09  1.896043e+09  9.010300e+08  2.727420e+09  2.727420e+09
            Assets                                            None   None   None   None   None  ...  2.721863e+10  3.017134e+10  3.094171e+10  3.505991e+10  3.717528e+10
            ContentLiabilitiesCurrent                         None   None   None   None   None  ...  4.686019e+09           NaN  4.860542e+09  4.413561e+09  4.664733e+09
            AccountsPayableCurrent                            None   None   None   None   None  ...  5.629850e+08  4.421940e+08  5.629850e+08  6.743470e+08  6.743470e+08
            AccruedLiabilitiesCurrent                         None   None   None   None   None  ...  4.774170e+08  4.774170e+08  1.037723e+09  8.430430e+08  9.865950e+08
            DeferredRevenueCurrent                            None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            LiabilitiesCurrent                                None   None   None   None   None  ...  6.487320e+09  6.487320e+09  7.257900e+09  6.855696e+09  6.855696e+09
            ContentLiabilitiesNoncurrent                      None   None   None   None   None  ...  3.759026e+09           NaN  3.759026e+09  3.206051e+09  3.208164e+09
            LongTermDebtNoncurrent                            None   None   None   None   None  ...  1.036006e+10  1.036006e+10  1.036006e+10  1.475926e+10  1.475926e+10
            OtherLiabilitiesNoncurrent                        None   None   None   None   None  ...  1.292310e+08  1.292310e+08  1.292310e+08  1.444276e+09  1.710948e+09
            Liabilities                                       None   None   None   None   None  ...  2.151557e+10  2.073564e+10  2.408021e+10  2.665062e+10  2.639356e+10
            CommitmentsAndContingencies                       None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            CommonStockValue                                  None   None   None   None   None  ...  2.315988e+09  2.315988e+09  2.315988e+09  2.793929e+09  2.793929e+09
            AccumulatedOtherComprehensiveIncomeLossNetOfTax   None   None   None   None   None  ... -1.958200e+07 -1.958200e+07 -1.958200e+07 -2.352100e+07 -3.407200e+07
            RetainedEarningsAccumulatedDeficit                None   None   None   None   None  ...  3.288885e+09  2.942359e+09  4.224779e+09  5.520816e+09  4.811749e+09
            StockholdersEquity                                None   None   None   None   None  ...  5.238765e+09  3.581956e+09  3.581956e+09  5.703058e+09  7.582157e+09
            LiabilitiesAndStockholdersEquity                  None   None   None   None   None  ...  2.597440e+10  2.597440e+10  2.597440e+10  3.505991e+10  3.717528e+10
            PreferredStockParOrStatedValuePerShare            None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            PreferredStockSharesAuthorized                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            PreferredStockSharesIssued                        None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            PreferredStockSharesOutstanding                   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            PreferredStockValue                               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            ContentLibraryNetCurrent                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            PrepaidContentCurrent                             None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            ContentLibraryNetNoncurrent                       None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            DueToRelatedPartiesNoncurrent                     None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            AdditionalPaidInCapitalCommonStock                None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            ContractWithCustomerLiabilityCurrent              None   None   None   None   None  ...  8.086920e+08  7.608990e+08  9.155060e+08  9.247450e+08  1.029261e+09
            ShortTermBorrowings                               None   None   None   None   None  ...           NaN           NaN           NaN  0.000000e+00  4.991610e+08
            OtherPrepaidExpenseCurrent                        None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            ContentAccountsPayableCurrent                     None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            ContentAccountsPayableNoncurrent                  None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            SeniorLongTermNotes                               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            RelatedPartyTransactionDueFromToRelatedParty      None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            LicensingAssetCurrent                             None   None   None   None   None  ...  5.151186e+09           NaN  5.151186e+09           NaN           NaN

            [46 rows x 44 columns] ,
            "cash " :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2       2019q3        2019q4        2020q2        2020q3
            NetIncomeLoss                                        None   None   None   None   None  ...  2.901240e+08  384349000.0  4.028350e+08  7.090670e+08  2.706500e+08
            AdditionstoStreamingContentAssets                    None   None   None   None   None  ...  2.997746e+09          NaN  9.971141e+09  3.294275e+09  2.510782e+09
            ChangeInStreamingContentLiabilities                  None   None   None   None   None  ... -1.469800e+07          NaN -9.554800e+07  2.589450e+08 -1.084320e+08
            CostofServicesAmortizationofStreamingContentAssets   None   None   None   None   None  ...  2.124686e+09          NaN  1.911767e+09  2.483385e+09  4.356601e+09
            CostofServicesAmortizationofDVDContentAssets         None   None   None   None   None  ...  8.509000e+06          NaN  2.281900e+07           NaN           NaN
            ...                                                   ...    ...    ...    ...    ...  ...           ...          ...           ...           ...           ...
            ProceedsFromSaleOfAvailableForSaleSecuritiesDebt     None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN
            InterestPaidNet                                      None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN
            ProceedsfromPublicOfferingofCommonStock              None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN
            ExtinguishmentOfDebtAmount                           None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN
            ForeignCurrencyTransactionLossBeforeTax              None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN

            [71 rows x 44 columns] ,
            "equity " :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3
            NetIncomeLoss                                        None   None   None   None   None  ...  3.440520e+08  6.147020e+08  1.279946e+09  3.440520e+08  2.706500e+08
            OtherComprehensiveIncomeLossNetOfTaxPortionAttr...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodSharesStockOptionsExercised   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodValueStockOptionsExercised    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodSharesConversionOfConver...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodValueConversionOfConvert...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            AdjustmentsToAdditionalPaidInCapitalSharebasedC...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            AdjustmentsToAdditionalPaidInCapitalTaxEffectFr...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockholdersEquity                                   None   None   None   None   None  ...  5.703058e+09  6.105548e+09  6.861505e+09  5.703058e+09  6.105548e+09
            ComprehensiveIncomeNetOfTax                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodValueEmployeeStockPurcha...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodValueNewIssues                None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockRepurchasedAndRetiredDuringPeriodValue          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockRepurchasedAndRetiredDuringPeriodShares         None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            CumulativeEffectOfNewAccountingPrincipleInPerio...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN
            StockIssuedDuringPeriodSharesNewIssues               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN

            [16 rows x 44 columns] ,
            "prices " :                    Open        High         Low       Close     Volume  Dividends  Stock Splits
            Date                                                                                          
            2002-05-23    1.156429    1.242857    1.145714    1.196429  104790000          0           0.0
            2002-05-24    1.214286    1.225000    1.197143    1.210000   11104800          0           0.0
            2002-05-28    1.213571    1.232143    1.157143    1.157143    6609400          0           0.0
            2002-05-29    1.164286    1.164286    1.085714    1.103571    6757800          0           0.0
            2002-05-30    1.107857    1.107857    1.071429    1.071429   10154200          0           0.0
            ...                ...         ...         ...         ...        ...        ...           ...
            2020-10-21  501.029999  506.850006  488.250000  489.049988   17405700          0           0.0
            2020-10-22  494.690002  495.140015  482.000000  485.230011    6997900          0           0.0
            2020-10-23  488.109985  490.059998  481.350006  488.279999    4927900          0           0.0
            2020-10-26  487.029999  496.820007  478.899994  488.239990    6174200          0           0.0
            2020-10-27  490.010010  490.000000  482.929993  488.929993    3547975          0           0.0

            [4641 rows x 7 columns] ,
        "actions " :              Dividends  Stock Splits
            Date                               
            2004-02-12        0.0           2.0
            2015-07-15        0.0           7.0 ",
        "dividends " : " Series([], Name: Dividends, dtype: int64) ",
        "splits " : " Date
            2004-02-12    2.0
            2015-07-15    7.0
            Name: Stock Splits, dtype: float64 ",
        "major_holders " : "         0                                      1
            0   1.62%        % of Shares Held by All Insider
            1  83.49%       % of Shares Held by Institutions
            2  84.86%        % of Float Held by Institutions
            3    1975  Number of Institutions Holding Shares ",
            "institutional_holders " : "                               Holder    Shares Date Reported   % Out        Value
            0  Capital Research Global Investors  34111988    2020-06-29  0.0772  15522319019
            1         Vanguard Group, Inc. (The)  34001284    2020-06-29  0.0770  15471944271
            2                     Blackrock Inc.  29171135    2020-06-29  0.0660  13274033270
            3                           FMR, LLC  22033243    2020-06-29  0.0499  10026006894
            4      Price (T.Rowe) Associates Inc  20626346    2020-06-29  0.0467   9385812483
            5           State Street Corporation  16613245    2020-06-29  0.0376   7559691004
            6    Capital International Investors  15137030    2020-06-29  0.0343   6887954131
            7            Capital World Investors  13676170    2020-06-29  0.0310   6223204396
            8            Jennison Associates LLC   9099165    2020-06-29  0.0206   4140484041
            9        Baillie Gifford and Company   7713485    2020-06-29  0.0175   3509944214 ,
        "events " :                                      0                    1
            Earnings Date     2021-01-19 00:00:00  2021-01-25 00:00:00
            Earnings Average                 2.13                 2.13
            Earnings Low                     1.82                 1.82
            Earnings High                     2.3                  2.3
            Revenue Average            6379370000           6379370000
            Revenue Low                6281000000           6281000000
            Revenue High               6593000000           6593000000 ",
            "recommendations " : "                                     0                    1
            Earnings Date     2021-01-19 00:00:00  2021-01-25 00:00:00
            Earnings Average                 2.13                 2.13
            Earnings Low                     1.82                 1.82
            Earnings High                     2.3                  2.3
            Revenue Average            6379370000           6379370000
            Revenue Low                6281000000           6281000000
            Revenue High               6593000000           6593000000 ",
            "esg " : "                             Value
            2020-10                          
            palmOil                     False
            controversialWeapons        False
            gambling                    False
            socialScore                  7.56
            nuclear                     False
            furLeather                  False
            alcoholic                   False
            gmo                         False
            catholic                    False
            socialPercentile             None
            peerCount                      44
            governanceScore             10.32
            environmentPercentile        None
            animalTesting               False
            tobacco                     False
            totalEsg                    18.05
            highestControversy              2
            esgPerformance         UNDER_PERF
            coal                        False
            pesticides                  False
            adult                       False
            percentile                   14.5
            peerGroup                   Media
            smallArms                   False
            environmentScore             0.16
            governancePercentile         None
            militaryContract            False, 
        "interest":             NETFLIX INC isPartial
            date                             
            2015-11-22           57     False
            2015-11-29           47     False
            2015-12-06           45     False
            2015-12-13           39     False
            2015-12-20           32     False
            ...                 ...       ...
            2020-10-18           69     False
            2020-10-25           57     False
            2020-11-01           55     False
            2020-11-08           63     False
            2020-11-15           73      True

            [261 rows x 2 columns]}
    }


#### Sub Functions

The previous request pulls all data about a given company. This is obviously resource intensive. If you would like to request some subset of the full request, we advise using subfunctions. The following is a list of all available subfunctions.

    u.prices(cik_or_ticker)                                 # prices,volume, splits dataframe

    u.dividends(cik_or_ticker)                              # dividend payouts dataframe

    u.financial_statement(cik_or_ticker,kind="income")      # income statement dataframe

    u.financial_statement(cik_or_ticker,kind="balance")     # balance sheet dataframe

    u.financial_statement(cik_or_ticker,"cash")             # cashflow statement dataframe

    u.major_sharholders(cik_or_ticker)                      # major shareholders dataframe

    u.major_sharholders(cik_or_ticker)                      # major shareholders dataframe

    u.institutional_holders(cik_or_ticker")                 # institutional holders dataframe

    u.events(cik_or_ticker)                                 # date of events dataframe

    u.splits(cik_or_ticker)                                 # stock split events dataframe

    u.recommendations(cik_or_ticker)                        # analyst recommendations dataframe

    u.esg(cik_or_ticker)                                    # esg metrics dataframe

    u.interest(name)                                        # google trends dataframe


#### Example Use Case 

I really want to demonstrate the beauty of what we have here since this is often difficult when
looking at thousands of numeric datatables. Let's take a very naive peek by plotting various 
dataframes as timeseries. 

The following is a start to finish example of how one might plot the financial statements and price 
series of the first five companies in the universe.

Here's how we'd implement that: 

    from equities import Universe
    import matplotlib.pyplot as plt 

    u = Universe()

    k,f,s = 'bar',(10,7),True
    for cik in u.ciks[:5]:

        c = u.company(cik)

        income = c['income']
        if not income.empty:
            income.T.plot(
            kind=k,
            figsize=f,
            stacked=s)

        balance = c['balance']
        if not balance.empty:
            balance.T.plot(
            kind=k,
            figsize=f,
            stacked=s) 

        cash = c['cash']
        if not cash.empty:
            cash.T.plot(
            kind=k,
            figsize=f,
            stacked=s)

        prices = c['prices']
        if not prices.empty:
            prices.drop('Volume',axis=1).plot(
                kind='line',
                figsize=f)

        # Notice that the code above is expensive since we are interested in a few fields
        # within the results "c", using sub functions would be much more efficient.

    plt.show()

## Donate: 

Consider buying me a coffee to fund the future development of this project.

    bitcoin wallet address: 3LU5MEaAXRJoCo6vx67g1Jj7qDFRKhMs5t


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ljc-codes/equities.git",
    "name": "equities",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "sec stock stockmarket equities equity data financials financial company public companies xbrl",
    "author": "Tiger_Shark",
    "author_email": "ljwcharles@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/c3/f15c3d937123ac9c1945166c2ed8357c545d22aa1330b356a3dbc01188ae/equities-4.2.6.tar.gz",
    "platform": "",
    "description": "# \ud83d\udc0b equities \n\n\n--------------------------------------------------------------------------------------------------------------------\n\nDemocratizing Access to U.S. Public Company Data\n\n--------------------------------------------------------------------------------------------------------------------\n\n## Overview: \n\n**equities** is an intuitive package for accessing high fidelity public company financial data. \n\n**equities** takes the approach of composing already existing stable and highly maintained libraries and apis. \n\nAll data is served back to the user as dictionary objects or **pandas** dataframes. \n\n###### Data Sources: \n\n    Financial Statements:\n    Sec Xbrl Financial Statement Data:\n        - https://www.sec.gov/dera/data/financial-statement-data-sets.html\n\n    Prices, Recommendations, Major Holders, etc:\n    Yfinance Pypi Package\n        - https://pypi.org/project/yfinance/\n\n    Trend Data\n    pytrends Pypi Package\n        - https://pypi.org/project/pytrends/\n\n## Install: \n\n    pip3 install equities\n\n## TUTORIAL: \n\n#### Instantiating a Universe\n\nWe begin by initializing a universe client.\n\n    from equities import Universe\n    u = Universe(verbose=True)\n\nThe verbose optional argument defaults to False. \nThe results of initializing with the verbose=True looks something like this: \n\n    ----------------------------------------\n    \ud83d\udc0b\tWelcome to equities.\n    ----------------------------------------\n    Initializing Universe...\n    > \u2728\tAuth success. apis connected.\n    > \ud83c\udf0c\tUniverse initialized. size: 7896\n    Success. You're good to go!\n    ----------------------------------------\n\n\n#### Essential Methods \n\nTo get the number of companies in the universe call: \n\n    len(u)\n\n\"CIK\" numbers are the sec's official unique identifier for public companies. It stands for \"Central Index Key\" A full list of the cik numbers in the universe is found in:\n\n    u.ciks\n\nSimilarly, if we want the names of companies in the universe we can call: \n\n    u.names\n\nFinally, to get tickers we call:\n\n    u.tickers\n\nTo get a dictionary mapping \"cik\" numbers to the names of companies execute:\n\n    u.cik_to_name()\n\nWe can get get a map of cik numbers to tickers through :\n\n    u.cik_to_ticker()\n\n\nThe inverses of both of these dictionaries are also accessible through u.name_to_cik() and u.ticker_to_cik()\n\n## Search: \n\nYou can search for companies by names, ticker or ciks by using the search function. Note that in all universe queries handle for case and whitespace.\n\n    u.search(\"netflix\")\n\nHere are the results of this query.\n\n    > \ud83d\udef0\ufe0f     Search query: \"netflix\" found 1 matches.\n    {'NETFLIX INC': '1065280'}\n\nLet's find the ticker of this company. \n\n    u.cik_to_ticker()['1065280']\n\nHere are results:\n\n    'nflx'\n\n## Queries: \n\n#### Company \n\ncompany data can be obtained by passing a \"cik\" or \"ticker\" into the \"company()\" function on the universe. \n\n    u.company('nflx')\n\n    # we can also pass in a query like this: u.company(\"Netflix\",search=True). \n    # It returns the first result of the search query. \n\nThe above requests returns a dictionary. Here are it's keys: \n\n    dict_keys(\n        ['name',\n         'sic',\n         'business_address',\n         'mailing_address',\n         'phone',\n         'country_incorporated',\n         'state_incorporated', 'ein',\n         'former_name',\n         'income',\n         'balance',\n         'cash',\n         'equity',\n         'prices',\n         'actions',\n         'dividends',\n         'splits',\n         'major_holders',\n         'institutional_holders',\n         'events',\n         'recommendations',\n         'esg']\n    )\n\nNow see below the full response from the request.\n\n Observe that the keys, \"income\",\"balance\",\"cash\",\"equity\" are dataframes and encode the income statement, balance sheet, cashflow statement and equity statement respectively of the company in question. Other keys also map to dataframes for example \"prices\" and \"institutional holders\". Naming conventions and structure is chosen for simplicity. \n\n    > \ud83d\udce6    Fetching company: 1065280 ...\n    {\n        \"name \" : \" NETFLIX INC \",\n        \"sic \" : \" 7841.0 \",\n        \"business_address \" :  \n            {\n                'country': 'US',\n                'city': 'LOS GATOS',\n                'zip': '95032',\n                'adr1': '100 WINCHESTER CIRCLE',\n                'adr2': '.'\n            },\n        \"mailing_address \" : \n            {\n                'country': 'US',\n                'city': 'LOS GATOS',\n                'zip': '95032-7606',\n                'adr1': '100 WINCHESTER CIRCLE',\n                'adr2': 'nan',\n                'state': 'CA'\n            },\n        \"phone \" : \"408-540-3700 \",\n        \"country_incorporated \" : \" US \",\n        \"state_incorporated \" : \" DE \",\n        \"ein \" : \" 770467272.0 \",\n        \"former_name \" : \" NETFLIX COM INC \",\n            \"income \" :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3\n            Revenues                                             None   None   None   None   None  ...  3.700856e+09  3.907270e+09  3.999374e+09  5.767691e+09  6.148286e+09\n            CostOfRevenue                                        None   None   None   None   None  ...  2.300579e+09  5.876271e+09  8.974190e+09  2.870614e+09  3.643707e+09\n            MarketingExpense                                     None   None   None   None   None  ...  6.165780e+08  5.920070e+08  5.103300e+08  5.038300e+08  1.219728e+09\n            ResearchAndDevelopmentExpense                        None   None   None   None   None  ...  2.823100e+08  5.814050e+08  8.900250e+08  4.538170e+08  3.832330e+08\n            GeneralAndAdministrativeExpense                      None   None   None   None   None  ...  2.019520e+08  1.515240e+08  1.686280e+08  2.520870e+08  2.246570e+08\n            OperatingIncomeLoss                                  None   None   None   None   None  ...  4.465780e+08  4.622130e+08  4.806680e+08  4.590840e+08  7.064190e+08\n            InterestExpense                                      None   None   None   None   None  ...  1.355290e+08  2.875620e+08  4.482220e+08  1.355290e+08  1.891510e+08\n            NonoperatingIncomeExpense                            None   None   None   None   None  ...  7.610400e+07  6.802800e+07  7.004000e+06  2.169700e+07  2.263400e+07\n            IncomeLossFromContinuingOperationsBeforeIncomeT...   None   None   None   None   None  ...  3.996590e+08  7.282520e+08  1.107062e+09  7.958700e+08  9.005750e+08\n            IncomeTaxExpenseBenefit                              None   None   None   None   None  ...  9.492000e+06  4.428700e+07  6.329520e+08  8.680300e+07  3.154060e+08\n            NetIncomeLoss                                        None   None   None   None   None  ...  2.901240e+08  3.843490e+08  4.028350e+08  3.440520e+08  2.706500e+08\n            EarningsPerShareBasic                                None   None   None   None   None  ...  7.900000e-01  8.800000e-01  9.200000e-01  7.900000e-01  6.200000e-01\n            EarningsPerShareDiluted                              None   None   None   None   None  ...  7.600000e-01  1.360000e+00  2.830000e+00  7.600000e-01  1.360000e+00\n            WeightedAverageNumberOfSharesOutstandingBasic        None   None   None   None   None  ...  4.341740e+08  4.375870e+08  4.380900e+08  4.369470e+08  4.375870e+08\n            WeightedAverageNumberOfDilutedSharesOutstanding      None   None   None   None   None  ...  4.503590e+08  4.520630e+08  4.518960e+08  4.519220e+08  4.520630e+08\n            GainsLossesOnExtinguishmentOfDebt                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            OtherNonoperatingIncome                              None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            CostOfGoodsSoldSubscription                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            FulfillmentExpense                                   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            GrossProfit                                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            OperatingExpenses                                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            TechnologyandDevelopmentExpense                      None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n\n            [22 rows x 44 columns] ,\n            \"balance \" :                                                  2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3\n            CommonStockParOrStatedValuePerShare               None   None   None   None   None  ...  1.000000e-03  1.000000e-03  1.000000e-03  1.000000e-03  1.000000e-03\n            CommonStockSharesAuthorized                       None   None   None   None   None  ...  4.990000e+09  4.990000e+09  4.990000e+09  4.990000e+09  4.990000e+09\n            CommonStockSharesIssued                           None   None   None   None   None  ...  4.365986e+08  4.378349e+08  4.382513e+08  4.397806e+08  4.410154e+08\n            CashAndCashEquivalentsAtCarryingValue             None   None   None   None   None  ...  3.794483e+09  3.794483e+09  3.794483e+09  5.151884e+09  7.153248e+09\n            AvailableForSaleSecuritiesCurrent                 None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            CommonStockSharesOutstanding                      None   None   None   None   None  ...  4.365986e+08  4.365986e+08  4.382513e+08  4.397806e+08  4.388066e+08\n            ContentAssetsNetCurrent                           None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            OtherAssetsCurrent                                None   None   None   None   None  ...  8.203500e+08  7.484660e+08  7.484660e+08  1.295897e+09  1.160067e+09\n            AssetsCurrent                                     None   None   None   None   None  ...  9.694135e+09  9.694135e+09  9.694135e+09  6.178504e+09  8.564139e+09\n            ContentAssetsNetNoncurrent                        None   None   None   None   None  ...  2.088878e+10           NaN  2.323499e+10  2.526689e+10  2.515512e+10\n            PropertyPlantAndEquipmentNet                      None   None   None   None   None  ...  4.343720e+08  4.182810e+08  4.819920e+08  5.652210e+08  7.519410e+08\n            OtherAssetsNoncurrent                             None   None   None   None   None  ...  1.726568e+09  1.896043e+09  9.010300e+08  2.727420e+09  2.727420e+09\n            Assets                                            None   None   None   None   None  ...  2.721863e+10  3.017134e+10  3.094171e+10  3.505991e+10  3.717528e+10\n            ContentLiabilitiesCurrent                         None   None   None   None   None  ...  4.686019e+09           NaN  4.860542e+09  4.413561e+09  4.664733e+09\n            AccountsPayableCurrent                            None   None   None   None   None  ...  5.629850e+08  4.421940e+08  5.629850e+08  6.743470e+08  6.743470e+08\n            AccruedLiabilitiesCurrent                         None   None   None   None   None  ...  4.774170e+08  4.774170e+08  1.037723e+09  8.430430e+08  9.865950e+08\n            DeferredRevenueCurrent                            None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            LiabilitiesCurrent                                None   None   None   None   None  ...  6.487320e+09  6.487320e+09  7.257900e+09  6.855696e+09  6.855696e+09\n            ContentLiabilitiesNoncurrent                      None   None   None   None   None  ...  3.759026e+09           NaN  3.759026e+09  3.206051e+09  3.208164e+09\n            LongTermDebtNoncurrent                            None   None   None   None   None  ...  1.036006e+10  1.036006e+10  1.036006e+10  1.475926e+10  1.475926e+10\n            OtherLiabilitiesNoncurrent                        None   None   None   None   None  ...  1.292310e+08  1.292310e+08  1.292310e+08  1.444276e+09  1.710948e+09\n            Liabilities                                       None   None   None   None   None  ...  2.151557e+10  2.073564e+10  2.408021e+10  2.665062e+10  2.639356e+10\n            CommitmentsAndContingencies                       None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            CommonStockValue                                  None   None   None   None   None  ...  2.315988e+09  2.315988e+09  2.315988e+09  2.793929e+09  2.793929e+09\n            AccumulatedOtherComprehensiveIncomeLossNetOfTax   None   None   None   None   None  ... -1.958200e+07 -1.958200e+07 -1.958200e+07 -2.352100e+07 -3.407200e+07\n            RetainedEarningsAccumulatedDeficit                None   None   None   None   None  ...  3.288885e+09  2.942359e+09  4.224779e+09  5.520816e+09  4.811749e+09\n            StockholdersEquity                                None   None   None   None   None  ...  5.238765e+09  3.581956e+09  3.581956e+09  5.703058e+09  7.582157e+09\n            LiabilitiesAndStockholdersEquity                  None   None   None   None   None  ...  2.597440e+10  2.597440e+10  2.597440e+10  3.505991e+10  3.717528e+10\n            PreferredStockParOrStatedValuePerShare            None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            PreferredStockSharesAuthorized                    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            PreferredStockSharesIssued                        None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            PreferredStockSharesOutstanding                   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            PreferredStockValue                               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            ContentLibraryNetCurrent                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            PrepaidContentCurrent                             None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            ContentLibraryNetNoncurrent                       None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            DueToRelatedPartiesNoncurrent                     None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            AdditionalPaidInCapitalCommonStock                None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            ContractWithCustomerLiabilityCurrent              None   None   None   None   None  ...  8.086920e+08  7.608990e+08  9.155060e+08  9.247450e+08  1.029261e+09\n            ShortTermBorrowings                               None   None   None   None   None  ...           NaN           NaN           NaN  0.000000e+00  4.991610e+08\n            OtherPrepaidExpenseCurrent                        None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            ContentAccountsPayableCurrent                     None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            ContentAccountsPayableNoncurrent                  None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            SeniorLongTermNotes                               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            RelatedPartyTransactionDueFromToRelatedParty      None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            LicensingAssetCurrent                             None   None   None   None   None  ...  5.151186e+09           NaN  5.151186e+09           NaN           NaN\n\n            [46 rows x 44 columns] ,\n            \"cash \" :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2       2019q3        2019q4        2020q2        2020q3\n            NetIncomeLoss                                        None   None   None   None   None  ...  2.901240e+08  384349000.0  4.028350e+08  7.090670e+08  2.706500e+08\n            AdditionstoStreamingContentAssets                    None   None   None   None   None  ...  2.997746e+09          NaN  9.971141e+09  3.294275e+09  2.510782e+09\n            ChangeInStreamingContentLiabilities                  None   None   None   None   None  ... -1.469800e+07          NaN -9.554800e+07  2.589450e+08 -1.084320e+08\n            CostofServicesAmortizationofStreamingContentAssets   None   None   None   None   None  ...  2.124686e+09          NaN  1.911767e+09  2.483385e+09  4.356601e+09\n            CostofServicesAmortizationofDVDContentAssets         None   None   None   None   None  ...  8.509000e+06          NaN  2.281900e+07           NaN           NaN\n            ...                                                   ...    ...    ...    ...    ...  ...           ...          ...           ...           ...           ...\n            ProceedsFromSaleOfAvailableForSaleSecuritiesDebt     None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN\n            InterestPaidNet                                      None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN\n            ProceedsfromPublicOfferingofCommonStock              None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN\n            ExtinguishmentOfDebtAmount                           None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN\n            ForeignCurrencyTransactionLossBeforeTax              None   None   None   None   None  ...           NaN          NaN           NaN           NaN           NaN\n\n            [71 rows x 44 columns] ,\n            \"equity \" :                                                     2009q2 2009q3 2009q4 2010q1 2010q2  ...        2019q2        2019q3        2019q4        2020q2        2020q3\n            NetIncomeLoss                                        None   None   None   None   None  ...  3.440520e+08  6.147020e+08  1.279946e+09  3.440520e+08  2.706500e+08\n            OtherComprehensiveIncomeLossNetOfTaxPortionAttr...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodSharesStockOptionsExercised   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodValueStockOptionsExercised    None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodSharesConversionOfConver...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodValueConversionOfConvert...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            AdjustmentsToAdditionalPaidInCapitalSharebasedC...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            AdjustmentsToAdditionalPaidInCapitalTaxEffectFr...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockholdersEquity                                   None   None   None   None   None  ...  5.703058e+09  6.105548e+09  6.861505e+09  5.703058e+09  6.105548e+09\n            ComprehensiveIncomeNetOfTax                          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodValueEmployeeStockPurcha...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodValueNewIssues                None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockRepurchasedAndRetiredDuringPeriodValue          None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockRepurchasedAndRetiredDuringPeriodShares         None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            CumulativeEffectOfNewAccountingPrincipleInPerio...   None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n            StockIssuedDuringPeriodSharesNewIssues               None   None   None   None   None  ...           NaN           NaN           NaN           NaN           NaN\n\n            [16 rows x 44 columns] ,\n            \"prices \" :                    Open        High         Low       Close     Volume  Dividends  Stock Splits\n            Date                                                                                          \n            2002-05-23    1.156429    1.242857    1.145714    1.196429  104790000          0           0.0\n            2002-05-24    1.214286    1.225000    1.197143    1.210000   11104800          0           0.0\n            2002-05-28    1.213571    1.232143    1.157143    1.157143    6609400          0           0.0\n            2002-05-29    1.164286    1.164286    1.085714    1.103571    6757800          0           0.0\n            2002-05-30    1.107857    1.107857    1.071429    1.071429   10154200          0           0.0\n            ...                ...         ...         ...         ...        ...        ...           ...\n            2020-10-21  501.029999  506.850006  488.250000  489.049988   17405700          0           0.0\n            2020-10-22  494.690002  495.140015  482.000000  485.230011    6997900          0           0.0\n            2020-10-23  488.109985  490.059998  481.350006  488.279999    4927900          0           0.0\n            2020-10-26  487.029999  496.820007  478.899994  488.239990    6174200          0           0.0\n            2020-10-27  490.010010  490.000000  482.929993  488.929993    3547975          0           0.0\n\n            [4641 rows x 7 columns] ,\n        \"actions \" :              Dividends  Stock Splits\n            Date                               \n            2004-02-12        0.0           2.0\n            2015-07-15        0.0           7.0 \",\n        \"dividends \" : \" Series([], Name: Dividends, dtype: int64) \",\n        \"splits \" : \" Date\n            2004-02-12    2.0\n            2015-07-15    7.0\n            Name: Stock Splits, dtype: float64 \",\n        \"major_holders \" : \"         0                                      1\n            0   1.62%        % of Shares Held by All Insider\n            1  83.49%       % of Shares Held by Institutions\n            2  84.86%        % of Float Held by Institutions\n            3    1975  Number of Institutions Holding Shares \",\n            \"institutional_holders \" : \"                               Holder    Shares Date Reported   % Out        Value\n            0  Capital Research Global Investors  34111988    2020-06-29  0.0772  15522319019\n            1         Vanguard Group, Inc. (The)  34001284    2020-06-29  0.0770  15471944271\n            2                     Blackrock Inc.  29171135    2020-06-29  0.0660  13274033270\n            3                           FMR, LLC  22033243    2020-06-29  0.0499  10026006894\n            4      Price (T.Rowe) Associates Inc  20626346    2020-06-29  0.0467   9385812483\n            5           State Street Corporation  16613245    2020-06-29  0.0376   7559691004\n            6    Capital International Investors  15137030    2020-06-29  0.0343   6887954131\n            7            Capital World Investors  13676170    2020-06-29  0.0310   6223204396\n            8            Jennison Associates LLC   9099165    2020-06-29  0.0206   4140484041\n            9        Baillie Gifford and Company   7713485    2020-06-29  0.0175   3509944214 ,\n        \"events \" :                                      0                    1\n            Earnings Date     2021-01-19 00:00:00  2021-01-25 00:00:00\n            Earnings Average                 2.13                 2.13\n            Earnings Low                     1.82                 1.82\n            Earnings High                     2.3                  2.3\n            Revenue Average            6379370000           6379370000\n            Revenue Low                6281000000           6281000000\n            Revenue High               6593000000           6593000000 \",\n            \"recommendations \" : \"                                     0                    1\n            Earnings Date     2021-01-19 00:00:00  2021-01-25 00:00:00\n            Earnings Average                 2.13                 2.13\n            Earnings Low                     1.82                 1.82\n            Earnings High                     2.3                  2.3\n            Revenue Average            6379370000           6379370000\n            Revenue Low                6281000000           6281000000\n            Revenue High               6593000000           6593000000 \",\n            \"esg \" : \"                             Value\n            2020-10                          \n            palmOil                     False\n            controversialWeapons        False\n            gambling                    False\n            socialScore                  7.56\n            nuclear                     False\n            furLeather                  False\n            alcoholic                   False\n            gmo                         False\n            catholic                    False\n            socialPercentile             None\n            peerCount                      44\n            governanceScore             10.32\n            environmentPercentile        None\n            animalTesting               False\n            tobacco                     False\n            totalEsg                    18.05\n            highestControversy              2\n            esgPerformance         UNDER_PERF\n            coal                        False\n            pesticides                  False\n            adult                       False\n            percentile                   14.5\n            peerGroup                   Media\n            smallArms                   False\n            environmentScore             0.16\n            governancePercentile         None\n            militaryContract            False, \n        \"interest\":             NETFLIX INC isPartial\n            date                             \n            2015-11-22           57     False\n            2015-11-29           47     False\n            2015-12-06           45     False\n            2015-12-13           39     False\n            2015-12-20           32     False\n            ...                 ...       ...\n            2020-10-18           69     False\n            2020-10-25           57     False\n            2020-11-01           55     False\n            2020-11-08           63     False\n            2020-11-15           73      True\n\n            [261 rows x 2 columns]}\n    }\n\n\n#### Sub Functions\n\nThe previous request pulls all data about a given company. This is obviously resource intensive. If you would like to request some subset of the full request, we advise using subfunctions. The following is a list of all available subfunctions.\n\n    u.prices(cik_or_ticker)                                 # prices,volume, splits dataframe\n\n    u.dividends(cik_or_ticker)                              # dividend payouts dataframe\n\n    u.financial_statement(cik_or_ticker,kind=\"income\")      # income statement dataframe\n\n    u.financial_statement(cik_or_ticker,kind=\"balance\")     # balance sheet dataframe\n\n    u.financial_statement(cik_or_ticker,\"cash\")             # cashflow statement dataframe\n\n    u.major_sharholders(cik_or_ticker)                      # major shareholders dataframe\n\n    u.major_sharholders(cik_or_ticker)                      # major shareholders dataframe\n\n    u.institutional_holders(cik_or_ticker\")                 # institutional holders dataframe\n\n    u.events(cik_or_ticker)                                 # date of events dataframe\n\n    u.splits(cik_or_ticker)                                 # stock split events dataframe\n\n    u.recommendations(cik_or_ticker)                        # analyst recommendations dataframe\n\n    u.esg(cik_or_ticker)                                    # esg metrics dataframe\n\n    u.interest(name)                                        # google trends dataframe\n\n\n#### Example Use Case \n\nI really want to demonstrate the beauty of what we have here since this is often difficult when\nlooking at thousands of numeric datatables. Let's take a very naive peek by plotting various \ndataframes as timeseries. \n\nThe following is a start to finish example of how one might plot the financial statements and price \nseries of the first five companies in the universe.\n\nHere's how we'd implement that: \n\n    from equities import Universe\n    import matplotlib.pyplot as plt \n\n    u = Universe()\n\n    k,f,s = 'bar',(10,7),True\n    for cik in u.ciks[:5]:\n\n        c = u.company(cik)\n\n        income = c['income']\n        if not income.empty:\n            income.T.plot(\n            kind=k,\n            figsize=f,\n            stacked=s)\n\n        balance = c['balance']\n        if not balance.empty:\n            balance.T.plot(\n            kind=k,\n            figsize=f,\n            stacked=s) \n\n        cash = c['cash']\n        if not cash.empty:\n            cash.T.plot(\n            kind=k,\n            figsize=f,\n            stacked=s)\n\n        prices = c['prices']\n        if not prices.empty:\n            prices.drop('Volume',axis=1).plot(\n                kind='line',\n                figsize=f)\n\n        # Notice that the code above is expensive since we are interested in a few fields\n        # within the results \"c\", using sub functions would be much more efficient.\n\n    plt.show()\n\n## Donate: \n\nConsider buying me a coffee to fund the future development of this project.\n\n    bitcoin wallet address: 3LU5MEaAXRJoCo6vx67g1Jj7qDFRKhMs5t\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "equities aims to democratize access to public company data.",
    "version": "4.2.6",
    "split_keywords": [
        "sec",
        "stock",
        "stockmarket",
        "equities",
        "equity",
        "data",
        "financials",
        "financial",
        "company",
        "public",
        "companies",
        "xbrl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "5e744b2d93940d361cee9e6935159850",
                "sha256": "fb80bc2c7220de2a1aa365f4b3ff0824096aa649b5e52b4b512597b71145005c"
            },
            "downloads": -1,
            "filename": "equities-4.2.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e744b2d93940d361cee9e6935159850",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11489,
            "upload_time": "2020-12-01T01:19:56",
            "upload_time_iso_8601": "2020-12-01T01:19:56.309222Z",
            "url": "https://files.pythonhosted.org/packages/90/88/44f4057ad30bdf9e8b0a31d19b2d692bdf129293aa923a601d94c57a3bdb/equities-4.2.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "845fe77d6565c0b2170fddaeb6c0aa2c",
                "sha256": "afad35387bbd6798c95c2332c8b584bfdd977de1a84aed5224d86aa5b8b65565"
            },
            "downloads": -1,
            "filename": "equities-4.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "845fe77d6565c0b2170fddaeb6c0aa2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 24610,
            "upload_time": "2020-12-01T01:19:57",
            "upload_time_iso_8601": "2020-12-01T01:19:57.697073Z",
            "url": "https://files.pythonhosted.org/packages/ca/c3/f15c3d937123ac9c1945166c2ed8357c545d22aa1330b356a3dbc01188ae/equities-4.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-12-01 01:19:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "ljc-codes",
    "error": "Could not fetch GitHub repository",
    "lcname": "equities"
}
        
Elapsed time: 0.18664s