wbfdm 1.50.8__py2.py3-none-any.whl → 1.50.10__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.

@@ -67,7 +67,7 @@ class ClassificationTreeChartFilter(wb_filters.FilterSet):
67
67
 
68
68
  aggregation_type = wb_filters.ChoiceFilter(
69
69
  choices=[("classification_count", "Classification Count"), ("instrument_count", "Instrument Count")],
70
- default="classification_count",
70
+ initial="classification_count",
71
71
  label="Aggregation Type",
72
72
  method="fake_filter",
73
73
  )
@@ -89,7 +89,7 @@ class InstrumentClassificationThroughModelViewFilterSet(wb_filters.FilterSet):
89
89
  endpoint=ClassificationGroup.get_representation_endpoint(),
90
90
  value_key=ClassificationGroup.get_representation_value_key(),
91
91
  label_key=ClassificationGroup.get_representation_label_key(),
92
- default=_get_default_classification_group_id,
92
+ initial=_get_default_classification_group_id,
93
93
  )
94
94
 
95
95
  class Meta:
@@ -7,15 +7,10 @@ from wbfdm.models.instruments import Instrument
7
7
 
8
8
  class MarketDataChartFilterSet(filters.FilterSet):
9
9
  period = filters.FinancialPerformanceDateRangeFilter(
10
- label="Period",
11
- method="fake_filter",
12
- default=five_year_data_range,
10
+ label="Period", method="fake_filter", initial=five_year_data_range, required=True
13
11
  )
14
12
  chart_type = filters.ChoiceFilter(
15
- method="fake_filter",
16
- label="Chart Type",
17
- choices=MarketDataChartType.choices,
18
- default="close",
13
+ method="fake_filter", label="Chart Type", choices=MarketDataChartType.choices, initial="close", required=True
19
14
  )
20
15
  benchmarks = filters.ModelMultipleChoiceFilter(
21
16
  label="Benchmarks",
@@ -35,14 +30,12 @@ class MarketDataChartFilterSet(filters.FilterSet):
35
30
  volume = filters.BooleanFilter(
36
31
  method="fake_filter",
37
32
  label="Add Volume",
38
- default=False,
39
- required=False,
33
+ initial=False,
40
34
  )
41
35
  show_estimates = filters.BooleanFilter(
42
36
  method="fake_filter",
43
37
  label="Show Estimates",
44
- default=True,
45
- required=False,
38
+ initial=True,
46
39
  )
47
40
 
48
41
  class Meta:
@@ -51,16 +44,10 @@ class MarketDataChartFilterSet(filters.FilterSet):
51
44
 
52
45
 
53
46
  class FinancialRatioFilterSet(filters.FilterSet):
54
- ttm = filters.BooleanFilter(
55
- method="fake_filter",
56
- label="TTM/FTM",
57
- default=True,
58
- )
47
+ ttm = filters.BooleanFilter(method="fake_filter", label="TTM/FTM", initial=True, required=True)
59
48
 
60
49
  period = filters.FinancialPerformanceDateRangeFilter(
61
- method="fake_filter",
62
- label="Period",
63
- default=five_year_data_range,
50
+ method="fake_filter", label="Period", initial=five_year_data_range, required=True
64
51
  )
65
52
 
66
53
  class Meta:
@@ -74,7 +61,7 @@ class StatementFilter(filters.FilterSet):
74
61
  label="Data Type",
75
62
  choices=DataType.choices,
76
63
  required=True,
77
- default=DataType.STANDARDIZED,
64
+ initial=DataType.STANDARDIZED,
78
65
  )
79
66
 
80
67
  class Meta:
@@ -88,7 +75,7 @@ class StatementWithEstimateFilter(filters.FilterSet):
88
75
  label="Calendar Type",
89
76
  choices=CalendarType.choices,
90
77
  required=True,
91
- default=CalendarType.FISCAL,
78
+ initial=CalendarType.FISCAL,
92
79
  )
93
80
 
94
81
  class Meta:
@@ -48,7 +48,7 @@ class FinancialAnalysisValuationRatiosFilterSet(wb_filters.FilterSet):
48
48
  label="Date Range",
49
49
  required=True,
50
50
  clearable=False,
51
- default=lambda r, v, q: DateRange(_get_12m(r, v, q), date.today()),
51
+ initial=lambda r, v, q: DateRange(_get_12m(r, v, q), date.today()),
52
52
  )
53
53
 
