wbfdm 2.2.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wbfdm might be problematic. Click here for more details.
- wbfdm/__init__.py +2 -0
- wbfdm/admin/__init__.py +42 -0
- wbfdm/admin/classifications.py +39 -0
- wbfdm/admin/esg.py +23 -0
- wbfdm/admin/exchanges.py +53 -0
- wbfdm/admin/instrument_lists.py +23 -0
- wbfdm/admin/instrument_prices.py +62 -0
- wbfdm/admin/instrument_requests.py +33 -0
- wbfdm/admin/instruments.py +117 -0
- wbfdm/admin/instruments_relationships.py +25 -0
- wbfdm/admin/options.py +101 -0
- wbfdm/analysis/__init__.py +2 -0
- wbfdm/analysis/esg/__init__.py +0 -0
- wbfdm/analysis/esg/enums.py +82 -0
- wbfdm/analysis/esg/esg_analysis.py +217 -0
- wbfdm/analysis/esg/utils.py +13 -0
- wbfdm/analysis/financial_analysis/__init__.py +1 -0
- wbfdm/analysis/financial_analysis/financial_metric_analysis.py +88 -0
- wbfdm/analysis/financial_analysis/financial_ratio_analysis.py +125 -0
- wbfdm/analysis/financial_analysis/financial_statistics_analysis.py +271 -0
- wbfdm/analysis/financial_analysis/statement_with_estimates.py +558 -0
- wbfdm/analysis/financial_analysis/utils.py +316 -0
- wbfdm/analysis/technical_analysis/__init__.py +1 -0
- wbfdm/analysis/technical_analysis/technical_analysis.py +138 -0
- wbfdm/analysis/technical_analysis/traces.py +165 -0
- wbfdm/analysis/utils.py +32 -0
- wbfdm/apps.py +14 -0
- wbfdm/contrib/__init__.py +0 -0
- wbfdm/contrib/dsws/__init__.py +0 -0
- wbfdm/contrib/dsws/client.py +285 -0
- wbfdm/contrib/internal/__init__.py +0 -0
- wbfdm/contrib/internal/dataloaders/__init__.py +0 -0
- wbfdm/contrib/internal/dataloaders/market_data.py +87 -0
- wbfdm/contrib/metric/__init__.py +0 -0
- wbfdm/contrib/metric/admin/__init__.py +2 -0
- wbfdm/contrib/metric/admin/instruments.py +12 -0
- wbfdm/contrib/metric/admin/metrics.py +43 -0
- wbfdm/contrib/metric/apps.py +10 -0
- wbfdm/contrib/metric/backends/__init__.py +2 -0
- wbfdm/contrib/metric/backends/base.py +159 -0
- wbfdm/contrib/metric/backends/performances.py +265 -0
- wbfdm/contrib/metric/backends/statistics.py +182 -0
- wbfdm/contrib/metric/decorators.py +14 -0
- wbfdm/contrib/metric/dispatch.py +23 -0
- wbfdm/contrib/metric/dto.py +88 -0
- wbfdm/contrib/metric/exceptions.py +6 -0
- wbfdm/contrib/metric/factories.py +33 -0
- wbfdm/contrib/metric/filters.py +28 -0
- wbfdm/contrib/metric/migrations/0001_initial.py +88 -0
- wbfdm/contrib/metric/migrations/0002_remove_instrumentmetric_unique_instrument_metric_and_more.py +26 -0
- wbfdm/contrib/metric/migrations/__init__.py +0 -0
- wbfdm/contrib/metric/models.py +180 -0
- wbfdm/contrib/metric/orchestrators.py +94 -0
- wbfdm/contrib/metric/registry.py +80 -0
- wbfdm/contrib/metric/serializers.py +44 -0
- wbfdm/contrib/metric/tasks.py +27 -0
- wbfdm/contrib/metric/tests/__init__.py +0 -0
- wbfdm/contrib/metric/tests/backends/__init__.py +0 -0
- wbfdm/contrib/metric/tests/backends/test_performances.py +152 -0
- wbfdm/contrib/metric/tests/backends/test_statistics.py +48 -0
- wbfdm/contrib/metric/tests/conftest.py +92 -0
- wbfdm/contrib/metric/tests/test_dto.py +73 -0
- wbfdm/contrib/metric/tests/test_models.py +72 -0
- wbfdm/contrib/metric/tests/test_tasks.py +24 -0
- wbfdm/contrib/metric/tests/test_viewsets.py +79 -0
- wbfdm/contrib/metric/urls.py +19 -0
- wbfdm/contrib/metric/viewsets/__init__.py +1 -0
- wbfdm/contrib/metric/viewsets/configs/__init__.py +1 -0
- wbfdm/contrib/metric/viewsets/configs/display.py +92 -0
- wbfdm/contrib/metric/viewsets/configs/menus.py +11 -0
- wbfdm/contrib/metric/viewsets/configs/utils.py +137 -0
- wbfdm/contrib/metric/viewsets/mixins.py +245 -0
- wbfdm/contrib/metric/viewsets/viewsets.py +40 -0
- wbfdm/contrib/msci/__init__.py +0 -0
- wbfdm/contrib/msci/client.py +92 -0
- wbfdm/contrib/msci/dataloaders/__init__.py +0 -0
- wbfdm/contrib/msci/dataloaders/esg.py +87 -0
- wbfdm/contrib/msci/dataloaders/esg_controversies.py +81 -0
- wbfdm/contrib/msci/sync.py +58 -0
- wbfdm/contrib/msci/tests/__init__.py +0 -0
- wbfdm/contrib/msci/tests/conftest.py +1 -0
- wbfdm/contrib/msci/tests/test_client.py +70 -0
- wbfdm/contrib/qa/__init__.py +0 -0
- wbfdm/contrib/qa/apps.py +22 -0
- wbfdm/contrib/qa/database_routers.py +25 -0
- wbfdm/contrib/qa/dataloaders/__init__.py +0 -0
- wbfdm/contrib/qa/dataloaders/adjustments.py +56 -0
- wbfdm/contrib/qa/dataloaders/corporate_actions.py +59 -0
- wbfdm/contrib/qa/dataloaders/financials.py +83 -0
- wbfdm/contrib/qa/dataloaders/market_data.py +117 -0
- wbfdm/contrib/qa/dataloaders/officers.py +59 -0
- wbfdm/contrib/qa/dataloaders/reporting_dates.py +67 -0
- wbfdm/contrib/qa/dataloaders/statements.py +267 -0
- wbfdm/contrib/qa/tasks.py +0 -0
- wbfdm/dataloaders/__init__.py +0 -0
- wbfdm/dataloaders/cache.py +129 -0
- wbfdm/dataloaders/protocols.py +112 -0
- wbfdm/dataloaders/proxies.py +201 -0
- wbfdm/dataloaders/types.py +209 -0
- wbfdm/dynamic_preferences_registry.py +45 -0
- wbfdm/enums.py +657 -0
- wbfdm/factories/__init__.py +13 -0
- wbfdm/factories/classifications.py +56 -0
- wbfdm/factories/controversies.py +27 -0
- wbfdm/factories/exchanges.py +21 -0
- wbfdm/factories/instrument_list.py +22 -0
- wbfdm/factories/instrument_prices.py +79 -0
- wbfdm/factories/instruments.py +63 -0
- wbfdm/factories/instruments_relationships.py +31 -0
- wbfdm/factories/options.py +66 -0
- wbfdm/figures/__init__.py +1 -0
- wbfdm/figures/financials/__init__.py +1 -0
- wbfdm/figures/financials/financial_analysis_charts.py +469 -0
- wbfdm/figures/financials/financials_charts.py +711 -0
- wbfdm/filters/__init__.py +31 -0
- wbfdm/filters/classifications.py +100 -0
- wbfdm/filters/exchanges.py +22 -0
- wbfdm/filters/financials.py +95 -0
- wbfdm/filters/financials_analysis.py +119 -0
- wbfdm/filters/instrument_prices.py +112 -0
- wbfdm/filters/instruments.py +198 -0
- wbfdm/filters/utils.py +44 -0
- wbfdm/import_export/__init__.py +0 -0
- wbfdm/import_export/backends/__init__.py +0 -0
- wbfdm/import_export/backends/cbinsights/__init__.py +2 -0
- wbfdm/import_export/backends/cbinsights/deals.py +44 -0
- wbfdm/import_export/backends/cbinsights/equities.py +41 -0
- wbfdm/import_export/backends/cbinsights/mixin.py +15 -0
- wbfdm/import_export/backends/cbinsights/utils/__init__.py +0 -0
- wbfdm/import_export/backends/cbinsights/utils/classifications.py +4150 -0
- wbfdm/import_export/backends/cbinsights/utils/client.py +217 -0
- wbfdm/import_export/backends/refinitiv/__init__.py +5 -0
- wbfdm/import_export/backends/refinitiv/daily_fundamental.py +36 -0
- wbfdm/import_export/backends/refinitiv/fiscal_period.py +63 -0
- wbfdm/import_export/backends/refinitiv/forecast.py +178 -0
- wbfdm/import_export/backends/refinitiv/fundamental.py +103 -0
- wbfdm/import_export/backends/refinitiv/geographic_segment.py +32 -0
- wbfdm/import_export/backends/refinitiv/instrument.py +55 -0
- wbfdm/import_export/backends/refinitiv/instrument_price.py +77 -0
- wbfdm/import_export/backends/refinitiv/mixin.py +29 -0
- wbfdm/import_export/backends/refinitiv/utils/__init__.py +1 -0
- wbfdm/import_export/backends/refinitiv/utils/controller.py +182 -0
- wbfdm/import_export/handlers/__init__.py +0 -0
- wbfdm/import_export/handlers/instrument.py +253 -0
- wbfdm/import_export/handlers/instrument_list.py +101 -0
- wbfdm/import_export/handlers/instrument_price.py +71 -0
- wbfdm/import_export/handlers/option.py +54 -0
- wbfdm/import_export/handlers/private_equities.py +49 -0
- wbfdm/import_export/parsers/__init__.py +0 -0
- wbfdm/import_export/parsers/cbinsights/__init__.py +0 -0
- wbfdm/import_export/parsers/cbinsights/deals.py +39 -0
- wbfdm/import_export/parsers/cbinsights/equities.py +56 -0
- wbfdm/import_export/parsers/cbinsights/fundamentals.py +45 -0
- wbfdm/import_export/parsers/refinitiv/__init__.py +0 -0
- wbfdm/import_export/parsers/refinitiv/daily_fundamental.py +7 -0
- wbfdm/import_export/parsers/refinitiv/forecast.py +7 -0
- wbfdm/import_export/parsers/refinitiv/fundamental.py +9 -0
- wbfdm/import_export/parsers/refinitiv/geographic_segment.py +7 -0
- wbfdm/import_export/parsers/refinitiv/instrument.py +75 -0
- wbfdm/import_export/parsers/refinitiv/instrument_price.py +26 -0
- wbfdm/import_export/parsers/refinitiv/utils.py +96 -0
- wbfdm/import_export/resources/__init__.py +0 -0
- wbfdm/import_export/resources/classification.py +23 -0
- wbfdm/import_export/resources/instrument_prices.py +33 -0
- wbfdm/import_export/resources/instruments.py +176 -0
- wbfdm/jinja2.py +7 -0
- wbfdm/management/__init__.py +30 -0
- wbfdm/menu.py +11 -0
- wbfdm/migrations/0001_initial.py +71 -0
- wbfdm/migrations/0002_rename_statements_instrumentlookup_financials_and_more.py +144 -0
- wbfdm/migrations/0003_instrument_estimate_backend_and_more.py +34 -0
- wbfdm/migrations/0004_rename_financials_instrumentlookup_statements_and_more.py +86 -0
- wbfdm/migrations/0005_instrument_corporate_action_backend.py +29 -0
- wbfdm/migrations/0006_instrument_officer_backend.py +29 -0
- wbfdm/migrations/0007_instrument_country_instrument_currency_and_more.py +117 -0
- wbfdm/migrations/0008_controversy.py +75 -0
- wbfdm/migrations/0009_alter_controversy_flag_alter_controversy_initiated_and_more.py +85 -0
- wbfdm/migrations/0010_classification_classificationgroup_deal_exchange_and_more.py +1299 -0
- wbfdm/migrations/0011_delete_instrumentlookup_instrument_corporate_actions_and_more.py +169 -0
- wbfdm/migrations/0012_instrumentprice_created_instrumentprice_modified.py +564 -0
- wbfdm/migrations/0013_instrument_is_investable_universe_and_more.py +199 -0
- wbfdm/migrations/0014_alter_controversy_instrument.py +22 -0
- wbfdm/migrations/0015_instrument_instrument_investible_index.py +16 -0
- wbfdm/migrations/0016_instrumenttype_name_repr.py +18 -0
- wbfdm/migrations/0017_instrument_instrument_security_index.py +16 -0
- wbfdm/migrations/0018_instrument_instrument_level_index.py +20 -0
- wbfdm/migrations/0019_alter_controversy_source.py +17 -0
- wbfdm/migrations/0020_optionaggregate_option_and_more.py +249 -0
- wbfdm/migrations/0021_delete_instrumentdailystatistics.py +15 -0
- wbfdm/migrations/0022_instrument_cusip_option_open_interest_20d_and_more.py +91 -0
- wbfdm/migrations/0023_instrument_unique_ric_instrument_unique_rmc_and_more.py +53 -0
- wbfdm/migrations/0024_option_open_interest_10d_option_volume_10d_and_more.py +36 -0
- wbfdm/migrations/0025_instrument_is_primary_and_more.py +29 -0
- wbfdm/migrations/0026_instrument_is_cash_equivalent.py +30 -0
- wbfdm/migrations/0027_remove_instrument_unique_ric_and_more.py +100 -0
- wbfdm/migrations/__init__.py +0 -0
- wbfdm/models/__init__.py +4 -0
- wbfdm/models/esg/__init__.py +1 -0
- wbfdm/models/esg/controversies.py +81 -0
- wbfdm/models/exchanges/__init__.py +1 -0
- wbfdm/models/exchanges/exchanges.py +223 -0
- wbfdm/models/fields.py +117 -0
- wbfdm/models/fk_fields.py +403 -0
- wbfdm/models/indicators.py +0 -0
- wbfdm/models/instruments/__init__.py +19 -0
- wbfdm/models/instruments/classifications.py +265 -0
- wbfdm/models/instruments/instrument_lists.py +120 -0
- wbfdm/models/instruments/instrument_prices.py +540 -0
- wbfdm/models/instruments/instrument_relationships.py +251 -0
- wbfdm/models/instruments/instrument_requests.py +196 -0
- wbfdm/models/instruments/instruments.py +991 -0
- wbfdm/models/instruments/llm/__init__.py +1 -0
- wbfdm/models/instruments/llm/create_instrument_news_relationships.py +78 -0
- wbfdm/models/instruments/mixin/__init__.py +0 -0
- wbfdm/models/instruments/mixin/financials_computed.py +804 -0
- wbfdm/models/instruments/mixin/financials_serializer_fields.py +1407 -0
- wbfdm/models/instruments/mixin/instruments.py +294 -0
- wbfdm/models/instruments/options.py +225 -0
- wbfdm/models/instruments/private_equities.py +59 -0
- wbfdm/models/instruments/querysets.py +73 -0
- wbfdm/models/instruments/utils.py +41 -0
- wbfdm/preferences.py +21 -0
- wbfdm/serializers/__init__.py +4 -0
- wbfdm/serializers/esg.py +36 -0
- wbfdm/serializers/exchanges.py +39 -0
- wbfdm/serializers/instruments/__init__.py +37 -0
- wbfdm/serializers/instruments/classifications.py +139 -0
- wbfdm/serializers/instruments/instrument_lists.py +61 -0
- wbfdm/serializers/instruments/instrument_prices.py +73 -0
- wbfdm/serializers/instruments/instrument_relationships.py +170 -0
- wbfdm/serializers/instruments/instrument_requests.py +61 -0
- wbfdm/serializers/instruments/instruments.py +274 -0
- wbfdm/serializers/instruments/mixins.py +104 -0
- wbfdm/serializers/officers.py +20 -0
- wbfdm/signals.py +7 -0
- wbfdm/sync/__init__.py +0 -0
- wbfdm/sync/abstract.py +31 -0
- wbfdm/sync/runner.py +22 -0
- wbfdm/tasks.py +69 -0
- wbfdm/tests/__init__.py +0 -0
- wbfdm/tests/analysis/__init__.py +0 -0
- wbfdm/tests/analysis/financial_analysis/__init__.py +0 -0
- wbfdm/tests/analysis/financial_analysis/test_statement_with_estimates.py +392 -0
- wbfdm/tests/analysis/financial_analysis/test_utils.py +322 -0
- wbfdm/tests/analysis/test_esg.py +159 -0
- wbfdm/tests/conftest.py +92 -0
- wbfdm/tests/dataloaders/__init__.py +0 -0
- wbfdm/tests/dataloaders/test_cache.py +73 -0
- wbfdm/tests/models/__init__.py +0 -0
- wbfdm/tests/models/test_classifications.py +99 -0
- wbfdm/tests/models/test_exchanges.py +7 -0
- wbfdm/tests/models/test_instrument_list.py +117 -0
- wbfdm/tests/models/test_instrument_prices.py +306 -0
- wbfdm/tests/models/test_instruments.py +202 -0
- wbfdm/tests/models/test_merge.py +99 -0
- wbfdm/tests/models/test_options.py +69 -0
- wbfdm/tests/test_tasks.py +6 -0
- wbfdm/tests/tests.py +10 -0
- wbfdm/urls.py +222 -0
- wbfdm/utils.py +54 -0
- wbfdm/viewsets/__init__.py +10 -0
- wbfdm/viewsets/configs/__init__.py +5 -0
- wbfdm/viewsets/configs/buttons/__init__.py +8 -0
- wbfdm/viewsets/configs/buttons/classifications.py +23 -0
- wbfdm/viewsets/configs/buttons/exchanges.py +9 -0
- wbfdm/viewsets/configs/buttons/instrument_prices.py +49 -0
- wbfdm/viewsets/configs/buttons/instruments.py +283 -0
- wbfdm/viewsets/configs/display/__init__.py +22 -0
- wbfdm/viewsets/configs/display/classifications.py +138 -0
- wbfdm/viewsets/configs/display/esg.py +75 -0
- wbfdm/viewsets/configs/display/exchanges.py +42 -0
- wbfdm/viewsets/configs/display/instrument_lists.py +137 -0
- wbfdm/viewsets/configs/display/instrument_prices.py +199 -0
- wbfdm/viewsets/configs/display/instrument_requests.py +116 -0
- wbfdm/viewsets/configs/display/instruments.py +618 -0
- wbfdm/viewsets/configs/display/instruments_relationships.py +65 -0
- wbfdm/viewsets/configs/display/monthly_performances.py +72 -0
- wbfdm/viewsets/configs/display/officers.py +16 -0
- wbfdm/viewsets/configs/display/prices.py +21 -0
- wbfdm/viewsets/configs/display/statement_with_estimates.py +101 -0
- wbfdm/viewsets/configs/display/statements.py +48 -0
- wbfdm/viewsets/configs/endpoints/__init__.py +41 -0
- wbfdm/viewsets/configs/endpoints/classifications.py +87 -0
- wbfdm/viewsets/configs/endpoints/esg.py +20 -0
- wbfdm/viewsets/configs/endpoints/exchanges.py +6 -0
- wbfdm/viewsets/configs/endpoints/financials_analysis.py +65 -0
- wbfdm/viewsets/configs/endpoints/instrument_lists.py +38 -0
- wbfdm/viewsets/configs/endpoints/instrument_prices.py +51 -0
- wbfdm/viewsets/configs/endpoints/instrument_requests.py +20 -0
- wbfdm/viewsets/configs/endpoints/instruments.py +13 -0
- wbfdm/viewsets/configs/endpoints/instruments_relationships.py +31 -0
- wbfdm/viewsets/configs/endpoints/statements.py +6 -0
- wbfdm/viewsets/configs/menus/__init__.py +9 -0
- wbfdm/viewsets/configs/menus/classifications.py +19 -0
- wbfdm/viewsets/configs/menus/exchanges.py +10 -0
- wbfdm/viewsets/configs/menus/instrument_lists.py +10 -0
- wbfdm/viewsets/configs/menus/instruments.py +20 -0
- wbfdm/viewsets/configs/menus/instruments_relationships.py +33 -0
- wbfdm/viewsets/configs/titles/__init__.py +42 -0
- wbfdm/viewsets/configs/titles/classifications.py +79 -0
- wbfdm/viewsets/configs/titles/esg.py +11 -0
- wbfdm/viewsets/configs/titles/exchanges.py +12 -0
- wbfdm/viewsets/configs/titles/financial_ratio_analysis.py +6 -0
- wbfdm/viewsets/configs/titles/financials_analysis.py +50 -0
- wbfdm/viewsets/configs/titles/instrument_prices.py +50 -0
- wbfdm/viewsets/configs/titles/instrument_requests.py +16 -0
- wbfdm/viewsets/configs/titles/instruments.py +31 -0
- wbfdm/viewsets/configs/titles/instruments_relationships.py +21 -0
- wbfdm/viewsets/configs/titles/market_data.py +13 -0
- wbfdm/viewsets/configs/titles/prices.py +15 -0
- wbfdm/viewsets/configs/titles/statement_with_estimates.py +10 -0
- wbfdm/viewsets/esg.py +72 -0
- wbfdm/viewsets/exchanges.py +63 -0
- wbfdm/viewsets/financial_analysis/__init__.py +3 -0
- wbfdm/viewsets/financial_analysis/financial_metric_analysis.py +85 -0
- wbfdm/viewsets/financial_analysis/financial_ratio_analysis.py +85 -0
- wbfdm/viewsets/financial_analysis/statement_with_estimates.py +145 -0
- wbfdm/viewsets/instruments/__init__.py +80 -0
- wbfdm/viewsets/instruments/classifications.py +279 -0
- wbfdm/viewsets/instruments/financials_analysis.py +614 -0
- wbfdm/viewsets/instruments/instrument_lists.py +77 -0
- wbfdm/viewsets/instruments/instrument_prices.py +542 -0
- wbfdm/viewsets/instruments/instrument_requests.py +51 -0
- wbfdm/viewsets/instruments/instruments.py +106 -0
- wbfdm/viewsets/instruments/instruments_relationships.py +235 -0
- wbfdm/viewsets/instruments/utils.py +27 -0
- wbfdm/viewsets/market_data.py +172 -0
- wbfdm/viewsets/mixins.py +9 -0
- wbfdm/viewsets/officers.py +27 -0
- wbfdm/viewsets/prices.py +62 -0
- wbfdm/viewsets/statements/__init__.py +1 -0
- wbfdm/viewsets/statements/statements.py +100 -0
- wbfdm/viewsets/technical_analysis/__init__.py +1 -0
- wbfdm/viewsets/technical_analysis/monthly_performances.py +93 -0
- wbfdm-2.2.1.dist-info/METADATA +15 -0
- wbfdm-2.2.1.dist-info/RECORD +337 -0
- wbfdm-2.2.1.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
from wbfdm.enums import CalendarType, Financial, MarketData
|
|
3
|
+
from wbfdm.models import Instrument
|
|
4
|
+
|
|
5
|
+
from .utils import FinancialAnalysisResult, Loader
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StatementWithEstimates:
|
|
9
|
+
"""
|
|
10
|
+
Utility class to hold all the potentials statement with estimates table as self contained properties
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, instrument: Instrument, calendar_type: CalendarType = CalendarType.FISCAL):
|
|
14
|
+
self.instrument = instrument
|
|
15
|
+
self.calendar_type = calendar_type
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def credit_with_estimates(self) -> FinancialAnalysisResult:
|
|
19
|
+
values = [
|
|
20
|
+
Financial.NET_DEBT,
|
|
21
|
+
Financial.EBITDA,
|
|
22
|
+
Financial.TOTAL_DEBT,
|
|
23
|
+
Financial.FREE_CASH_FLOW,
|
|
24
|
+
Financial.CASH_FLOW_FROM_OPERATIONS,
|
|
25
|
+
]
|
|
26
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
27
|
+
df = loader.load()
|
|
28
|
+
|
|
29
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
30
|
+
|
|
31
|
+
df["net_debt_ebitda_ratio"] = df.get(Financial.NET_DEBT.value, empty_series) / df.get(
|
|
32
|
+
Financial.EBITDA.value, empty_series
|
|
33
|
+
)
|
|
34
|
+
df["total_debt_ebitda_ratio"] = df.get(Financial.TOTAL_DEBT.value, empty_series) / df.get(
|
|
35
|
+
Financial.EBITDA.value, empty_series
|
|
36
|
+
)
|
|
37
|
+
df["fcf_total_debt_ratio"] = df.get(Financial.FREE_CASH_FLOW.value, empty_series) / df.get(
|
|
38
|
+
Financial.TOTAL_DEBT.value, empty_series
|
|
39
|
+
)
|
|
40
|
+
df["cfo_total_debt_ratio"] = df.get(Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series) / df.get(
|
|
41
|
+
Financial.TOTAL_DEBT.value, empty_series
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
45
|
+
|
|
46
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def long_term_solvency_with_estimates(self) -> FinancialAnalysisResult:
|
|
50
|
+
values = [
|
|
51
|
+
Financial.TOTAL_DEBT,
|
|
52
|
+
Financial.SHAREHOLDERS_EQUITY,
|
|
53
|
+
Financial.WORKING_CAPITAL,
|
|
54
|
+
]
|
|
55
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
56
|
+
df = loader.load()
|
|
57
|
+
|
|
58
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
59
|
+
|
|
60
|
+
df["total_debt_equity_ratio"] = df.get(Financial.TOTAL_DEBT.value, empty_series) / df.get(
|
|
61
|
+
Financial.SHAREHOLDERS_EQUITY.value, empty_series
|
|
62
|
+
)
|
|
63
|
+
df["total_debt_capital_ratio"] = df.get(Financial.TOTAL_DEBT.value, empty_series) / df.get(
|
|
64
|
+
Financial.WORKING_CAPITAL.value, empty_series
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
68
|
+
|
|
69
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def short_term_liquidity_with_estimates(self) -> FinancialAnalysisResult:
|
|
73
|
+
values = [
|
|
74
|
+
Financial.CURRENT_ASSETS,
|
|
75
|
+
Financial.CURRENT_LIABILITIES,
|
|
76
|
+
# Financial.INVENTORY, --> Needed for the quick ratio
|
|
77
|
+
Financial.CASH_FLOW_FROM_OPERATIONS,
|
|
78
|
+
]
|
|
79
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
80
|
+
df = loader.load()
|
|
81
|
+
|
|
82
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
83
|
+
|
|
84
|
+
df["current_ratio"] = df.get(Financial.CURRENT_ASSETS.value, empty_series) / df.get(
|
|
85
|
+
Financial.CURRENT_LIABILITIES.value, empty_series
|
|
86
|
+
)
|
|
87
|
+
df["cash_from_operation_current_liabilities_ratio"] = df.get(
|
|
88
|
+
Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series
|
|
89
|
+
) / df.get(Financial.CURRENT_LIABILITIES.value, empty_series)
|
|
90
|
+
# df["Cash Flow Margin (%)"] = (df["Inventory"] / df["Cost of goods sold"]) # Inventory does not exist
|
|
91
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
92
|
+
|
|
93
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def asset_turnover_with_estimates(self) -> FinancialAnalysisResult:
|
|
97
|
+
values = [
|
|
98
|
+
Financial.REVENUE,
|
|
99
|
+
Financial.TOTAL_ASSETS,
|
|
100
|
+
Financial.COST_OF_GOODS_SOLD,
|
|
101
|
+
# Financial.INVENTORY,
|
|
102
|
+
]
|
|
103
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
104
|
+
df = loader.load()
|
|
105
|
+
|
|
106
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
107
|
+
|
|
108
|
+
df["asset_turnover"] = df.get(Financial.TOTAL_ASSETS.value, empty_series) / df.get(
|
|
109
|
+
Financial.REVENUE.value, empty_series
|
|
110
|
+
)
|
|
111
|
+
# df["Cash Flow Margin (%)"] = (df["Inventory"] / df["Cost of goods sold"]) # Inventory does not exist
|
|
112
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
113
|
+
|
|
114
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def cashflow_ratios_with_estimates(self) -> FinancialAnalysisResult:
|
|
118
|
+
values = [
|
|
119
|
+
Financial.CASH_FLOW_FROM_OPERATIONS,
|
|
120
|
+
Financial.CURRENT_LIABILITIES,
|
|
121
|
+
Financial.REVENUE,
|
|
122
|
+
Financial.TOTAL_ASSETS,
|
|
123
|
+
Financial.TOTAL_DEBT,
|
|
124
|
+
]
|
|
125
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
126
|
+
df = loader.load()
|
|
127
|
+
|
|
128
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
129
|
+
|
|
130
|
+
df["current_liability_coverage_ratio"] = df.get(
|
|
131
|
+
Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series
|
|
132
|
+
) / df.get(Financial.CURRENT_LIABILITIES.value, empty_series)
|
|
133
|
+
df["cash_flow_margin"] = (
|
|
134
|
+
df.get(Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series)
|
|
135
|
+
/ df.get(Financial.REVENUE.value, empty_series)
|
|
136
|
+
) * 100
|
|
137
|
+
df["asset_efficiency_margin"] = (
|
|
138
|
+
df.get(Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series)
|
|
139
|
+
/ df.get(Financial.TOTAL_ASSETS.value, empty_series)
|
|
140
|
+
) * 100
|
|
141
|
+
df["net_debt_coverage_ratio"] = df.get(Financial.CASH_FLOW_FROM_OPERATIONS.value, empty_series) / df.get(
|
|
142
|
+
Financial.TOTAL_DEBT.value, empty_series
|
|
143
|
+
)
|
|
144
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
145
|
+
|
|
146
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def margins_with_estimates(self) -> FinancialAnalysisResult:
|
|
150
|
+
values = [
|
|
151
|
+
Financial.REVENUE,
|
|
152
|
+
Financial.GROSS_PROFIT,
|
|
153
|
+
Financial.SGA_EXPENSES,
|
|
154
|
+
Financial.EBITDA,
|
|
155
|
+
Financial.EBIT,
|
|
156
|
+
Financial.NET_INCOME,
|
|
157
|
+
Financial.FREE_CASH_FLOW,
|
|
158
|
+
]
|
|
159
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
160
|
+
df = loader.load()
|
|
161
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
162
|
+
|
|
163
|
+
df["gross_margin"] = (
|
|
164
|
+
df.get(Financial.GROSS_PROFIT.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
165
|
+
) * 100
|
|
166
|
+
df["sga_margin"] = (
|
|
167
|
+
df.get(Financial.SGA_EXPENSES.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
168
|
+
) * 100
|
|
169
|
+
df["ebitda_margin"] = (
|
|
170
|
+
df.get(Financial.EBITDA.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
171
|
+
) * 100
|
|
172
|
+
df["ebit_margin"] = (
|
|
173
|
+
df.get(Financial.EBIT.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
174
|
+
) * 100
|
|
175
|
+
df["net_income_margin"] = (
|
|
176
|
+
df.get(Financial.NET_INCOME.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
177
|
+
) * 100
|
|
178
|
+
df["free_cash_flow_margin"] = (
|
|
179
|
+
df.get(Financial.FREE_CASH_FLOW.value, empty_series) / df.get(Financial.REVENUE.value, empty_series)
|
|
180
|
+
) * 100
|
|
181
|
+
df.drop(columns=list(map(lambda x: x.value, values)), inplace=True, errors="ignore")
|
|
182
|
+
|
|
183
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
184
|
+
|
|
185
|
+
@property
|
|
186
|
+
def summary_with_estimate(self) -> FinancialAnalysisResult:
|
|
187
|
+
values = [
|
|
188
|
+
Financial.REVENUE,
|
|
189
|
+
Financial.GROSS_PROFIT,
|
|
190
|
+
Financial.GROSS_PROFIT_MARGIN,
|
|
191
|
+
Financial.NET_INCOME_REPORTED,
|
|
192
|
+
Financial.EPS_REPORTED,
|
|
193
|
+
Financial.EPS,
|
|
194
|
+
Financial.EBITDA,
|
|
195
|
+
Financial.EBIT,
|
|
196
|
+
Financial.CASH_FLOW_PER_SHARE,
|
|
197
|
+
Financial.BOOK_VALUE_PER_SHARE,
|
|
198
|
+
Financial.CAPEX,
|
|
199
|
+
Financial.SHARES_OUTSTANDING,
|
|
200
|
+
Financial.TOTAL_ASSETS,
|
|
201
|
+
Financial.CURRENT_LIABILITIES,
|
|
202
|
+
Financial.ENTERPRISE_VALUE,
|
|
203
|
+
Financial.CASH_EQUIVALENTS,
|
|
204
|
+
]
|
|
205
|
+
market_data_values = [
|
|
206
|
+
MarketData.CLOSE,
|
|
207
|
+
MarketData.MARKET_CAPITALIZATION,
|
|
208
|
+
]
|
|
209
|
+
statement_values = [
|
|
210
|
+
Financial.EMPLOYEES,
|
|
211
|
+
Financial.CASH_AND_SHORT_TERM_INVESTMENT,
|
|
212
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES,
|
|
213
|
+
Financial.TOTAL_DEBT,
|
|
214
|
+
Financial.NET_DEBT,
|
|
215
|
+
Financial.STOCK_COMPENSATION,
|
|
216
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE,
|
|
217
|
+
]
|
|
218
|
+
loader = Loader(
|
|
219
|
+
self.instrument,
|
|
220
|
+
values,
|
|
221
|
+
calendar_type=self.calendar_type,
|
|
222
|
+
market_data_values=market_data_values,
|
|
223
|
+
statement_values=statement_values,
|
|
224
|
+
)
|
|
225
|
+
df = loader.load()
|
|
226
|
+
empty_series = pd.Series(dtype="float64", index=df.index)
|
|
227
|
+
|
|
228
|
+
if not df.empty:
|
|
229
|
+
df[Financial.ENTERPRISE_VALUE.value] = (
|
|
230
|
+
df.get(MarketData.MARKET_CAPITALIZATION.value, empty_series)
|
|
231
|
+
+ df.get(Financial.NET_DEBT.value, empty_series)
|
|
232
|
+
- df.get(Financial.CASH_EQUIVALENTS, empty_series)
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
# Calculate a couple of variables
|
|
236
|
+
yearly_df = df.loc[(slice(None), "Y", slice(None), slice(None)), :]
|
|
237
|
+
yearly_empty_series = pd.Series(dtype="float64", index=yearly_df.index)
|
|
238
|
+
|
|
239
|
+
quarterly_df = df.loc[
|
|
240
|
+
(
|
|
241
|
+
slice(None),
|
|
242
|
+
df.index.isin(["Q1", "Q2", "Q3", "Q4", "S1", "S2", "T1", "T2", "T3"], level=1),
|
|
243
|
+
slice(None),
|
|
244
|
+
slice(None),
|
|
245
|
+
),
|
|
246
|
+
:,
|
|
247
|
+
].sort_values(by="period_end_date")
|
|
248
|
+
quarterly_empty_series = pd.Series(dtype="float64", index=quarterly_df.index)
|
|
249
|
+
|
|
250
|
+
df["price_sales_ratio"] = pd.concat(
|
|
251
|
+
[
|
|
252
|
+
yearly_df.get(MarketData.MARKET_CAPITALIZATION.value, yearly_empty_series)
|
|
253
|
+
/ yearly_df.get(Financial.GROSS_PROFIT.value, yearly_empty_series),
|
|
254
|
+
quarterly_df.get(MarketData.MARKET_CAPITALIZATION.value, quarterly_empty_series)
|
|
255
|
+
/ quarterly_df.get(Financial.REVENUE.value, quarterly_empty_series)
|
|
256
|
+
.rolling(4, min_periods=1)
|
|
257
|
+
.sum(),
|
|
258
|
+
],
|
|
259
|
+
axis=0,
|
|
260
|
+
)
|
|
261
|
+
df["price_earning_reported_ratio"] = pd.concat(
|
|
262
|
+
[
|
|
263
|
+
yearly_df.get(MarketData.CLOSE.value, yearly_empty_series)
|
|
264
|
+
/ yearly_df.get(Financial.EPS_REPORTED.value, yearly_empty_series),
|
|
265
|
+
quarterly_df.get(MarketData.CLOSE.value, quarterly_empty_series)
|
|
266
|
+
/ quarterly_df.get(Financial.EPS_REPORTED.value, quarterly_empty_series)
|
|
267
|
+
.rolling(4, min_periods=1)
|
|
268
|
+
.sum(),
|
|
269
|
+
],
|
|
270
|
+
axis=0,
|
|
271
|
+
)
|
|
272
|
+
df["price_earning_ratio"] = pd.concat(
|
|
273
|
+
[
|
|
274
|
+
yearly_df.get(MarketData.CLOSE.value, yearly_empty_series)
|
|
275
|
+
/ yearly_df.get(Financial.EPS.value, yearly_empty_series),
|
|
276
|
+
quarterly_df.get(MarketData.CLOSE.value, quarterly_empty_series)
|
|
277
|
+
/ quarterly_df.get(Financial.EPS.value, quarterly_empty_series).rolling(4, min_periods=1).sum(),
|
|
278
|
+
],
|
|
279
|
+
axis=0,
|
|
280
|
+
)
|
|
281
|
+
df["ev_ebitda_ratio"] = pd.concat(
|
|
282
|
+
[
|
|
283
|
+
yearly_df.get(Financial.ENTERPRISE_VALUE.value, yearly_empty_series)
|
|
284
|
+
/ yearly_df.get(Financial.EBITDA.value, yearly_empty_series),
|
|
285
|
+
quarterly_df.get(Financial.ENTERPRISE_VALUE.value, quarterly_empty_series)
|
|
286
|
+
/ quarterly_df.get(Financial.EBITDA.value, quarterly_empty_series).rolling(4, min_periods=1).sum(),
|
|
287
|
+
],
|
|
288
|
+
axis=0,
|
|
289
|
+
)
|
|
290
|
+
df["ev_ebit_ratio"] = pd.concat(
|
|
291
|
+
[
|
|
292
|
+
yearly_df.get(Financial.ENTERPRISE_VALUE.value, yearly_empty_series)
|
|
293
|
+
/ yearly_df.get(Financial.EBIT.value, yearly_empty_series),
|
|
294
|
+
quarterly_df.get(Financial.ENTERPRISE_VALUE.value, quarterly_empty_series)
|
|
295
|
+
/ quarterly_df.get(Financial.EBIT.value, quarterly_empty_series).rolling(4, min_periods=1).sum(),
|
|
296
|
+
],
|
|
297
|
+
axis=0,
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
df["ebitda_margin"] = (
|
|
301
|
+
df.get(Financial.EBITDA.value, empty_series) / df.get(Financial.REVENUE.value, empty_series) * 100
|
|
302
|
+
)
|
|
303
|
+
df["ebit_margin"] = (
|
|
304
|
+
df.get(Financial.EBIT.value, empty_series) / df.get(Financial.REVENUE.value, empty_series) * 100
|
|
305
|
+
)
|
|
306
|
+
df["net_income_margin"] = (
|
|
307
|
+
df.get(Financial.NET_INCOME_REPORTED, empty_series)
|
|
308
|
+
/ df.get(Financial.REVENUE.value, empty_series)
|
|
309
|
+
* 100
|
|
310
|
+
)
|
|
311
|
+
# df["price_to_cash_flow_ratio"] = df.get(MarketData.CLOSE.value, empty_series) / df.get(Financial.CASH_FLOW_PER_SHARE.value, empty_series)
|
|
312
|
+
df["price_to_cash_flow_ratio"] = pd.concat(
|
|
313
|
+
[
|
|
314
|
+
yearly_df.get(MarketData.CLOSE.value, yearly_empty_series)
|
|
315
|
+
/ yearly_df.get(Financial.CASH_FLOW_PER_SHARE.value, yearly_empty_series),
|
|
316
|
+
quarterly_df.get(MarketData.CLOSE.value, quarterly_empty_series)
|
|
317
|
+
/ quarterly_df.get(Financial.CASH_FLOW_PER_SHARE.value, quarterly_empty_series)
|
|
318
|
+
.rolling(4, min_periods=1)
|
|
319
|
+
.sum(),
|
|
320
|
+
],
|
|
321
|
+
axis=0,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
df["price_to_book_ratio"] = df.get(MarketData.CLOSE.value, empty_series) / df.get(
|
|
325
|
+
Financial.BOOK_VALUE_PER_SHARE.value, empty_series
|
|
326
|
+
)
|
|
327
|
+
df["roce"] = pd.concat(
|
|
328
|
+
[
|
|
329
|
+
yearly_df.get(Financial.EBIT.value, yearly_empty_series)
|
|
330
|
+
/ (
|
|
331
|
+
yearly_df.get(Financial.TOTAL_ASSETS.value, yearly_empty_series)
|
|
332
|
+
- yearly_df.get(Financial.CURRENT_LIABILITIES.value, yearly_empty_series)
|
|
333
|
+
)
|
|
334
|
+
* 100,
|
|
335
|
+
quarterly_df.get(Financial.EBIT.value, quarterly_empty_series).rolling(4, min_periods=1).sum()
|
|
336
|
+
/ (
|
|
337
|
+
(
|
|
338
|
+
quarterly_df.get(Financial.TOTAL_ASSETS.value, quarterly_empty_series)
|
|
339
|
+
- quarterly_df.get(Financial.CURRENT_LIABILITIES.value, quarterly_empty_series)
|
|
340
|
+
)
|
|
341
|
+
)
|
|
342
|
+
* 100,
|
|
343
|
+
],
|
|
344
|
+
axis=0,
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
df["price_to_tangible_bv_ratio"] = df.get(MarketData.CLOSE.value, empty_series) / df.get(
|
|
348
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE, empty_series
|
|
349
|
+
)
|
|
350
|
+
df["cash_shares_ratio"] = df.get(Financial.CASH_AND_SHORT_TERM_INVESTMENT.value, empty_series) / df.get(
|
|
351
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES.value, empty_series
|
|
352
|
+
)
|
|
353
|
+
df["total_debt_shares_ratio"] = df.get(Financial.TOTAL_DEBT.value, empty_series) / df.get(
|
|
354
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES.value, empty_series
|
|
355
|
+
)
|
|
356
|
+
df["net_debt_shares_ratio"] = df.get(Financial.NET_DEBT.value, empty_series) / df.get(
|
|
357
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES.value, empty_series
|
|
358
|
+
)
|
|
359
|
+
df["stock_compensation_employee_ratio"] = df.get(
|
|
360
|
+
Financial.STOCK_COMPENSATION.value, empty_series
|
|
361
|
+
) / df.get(Financial.EMPLOYEES.value, empty_series)
|
|
362
|
+
|
|
363
|
+
df["net_cash"] = df.get(Financial.CASH_EQUIVALENTS, empty_series) - df.get(
|
|
364
|
+
Financial.CURRENT_LIABILITIES.value, empty_series
|
|
365
|
+
)
|
|
366
|
+
df[Financial.EBIT.value] = df.get(Financial.EBIT.value, empty_series)
|
|
367
|
+
|
|
368
|
+
return FinancialAnalysisResult(
|
|
369
|
+
df,
|
|
370
|
+
ordering=[
|
|
371
|
+
Financial.REVENUE.value,
|
|
372
|
+
"price_sales_ratio",
|
|
373
|
+
Financial.GROSS_PROFIT.value,
|
|
374
|
+
Financial.GROSS_PROFIT_MARGIN.value,
|
|
375
|
+
Financial.NET_INCOME_REPORTED.value,
|
|
376
|
+
"net_income_margin",
|
|
377
|
+
Financial.EPS_REPORTED.value,
|
|
378
|
+
"price_earning_reported_ratio",
|
|
379
|
+
Financial.EPS.value,
|
|
380
|
+
"price_earning_ratio",
|
|
381
|
+
Financial.EBITDA.value,
|
|
382
|
+
"ebitda_margin",
|
|
383
|
+
"ev_ebitda_ratio",
|
|
384
|
+
Financial.EBIT.value,
|
|
385
|
+
"ebit_margin",
|
|
386
|
+
"ev_ebit_ratio",
|
|
387
|
+
Financial.TOTAL_ASSETS.value,
|
|
388
|
+
Financial.CURRENT_LIABILITIES.value,
|
|
389
|
+
"roce",
|
|
390
|
+
Financial.CASH_FLOW_PER_SHARE.value,
|
|
391
|
+
"price_to_cash_flow_ratio",
|
|
392
|
+
Financial.BOOK_VALUE_PER_SHARE.value,
|
|
393
|
+
"price_to_book_ratio",
|
|
394
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE.value,
|
|
395
|
+
"price_to_tangible_bv_ratio",
|
|
396
|
+
Financial.CASH_AND_SHORT_TERM_INVESTMENT.value,
|
|
397
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES.value,
|
|
398
|
+
"cash_shares_ratio",
|
|
399
|
+
Financial.TOTAL_DEBT.value,
|
|
400
|
+
"total_debt_shares_ratio",
|
|
401
|
+
Financial.NET_DEBT.value,
|
|
402
|
+
"net_debt_shares_ratio",
|
|
403
|
+
Financial.STOCK_COMPENSATION.value,
|
|
404
|
+
Financial.EMPLOYEES.value,
|
|
405
|
+
"stock_compensation_employee_ratio",
|
|
406
|
+
Financial.CAPEX.value,
|
|
407
|
+
Financial.SHARES_OUTSTANDING.value,
|
|
408
|
+
MarketData.MARKET_CAPITALIZATION.value,
|
|
409
|
+
MarketData.CLOSE.value,
|
|
410
|
+
MarketData.MARKET_CAPITALIZATION.value,
|
|
411
|
+
"net_cash",
|
|
412
|
+
],
|
|
413
|
+
ignore_group_keys=[
|
|
414
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE.value,
|
|
415
|
+
Financial.NET_DEBT.value,
|
|
416
|
+
Financial.EMPLOYEES.value,
|
|
417
|
+
Financial.CASH_AND_SHORT_TERM_INVESTMENT.value,
|
|
418
|
+
Financial.DILUTED_WEIGHTED_AVG_SHARES.value,
|
|
419
|
+
Financial.STOCK_COMPENSATION.value,
|
|
420
|
+
Financial.TOTAL_DEBT.value,
|
|
421
|
+
],
|
|
422
|
+
override_number_with_currency=self.instrument.currency.symbol or self.instrument.currency.key,
|
|
423
|
+
override_number_with_currency_financials=[
|
|
424
|
+
Financial.REVENUE.value,
|
|
425
|
+
Financial.GROSS_PROFIT.value,
|
|
426
|
+
Financial.NET_INCOME_REPORTED.value,
|
|
427
|
+
Financial.EPS.value,
|
|
428
|
+
Financial.EPS_REPORTED.value,
|
|
429
|
+
Financial.EBITDA.value,
|
|
430
|
+
Financial.EBIT.value,
|
|
431
|
+
Financial.TOTAL_ASSETS.value,
|
|
432
|
+
Financial.CURRENT_LIABILITIES.value,
|
|
433
|
+
Financial.TOTAL_DEBT.value,
|
|
434
|
+
Financial.NET_DEBT.value,
|
|
435
|
+
Financial.STOCK_COMPENSATION.value,
|
|
436
|
+
Financial.CAPEX.value,
|
|
437
|
+
MarketData.CLOSE.value,
|
|
438
|
+
MarketData.MARKET_CAPITALIZATION.value,
|
|
439
|
+
Financial.CASH_FLOW_PER_SHARE.value,
|
|
440
|
+
Financial.BOOK_VALUE_PER_SHARE.value,
|
|
441
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE.value,
|
|
442
|
+
"cash_shares_ratio",
|
|
443
|
+
"total_debt_shares_ratio",
|
|
444
|
+
"net_debt_shares_ratio",
|
|
445
|
+
"stock_compensation_employee_ratio",
|
|
446
|
+
Financial.CASH_AND_SHORT_TERM_INVESTMENT.value,
|
|
447
|
+
],
|
|
448
|
+
override_number_to_x_financials=[
|
|
449
|
+
"price_sales_ratio",
|
|
450
|
+
"price_earning_reported_ratio",
|
|
451
|
+
"price_earning_ratio",
|
|
452
|
+
"ev_ebitda_ratio",
|
|
453
|
+
"ev_ebit_ratio",
|
|
454
|
+
"price_to_book_ratio",
|
|
455
|
+
"price_to_tangible_bv_ratio",
|
|
456
|
+
"price_to_cash_flow_ratio",
|
|
457
|
+
],
|
|
458
|
+
override_number_to_percent_financials=[
|
|
459
|
+
Financial.GROSS_PROFIT_MARGIN.value,
|
|
460
|
+
"net_income_margin",
|
|
461
|
+
"ebitda_margin",
|
|
462
|
+
"ebit_margin",
|
|
463
|
+
"roce",
|
|
464
|
+
],
|
|
465
|
+
errors=loader.errors,
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
@property
|
|
469
|
+
def income_statement_with_estimate(self) -> FinancialAnalysisResult:
|
|
470
|
+
values = [
|
|
471
|
+
Financial.REVENUE,
|
|
472
|
+
Financial.COST_OF_GOODS_SOLD,
|
|
473
|
+
Financial.GROSS_PROFIT,
|
|
474
|
+
Financial.GROSS_PROFIT_MARGIN,
|
|
475
|
+
Financial.SELLING_MARKETING_EXPENSES,
|
|
476
|
+
Financial.SGA_EXPENSES,
|
|
477
|
+
Financial.GENERAL_ADMIN_EXPENSES,
|
|
478
|
+
Financial.RND_EXPENSES,
|
|
479
|
+
Financial.STOCK_COMPENSATION,
|
|
480
|
+
Financial.TOTAL_OPERATING_EXPENSES,
|
|
481
|
+
Financial.EBITDA,
|
|
482
|
+
Financial.EBITDA_PER_SHARE,
|
|
483
|
+
Financial.DEPRECATION,
|
|
484
|
+
Financial.AMORTIZATION,
|
|
485
|
+
Financial.EBIT,
|
|
486
|
+
Financial.INTEREST_EXPENSE,
|
|
487
|
+
Financial.NET_INCOME_BEFORE_TAXES,
|
|
488
|
+
Financial.TAX_PROVISION,
|
|
489
|
+
Financial.TAX_RATE,
|
|
490
|
+
Financial.NET_INCOME,
|
|
491
|
+
Financial.SHARES_OUTSTANDING,
|
|
492
|
+
Financial.EPS,
|
|
493
|
+
Financial.EBITDA_REPORTED,
|
|
494
|
+
Financial.NET_INCOME_BEFORE_TAXES_REPORTED,
|
|
495
|
+
Financial.NET_INCOME_REPORTED,
|
|
496
|
+
Financial.EPS_REPORTED,
|
|
497
|
+
Financial.DIVIDEND_PER_SHARE,
|
|
498
|
+
]
|
|
499
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
500
|
+
df = loader.load()
|
|
501
|
+
|
|
502
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
503
|
+
|
|
504
|
+
@property
|
|
505
|
+
def balance_sheet_with_estimate(self) -> FinancialAnalysisResult:
|
|
506
|
+
values = [
|
|
507
|
+
Financial.CASH_EQUIVALENTS,
|
|
508
|
+
Financial.INVENTORY,
|
|
509
|
+
Financial.CURRENT_ASSETS,
|
|
510
|
+
Financial.TOTAL_ASSETS,
|
|
511
|
+
Financial.CURRENT_LIABILITIES,
|
|
512
|
+
Financial.CURRENT_DEFERRED_REVENUE,
|
|
513
|
+
Financial.TOTAL_DEBT,
|
|
514
|
+
Financial.NET_DEBT,
|
|
515
|
+
Financial.SHAREHOLDERS_EQUITY,
|
|
516
|
+
Financial.GOODWILL,
|
|
517
|
+
Financial.NET_ASSET_VALUE,
|
|
518
|
+
Financial.BOOK_VALUE_PER_SHARE,
|
|
519
|
+
Financial.TANGIBLE_BOOK_VALUE_PER_SHARE,
|
|
520
|
+
Financial.ENTERPRISE_VALUE,
|
|
521
|
+
Financial.TANGIBLE_BOOK_VALUE,
|
|
522
|
+
]
|
|
523
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
524
|
+
df = loader.load()
|
|
525
|
+
|
|
526
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
527
|
+
|
|
528
|
+
@property
|
|
529
|
+
def cash_flow_statement_with_estimate(self) -> FinancialAnalysisResult:
|
|
530
|
+
values = [
|
|
531
|
+
Financial.WORKING_CAPITAL,
|
|
532
|
+
Financial.INCOME_TAXES_PAID,
|
|
533
|
+
Financial.CASH_FLOW_FROM_OPERATIONS,
|
|
534
|
+
Financial.CAPEX,
|
|
535
|
+
Financial.CASH_FLOW_FROM_INVESTING,
|
|
536
|
+
Financial.FREE_CASH_FLOW,
|
|
537
|
+
Financial.FREE_CASH_FLOW_PER_SHARE,
|
|
538
|
+
Financial.TOTAL_DIVIDENDS,
|
|
539
|
+
Financial.CASH_FLOW_FROM_FINANCING,
|
|
540
|
+
Financial.CASH_FLOW_PER_SHARE,
|
|
541
|
+
]
|
|
542
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
543
|
+
df = loader.load()
|
|
544
|
+
|
|
545
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|
|
546
|
+
|
|
547
|
+
@property
|
|
548
|
+
def ratios_with_estimate(self) -> FinancialAnalysisResult:
|
|
549
|
+
values = [
|
|
550
|
+
Financial.RETURN_ON_EQUITY,
|
|
551
|
+
Financial.RETURN_ON_INVESTED_CAPITAL,
|
|
552
|
+
Financial.RETURN_ON_CAPITAL,
|
|
553
|
+
Financial.RETURN_ON_ASSETS,
|
|
554
|
+
]
|
|
555
|
+
loader = Loader(self.instrument, values, self.calendar_type)
|
|
556
|
+
df = loader.load()
|
|
557
|
+
|
|
558
|
+
return FinancialAnalysisResult(df, ignore_group_keys=values, errors=loader.errors)
|