Valuation measures added features and new api response #334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The valuation measures API now includes a current option; it is no longer limited to quarterly statistics. This means a user can get more up-to-date information from the trailing twelve months. I added this functionality to the library and ways to toggle quarterly and yearly options, along with trailing options.
Original response for AAPL:
type: <class 'pandas.core.frame.DataFrame'>
columns: Index(['asOfDate', 'periodType', 'EnterpriseValue',
'EnterprisesValueEBITDARatio', 'EnterprisesValueRevenueRatio',
'ForwardPeRatio', 'MarketCap', 'PbRatio', 'PeRatio', 'PegRatio',
'PsRatio'],
dtype='object')
asOfDate periodType EnterpriseValue EnterprisesValueEBITDARatio EnterprisesValueRevenueRatio ForwardPeRatio MarketCap PbRatio PeRatio PegRatio PsRatio
symbol
AAPL 2024-06-10 TTM 2.998758e+12 22.5476 7.8579 26.2467 2.961318e+12 39.913172 30.034215 2.0439 7.905597
AAPL 2024-07-12 TTM 3.573939e+12 26.8723 9.3651 31.1526 3.536499e+12 47.665570 35.867807 2.4183 9.441114
AAPL 2024-09-19 TTM 3.519730e+12 26.0433 9.1279 30.1205 3.480227e+12 52.171058 34.840183 2.1968 9.210233
AAPL 2024-09-30 3M 3.561714e+12 26.3540 9.2367 30.6748 3.522211e+12 52.800431 35.464231 2.2362 9.375205
AAPL 2024-12-31 3M 3.807958e+12 28.2781 9.7382 33.6700 3.766500e+12 66.136960 41.187500 2.2897 9.867391
New response for AAPL:
type: <class 'pandas.core.frame.DataFrame'>
columns: Index(['asOfDate', 'periodType', 'EnterpriseValue',
'EnterprisesValueEBITDARatio', 'EnterprisesValueRevenueRatio',
'ForwardPeRatio', 'MarketCap', 'PbRatio', 'PeRatio', 'PegRatio',
'PsRatio'],
dtype='object')
asOfDate periodType EnterpriseValue EnterprisesValueEBITDARatio EnterprisesValueRevenueRatio ForwardPeRatio MarketCap PbRatio PeRatio PegRatio PsRatio
symbol
AAPL 2025-08-20 TTM 3.400403e+12 NaN 8.3216 NaN NaN 50.950578 NaN 2.0401 8.351520
AAPL 2025-09-30 12M 3.808041e+12 26.8747 9.3192 31.6456 3.761715e+12 57.142871 38.638847 2.4377 9.409086
AAPL 2025-10-02 TTM NaN 27.2572 9.4518 32.0513 NaN 57.966117 39.018209 2.4662 9.501466
AAPL 2025-10-03 TTM 3.862235e+12 NaN NaN NaN 3.815909e+12 NaN NaN NaN NaN
AAPL 2025-11-19 TTM 4.012297e+12 27.7192 9.6412 32.3625 3.968337e+12 53.820370 36.000000 2.7178 9.682939
As you can see, the original function was severely out of date.