54
54
  class OutputChoices(models.TextChoices):
@@ -61,34 +61,46 @@ class FinancialAnalysisValuationRatiosFilterSet(wb_filters.FilterSet):
61
61
  ROLLING = "ROLLING", "Rolling"
62
62
 
63
63
  output = wb_filters.ChoiceFilter(
64
- choices=OutputChoices.choices, label="Output", method="fake_filter", default=OutputChoices.CHART
64
+ choices=OutputChoices.choices, label="Output", method="fake_filter", initial=OutputChoices.CHART, required=True
65
65
  )
66
66
  period = wb_filters.ChoiceFilter(
67
- choices=PeriodChoices.choices, label="Period", method="fake_filter", default=PeriodChoices.NTM
67
+ choices=PeriodChoices.choices, label="Period", method="fake_filter", initial=PeriodChoices.NTM, required=True
68
68
  )
69
- vs_related = wb_filters.BooleanFilter(label="Versus related", default=False, method="fake_filter")
70
- clean_data = wb_filters.BooleanFilter(label="Clean data", default=True, method="fake_filter")
71
- ranges = wb_filters.BooleanFilter(label="Draw ranges", default=False, required=False, method="fake_filter")
69
+ vs_related = wb_filters.BooleanFilter(label="Versus related", initial=False, required=True, method="fake_filter")
70
+ clean_data = wb_filters.BooleanFilter(label="Clean data", initial=True, required=True, method="fake_filter")
71
+ ranges = wb_filters.BooleanFilter(label="Draw ranges", initial=False, method="fake_filter")
72
72
  range_type = wb_filters.ChoiceFilter(
73
73
  choices=RangeChoices.choices,
74
74
  label="Range type",
75
75
  method="fake_filter",
76
76
  required=True,
77
- default=RangeChoices.MINMAX,
77
+ initial=RangeChoices.MINMAX,
78
78
  )
79
79
  range_period = wb_filters.NumberFilter(
80
- precision=0, label="Rolling period", method="fake_filter", required=True, default=120
80
+ precision=0, label="Rolling period", method="fake_filter", required=True, initial=120
81
81
  )
82
82
  x_axis_var = wb_filters.ChoiceFilter(
83
- choices=VariableChoices.choices, label="X-Axis", method="fake_filter", default=VariableChoices.EPSG
83
+ choices=VariableChoices.choices,
84
+ label="X-Axis",
85
+ method="fake_filter",
86
+ initial=VariableChoices.EPSG,
87
+ required=True,
84
88
  )
85
89
  y_axis_var = wb_filters.ChoiceFilter(
86
- choices=VariableChoices.choices, label="Y-Axis", method="fake_filter", default=VariableChoices.PE
90
+ choices=VariableChoices.choices,
91
+ label="Y-Axis",
92
+ method="fake_filter",
93
+ initial=VariableChoices.PE,
94
+ required=True,
87
95
  )
88
96
  z_axis_var = wb_filters.ChoiceFilter(
89
- choices=VariableChoices.choices, label="Bubble", method="fake_filter", default=VariableChoices.MKTCAP
97
+ choices=VariableChoices.choices,
98
+ label="Bubble",
99
+ method="fake_filter",
100
+ initial=VariableChoices.MKTCAP,
101
+ required=True,
90
102
  )
91
- median = wb_filters.BooleanFilter(label="Median", default=True, method="fake_filter")
103
+ median = wb_filters.BooleanFilter(label="Median", initial=True, required=True, method="fake_filter")
92
104
 
93
105
  class Meta:
94
106
  model = Instrument
@@ -101,19 +113,27 @@ class EarningsAnalysisFilterSet(wb_filters.FilterSet):
101
113
  label="Date Range",
102
114
  required=True,
103
115
  clearable=False,
104
- default=lambda r, v, q: DateRange(_get_12m(r, v, q), date.today()),
116
+ initial=lambda r, v, q: DateRange(_get_12m(r, v, q), date.today()),
105
117
  )
106
118
 
107
119
  class OutputChoices(models.TextChoices):
108
120
  EPS = "EPS", "Earnings ($)"
109
121
 
110
122
  analysis = wb_filters.ChoiceFilter(
111
- choices=OutputChoices.choices, label="Analysis", method=lambda q, n, v: q, default=OutputChoices.EPS
123
+ choices=OutputChoices.choices,
124
+ label="Analysis",
125
+ method=lambda q, n, v: q,
126
+ initial=OutputChoices.EPS,
127
+ required=True,
112
128
  )
113
129
  period = wb_filters.ChoiceFilter(
114
- choices=PeriodChoices.choices, label="Period", method=lambda q, n, v: q, default=PeriodChoices.NTM
130
+ choices=PeriodChoices.choices,
131
+ label="Period",
132
+ method=lambda q, n, v: q,
133
+ initial=PeriodChoices.NTM,
134
+ required=True,
115
135
  )
116
- vs_related = wb_filters.BooleanFilter(label="Show related", default=False, method=lambda q, n, v: q)
136
+ vs_related = wb_filters.BooleanFilter(label="Show related", initial=False, required=True, method=lambda q, n, v: q)
117
137
 
118
138
  class Meta:
119
139
  model = Instrument
@@ -16,7 +16,7 @@ class FakeDateRange(wb_filters.FilterSet):
16
16
  label="Date Range",
17
17
  required=True,
18
18
  clearable=False,
19
- default=lambda r, v, q: DateRange(byearend_2_year_ago(r, v, q), date.today()),
19
+ initial=lambda r, v, q: DateRange(byearend_2_year_ago(r, v, q), date.today()),
20
20
  )
21
21
 
22
22
  class Meta:
@@ -30,7 +30,7 @@ class InstrumentPriceFilterSet(wb_filters.FilterSet):
30
30
  label="Date Range",
31
31
  required=True,
32
32
  clearable=False,
33
- default=lambda r, v, q: DateRange(get_earliest_date(r, v, q), get_latest_date(r, v, q)),
33
+ initial=lambda r, v, q: DateRange(get_earliest_date(r, v, q), get_latest_date(r, v, q)),
34
34
  )
35
35
 
36
36
  class Meta:
@@ -70,7 +70,7 @@ class InstrumentPriceMultipleBenchmarkChartFilterSet(InstrumentPriceFilterSet):
70
70
  filter_params={"is_security": True},
71
71
  method="fake_filter",
72
72
  )
73
- normalized = wb_filters.BooleanFilter(label="Normalize", default=True, method="fake_filter")
73
+ normalized = wb_filters.BooleanFilter(label="Normalize", initial=True, required=True, method="fake_filter")
74
74
 
75
75
  class Meta:
76
76
  model = InstrumentPrice
@@ -84,7 +84,11 @@ class InstrumentPriceFrequencyFilter(InstrumentPriceFilterSet):
84
84
  MONTHLY = "BME", "Monthly"
85
85
 
86
86
  frequency = wb_filters.ChoiceFilter(
87
- label="Frequency", choices=FrequencyChoice.choices, default=FrequencyChoice.DAILY, method="fake_filter"
87
+ label="Frequency",
88
+ choices=FrequencyChoice.choices,
89
+ initial=FrequencyChoice.DAILY,
90
+ required=True,
91
+ method="fake_filter",
88
92
  )
89
93
 
90
94
  class Meta:
@@ -29,7 +29,7 @@ class InstrumentFavoriteGroupFilterSet(wb_filters.FilterSet):
29
29
  endpoint=InstrumentFavoriteGroup.get_representation_endpoint(),
30
30
  value_key=InstrumentFavoriteGroup.get_representation_value_key(),
31
31
  label_key=InstrumentFavoriteGroup.get_representation_label_key(),
32
- default=get_default_favorite_group,
32
+ initial=get_default_favorite_group,
33
33
  method="filter_favorite_group",
34
34
  )
35
35
 
@@ -93,7 +93,7 @@ class InstrumentFilterSet(TagFilterMixin, InstrumentFavoriteGroupFilterSet):
93
93
  return queryset
94
94
 
95
95
  is_investable = wb_filters.BooleanFilter(
96
- label="Is Investable", default=True, method="filter_is_investable", hidden=True
96
+ label="Is Investable", initial=True, method="filter_is_investable", hidden=True
97
97
  )
98
98
 
99
99
  def filter_is_investable(self, queryset, name, value):
@@ -171,7 +171,7 @@ class BaseClassifiedInstrumentFilterSet(TagFilterMixin, wb_filters.FilterSet):
171
171
  endpoint=ClassificationGroup.get_representation_endpoint(),
172
172
  value_key=ClassificationGroup.get_representation_value_key(),
173
173
  label_key=ClassificationGroup.get_representation_label_key(),
174
- default=_get_default_classification_group_id,
174
+ initial=_get_default_classification_group_id,
175
175
  method="fake_filter",
176
176
  required=True,
177
177
  )
@@ -195,7 +195,7 @@ class MonthlyPerformancesInstrumentFilterSet(wb_filters.FilterSet):
195
195
  required=True,
196
196
  clearable=False,
197
197
  method="fake_filter",
198
- default=lambda r, v, q: DateRange(get_earliest_date(r, v, q), get_latest_date(r, v, q)),
198
+ initial=lambda r, v, q: DateRange(get_earliest_date(r, v, q), get_latest_date(r, v, q)),
199
199
  )
200
200
 
201
201
  class Meta:
@@ -57,29 +57,31 @@ def run_company_extraction_llm(title: str, description: str, *args) -> list[dict
57
57
  SystemMessage(
58
58
  content="You will be parsed a news article, please provide the name of the publicly listed companies mentioned in the article, along with their ISIN, ticker, RIC, sentiment, and analysis."
59
59
  ),
60
- HumanMessage(content=f"Title: {title}, Description: {description}"),
60
+ HumanMessage(content="Title: {title}, Description: {description}"),
61
61
  ],
62
62
  output_model=CompaniesModel,
63
+ query={"title": title, "description": description},
63
64
  )
64
- instrument_ct = ContentType.objects.get_for_model(Instrument)
65
- for company in res.get("companies", []):
66
- instrument = InstrumentLookup(Instrument).lookup(
67
- only_security=True,
68
- name=company.name,
69
- isin=company.isin,
70
- ticker=company.ticker,
71
- refinitiv_identifier_code=company.refinitiv_identifier_code,
72
- )
73
- if instrument is not None:
74
- relationships.append(
75
- {
76
- "content_type_id": instrument_ct.id,
77
- "object_id": instrument.get_root().id,
78
- "sentiment": company.sentiment,
79
- "analysis": company.analysis,
80
- "content_object_repr": str(instrument),
81
- }
65
+ if isinstance(res, CompaniesModel):
66
+ instrument_ct = ContentType.objects.get_for_model(Instrument)
67
+ for company in res.companies:
68
+ instrument = InstrumentLookup(Instrument).lookup(
69
+ only_security=True,
70
+ name=company.name,
71
+ isin=company.isin,
72
+ ticker=company.ticker,
73
+ refinitiv_identifier_code=company.refinitiv_identifier_code,
82
74
  )
75
+ if instrument is not None:
76
+ relationships.append(
77
+ {
78
+ "content_type_id": instrument_ct.id,
79
+ "object_id": instrument.get_root().id,
80
+ "sentiment": company.sentiment,
81
+ "analysis": company.analysis,
82
+ "content_object_repr": str(instrument),
83
+ }
84
+ )
83
85
  except tuple(APIStatusErrors) as e: # for APIStatusError, we let celery retry it
84
86
  raise e
85
87
  except Exception as e: # otherwise we log the error and silently fail
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbfdm
3
- Version: 1.50.8
3
+ Version: 1.50.10
4
4
  Summary: The workbench module ensures rapid access to diverse financial data (market, fundamental, forecasts, ESG), with features for storing instruments, classifying them, and conducting financial analysis.
5
5
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
6
6
  Requires-Dist: roman==4.*
@@ -135,12 +135,12 @@ wbfdm/figures/financials/__init__.py,sha256=6PcHUFJeTEtz9BweUlLANHHOshiNgqX1Wj3K
135
135
  wbfdm/figures/financials/financial_analysis_charts.py,sha256=YJ3JW8WiuP53Ow9YGT_TGpMGQtCyGMzORb5EEn86XSo,18396
136
136
  wbfdm/figures/financials/financials_charts.py,sha256=tKqBWvkLkDB2GGsPe5g4GR6d3tgnBY2LgRYdXamzBWQ,32717
137
137
  wbfdm/filters/__init__.py,sha256=skWeFdAcemysUeGEvIJ_cIxn-SXuJsUxAroTxq0N8Qo,926
138
- wbfdm/filters/classifications.py,sha256=ylmYzP2ZYiEei5vr8BCn_8JNd-Bv7uYnyDhWLa_VrHM,3625
138
+ wbfdm/filters/classifications.py,sha256=8tKTAPwMzOIXkGWa4ez1layLBAlkDtdG53-75Rg0d9k,3625
139
139
  wbfdm/filters/exchanges.py,sha256=84N4AQoCwgdnxTxmhMob5Yndfr5gy_DRQ_-m2ilVLVM,835
140
- wbfdm/filters/financials.py,sha256=mYb2nvZo3UWtN7pWQQcug0YMgQ6uEIlDR5GhwID_Um0,2539
141
- wbfdm/filters/financials_analysis.py,sha256=EiWMWZ9cc3Pm7ySTKRHlM2XmB2NDFBIGKdAWNwDhJ3A,4087
142
- wbfdm/filters/instrument_prices.py,sha256=_yDyKWwaUIVvsSCJAitILtLdhzschVpkuyi8X8QHpAs,3647
143
- wbfdm/filters/instruments.py,sha256=RwdLzB-96iDmdTOHpb74UkyB4k-AfLBQ1KxhPpJWvyI,7893
140
+ wbfdm/filters/financials.py,sha256=FN6vpx99jOMMuv79bWbyPH8TrD7ua0JjVOu8ivDbi6I,2461
141
+ wbfdm/filters/financials_analysis.py,sha256=aDA33RhKCOmA62GwuAr5xDK71T0racdyDUEaxOBp4Oc,4401
142
+ wbfdm/filters/instrument_prices.py,sha256=Nt-fInhTM_LRwwmT3U-b0eWoxe-EYEdv77wLEHkZqUc,3710
143
+ wbfdm/filters/instruments.py,sha256=u-aQIjAa90Ru7wdIoUr207Z39ThnDMBZoMEFqBDA1vc,7893
144
144
  wbfdm/filters/utils.py,sha256=6IpNoZ_yjRUCdpVXrj3kriTceAX-VGrS5NpZA2NgSmY,1870
145
145
  wbfdm/import_export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
146
  wbfdm/import_export/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -237,7 +237,7 @@ wbfdm/models/instruments/private_equities.py,sha256=uzwZi8IkmCKAHVTxnuFya9tehx7k
237
237
  wbfdm/models/instruments/querysets.py,sha256=c9fbHVvIRyaFU7jm_CM90lfIVzB8beOD8YII9-FqdT4,7191
238
238
  wbfdm/models/instruments/utils.py,sha256=88jnWINSSC0OwH-mCEOPLZXuhBCtEsxBpSaZ38GteaE,1365
239
239
  wbfdm/models/instruments/llm/__init__.py,sha256=dSmxRmEWb0A4O_lUoWuRKt2mBtUuLCTPVVJqGyi_n40,52
240
- wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=Eza39rlkNJxpURroIsJLImKC6F-KtTmkdjHn1kv4F3Q,3439
240
+ wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=1EOd3VmLk31eIDzWLxKp9cRHg3c0IGHJkkwJTG_pxoU,3611
241
241
  wbfdm/models/instruments/mixin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
242
242
  wbfdm/models/instruments/mixin/financials_computed.py,sha256=L5wjXDsR0maiwfOKP6KyWNJNH4nGOoAjSc_hDM7fsj0,35105
243
243
  wbfdm/models/instruments/mixin/financials_serializer_fields.py,sha256=-OkpcUt1rZmB3nUcO2vckpJdVm8IxRqkPDEgcPqqoRU,68886
@@ -352,6 +352,6 @@ wbfdm/viewsets/statements/__init__.py,sha256=odxtFYUDICPmz8WCE3nx93EvKZLSPBEI4d7
352
352
  wbfdm/viewsets/statements/statements.py,sha256=kmtM0uZ3f7eJJe5gVmd-iVra9dHwTB9x12p7f5qTEx8,4084
353
353
  wbfdm/viewsets/technical_analysis/__init__.py,sha256=qtCIBg0uSiZeJq_1tEQFilnorMBkMe6uCMfqar6-cLE,77
354
354
  wbfdm/viewsets/technical_analysis/monthly_performances.py,sha256=O1j8CGfOranL74LqVvcf7jERaDIboEJZiBf_AbbVDQ8,3974
355
- wbfdm-1.50.8.dist-info/METADATA,sha256=hEBxoYh2UG1X-acebLjmgi9I9upqoDbBQ8O74bou304,737
356
- wbfdm-1.50.8.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
357
- wbfdm-1.50.8.dist-info/RECORD,,
355
+ wbfdm-1.50.10.dist-info/METADATA,sha256=mEC0BmOL0ic6hFd1SlnJ5WxeyQ1oJ3aB0ZMsT-30894,738
356
+ wbfdm-1.50.10.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
357
+ wbfdm-1.50.10.dist-info/RECORD,,