wbfdm 1.55.0__py2.py3-none-any.whl → 1.55.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/import_export/handlers/option.py +2 -2
- wbfdm/migrations/0032_alter_instrumentprice_outstanding_shares.py +18 -0
- wbfdm/models/instruments/instrument_prices.py +3 -1
- wbfdm/models/instruments/mixin/financials_computed.py +0 -4
- wbfdm/tests/models/test_instrument_prices.py +0 -14
- {wbfdm-1.55.0.dist-info → wbfdm-1.55.1.dist-info}/METADATA +1 -1
- {wbfdm-1.55.0.dist-info → wbfdm-1.55.1.dist-info}/RECORD +8 -7
- {wbfdm-1.55.0.dist-info → wbfdm-1.55.1.dist-info}/WHEEL +0 -0
|
@@ -26,7 +26,7 @@ class OptionAggregateImportHandler(ImportExportHandler):
|
|
|
26
26
|
|
|
27
27
|
def _get_instance(self, data: Dict[str, Any], history: Optional[models.QuerySet] = None, **kwargs) -> models.Model:
|
|
28
28
|
with suppress(ObjectDoesNotExist):
|
|
29
|
-
return self.model.objects.
|
|
29
|
+
return self.model.objects.get(instrument=data["instrument"], date=data["date"], type=data["type"])
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class OptionImportHandler(ImportExportHandler):
|
|
@@ -46,7 +46,7 @@ class OptionImportHandler(ImportExportHandler):
|
|
|
46
46
|
|
|
47
47
|
def _get_instance(self, data: Dict[str, Any], history: Optional[models.QuerySet] = None, **kwargs) -> models.Model:
|
|
48
48
|
with suppress(ObjectDoesNotExist):
|
|
49
|
-
return self.model.objects.
|
|
49
|
+
return self.model.objects.get(
|
|
50
50
|
instrument=data["instrument"],
|
|
51
51
|
contract_identifier=data["contract_identifier"],
|
|
52
52
|
date=data["date"],
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 5.0.14 on 2025-08-27 07:59
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('wbfdm', '0031_exchange_apply_round_lot_size_and_more'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='instrumentprice',
|
|
15
|
+
name='outstanding_shares',
|
|
16
|
+
field=models.DecimalField(blank=True, decimal_places=4, help_text='The amount of outstanding share for this instrument', max_digits=16, null=True, verbose_name='Outstanding Shares'),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -195,9 +195,11 @@ class InstrumentPrice(
|
|
|
195
195
|
verbose_name="Value (Gross)",
|
|
196
196
|
) # TODO: I think we need to remove this field that is not really used here.
|
|
197
197
|
|
|
198
|
-
outstanding_shares =
|
|
198
|
+
outstanding_shares = models.DecimalField(
|
|
199
199
|
decimal_places=4,
|
|
200
200
|
max_digits=16,
|
|
201
|
+
blank=True,
|
|
202
|
+
null=True,
|
|
201
203
|
verbose_name="Outstanding Shares",
|
|
202
204
|
help_text="The amount of outstanding share for this instrument",
|
|
203
205
|
)
|
|
@@ -697,10 +697,6 @@ import pandas as pd
|
|
|
697
697
|
#
|
|
698
698
|
#
|
|
699
699
|
class InstrumentPriceComputedMixin:
|
|
700
|
-
def _compute_outstanding_shares(self):
|
|
701
|
-
if self.outstanding_shares is None and (previous_price := self.previous_price):
|
|
702
|
-
return previous_price.outstanding_shares
|
|
703
|
-
|
|
704
700
|
def _compute_outstanding_shares_consolidated(self):
|
|
705
701
|
if self.outstanding_shares_consolidated is None and self.outstanding_shares is not None:
|
|
706
702
|
return self.outstanding_shares
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from datetime import date
|
|
2
|
-
from decimal import Decimal
|
|
3
2
|
|
|
4
3
|
import pandas as pd
|
|
5
4
|
import pytest
|
|
6
5
|
from faker import Faker
|
|
7
|
-
from pandas.tseries.offsets import BDay
|
|
8
6
|
from wbcore.models import DynamicDecimalField, DynamicFloatField
|
|
9
7
|
|
|
10
8
|
from wbfdm.models import Instrument, InstrumentPrice, RelatedInstrumentThroughModel
|
|
@@ -168,18 +166,6 @@ class TestInstrumentPriceModel:
|
|
|
168
166
|
assert isinstance(instrument_price._meta.get_field("gross_value"), DynamicDecimalField)
|
|
169
167
|
assert instrument_price.gross_value == instrument_price.net_value
|
|
170
168
|
|
|
171
|
-
@pytest.mark.parametrize("instrument_price__outstanding_shares", [Decimal(10)])
|
|
172
|
-
def test_compute_outstanding_shares(self, instrument_price, instrument_price_factory):
|
|
173
|
-
next_price = instrument_price_factory.create(
|
|
174
|
-
instrument=instrument_price.instrument,
|
|
175
|
-
date=instrument_price.date + BDay(1),
|
|
176
|
-
outstanding_shares=None,
|
|
177
|
-
calculated=instrument_price.calculated,
|
|
178
|
-
)
|
|
179
|
-
assert hasattr(instrument_price, "_compute_outstanding_shares")
|
|
180
|
-
assert isinstance(instrument_price._meta.get_field("outstanding_shares"), DynamicDecimalField)
|
|
181
|
-
assert next_price.outstanding_shares == instrument_price.outstanding_shares
|
|
182
|
-
|
|
183
169
|
@pytest.mark.parametrize("instrument_price__volume_50d", [None])
|
|
184
170
|
def test_compute_volume_50d(self, instrument_price, instrument_price_factory):
|
|
185
171
|
assert hasattr(instrument_price, "_compute_volume_50d")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wbfdm
|
|
3
|
-
Version: 1.55.
|
|
3
|
+
Version: 1.55.1
|
|
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.*
|
|
@@ -166,7 +166,7 @@ wbfdm/import_export/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
166
166
|
wbfdm/import_export/handlers/instrument.py,sha256=ZtXwqoCh--_Bgn7mB_A7U2w1S6HfMr9MqFCc4VMw7ls,12071
|
|
167
167
|
wbfdm/import_export/handlers/instrument_list.py,sha256=mZRfpJFi6BhhrjH2qaFEPqqCK2ybg-DQm43Uck7G9_w,4864
|
|
168
168
|
wbfdm/import_export/handlers/instrument_price.py,sha256=RbNTo78zZuttzlVFKxJrHcW7DRfcsta7QDEI8OiiDrA,3498
|
|
169
|
-
wbfdm/import_export/handlers/option.py,sha256=
|
|
169
|
+
wbfdm/import_export/handlers/option.py,sha256=MPzluMPJ3Yu7Ahmw9BA7-ssAbvPDdyca_rC-YVhU8bY,2378
|
|
170
170
|
wbfdm/import_export/handlers/private_equities.py,sha256=tOx4lgQOB68lYTi3UzIPzDQsfay5k2pu5qv8jGzG030,1957
|
|
171
171
|
wbfdm/import_export/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
172
172
|
wbfdm/import_export/parsers/cbinsights/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -223,6 +223,7 @@ wbfdm/migrations/0028_instrumentprice_annualized_daily_volatility.py,sha256=pO5M
|
|
|
223
223
|
wbfdm/migrations/0029_alter_instrumentprice_volume.py,sha256=0UFUwEaBcqiWjKw6un1gf8sluKCRRh9snDM4z4THDw8,510
|
|
224
224
|
wbfdm/migrations/0030_alter_relatedinstrumentthroughmodel_related_type.py,sha256=10-89NB7-T7t3xFPpd4fYQkKejNR36UewIhe5_20QCo,565
|
|
225
225
|
wbfdm/migrations/0031_exchange_apply_round_lot_size_and_more.py,sha256=MqcHxgJIt67BEuEYK8vnJHhx_cGFw9Ca9Az2EvsDy1o,863
|
|
226
|
+
wbfdm/migrations/0032_alter_instrumentprice_outstanding_shares.py,sha256=uRgkf6j97kNaXAo0-_V3XzHNE59hvxSruJB18g53YwU,570
|
|
226
227
|
wbfdm/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
227
228
|
wbfdm/models/__init__.py,sha256=PWsLtlKJFDYycCohPbjsRLeWi1xaxEkZbaoUKo0yOBU,96
|
|
228
229
|
wbfdm/models/fields.py,sha256=eQ_6EnDBMy0U7WzE2DsdXIXOJH5dFiIN2VbO2Svw4R0,3942
|
|
@@ -235,7 +236,7 @@ wbfdm/models/exchanges/exchanges.py,sha256=RmM5shyyuxEGN2Y3JmeSWyU-SbpVARrvVFW72
|
|
|
235
236
|
wbfdm/models/instruments/__init__.py,sha256=OvEkECJaCubBQC7B9yUrx15V982labvegeGXyEASVno,636
|
|
236
237
|
wbfdm/models/instruments/classifications.py,sha256=EeZ_P8f1F1NfjUmLf9fDMF0iPM73qxQoArUfvjuCwHg,10906
|
|
237
238
|
wbfdm/models/instruments/instrument_lists.py,sha256=GxfFyfYxEcJS36LAarHja49TOM8ffhIivpZX2-tPtZg,4234
|
|
238
|
-
wbfdm/models/instruments/instrument_prices.py,sha256=
|
|
239
|
+
wbfdm/models/instruments/instrument_prices.py,sha256=K7oMIz76WSrLmpNwcabThvtrP6WpBZZnrE9CHB5-UPQ,22345
|
|
239
240
|
wbfdm/models/instruments/instrument_relationships.py,sha256=zpCZCnt5CqIg5bd6le_6TyirsSwGV2NaqTVKw3bd5vM,10660
|
|
240
241
|
wbfdm/models/instruments/instrument_requests.py,sha256=XbpofRS8WHadHlTFjvXJyd0o7K9r2pzJtnpjVQZOLdI,7832
|
|
241
242
|
wbfdm/models/instruments/instruments.py,sha256=Tn9vIu0kys8pVVBiO58Z0Z5fAv0KWzkp4L4kjm7oh3c,44485
|
|
@@ -246,7 +247,7 @@ wbfdm/models/instruments/utils.py,sha256=88jnWINSSC0OwH-mCEOPLZXuhBCtEsxBpSaZ38G
|
|
|
246
247
|
wbfdm/models/instruments/llm/__init__.py,sha256=dSmxRmEWb0A4O_lUoWuRKt2mBtUuLCTPVVJqGyi_n40,52
|
|
247
248
|
wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=f9MT-8cWYlexUfCkaOJa9erI9RaUNI-nqCEyf2tDkbA,3809
|
|
248
249
|
wbfdm/models/instruments/mixin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
249
|
-
wbfdm/models/instruments/mixin/financials_computed.py,sha256=
|
|
250
|
+
wbfdm/models/instruments/mixin/financials_computed.py,sha256=E87I7O2WQgjY3zM3so4dzfExBzVtKTkTqnRjPwLHbyM,34920
|
|
250
251
|
wbfdm/models/instruments/mixin/financials_serializer_fields.py,sha256=-OkpcUt1rZmB3nUcO2vckpJdVm8IxRqkPDEgcPqqoRU,68886
|
|
251
252
|
wbfdm/models/instruments/mixin/instruments.py,sha256=fpt03q_Sq35R_ZmJpdcw81aA7wTocnp7ANE1jb-_cfI,10022
|
|
252
253
|
wbfdm/serializers/__init__.py,sha256=AXb03RKHo6B0ts_IQOvx89n9wKG8pxiumYv9cr4EhvA,197
|
|
@@ -279,7 +280,7 @@ wbfdm/tests/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
279
280
|
wbfdm/tests/models/test_classifications.py,sha256=f2aM9UyV54fkEncp-uewEdOc3_0D-iPMN5LwhIhJC9w,4979
|
|
280
281
|
wbfdm/tests/models/test_exchanges.py,sha256=KwK278MpA3FkpVgjW2l2PIHL7e8uDur7dOzIaTQEwyw,138
|
|
281
282
|
wbfdm/tests/models/test_instrument_list.py,sha256=UIxKgBd4U-T2I4WDZfwacgJ1nKwJWYX1HKhdQDpx1tA,4899
|
|
282
|
-
wbfdm/tests/models/test_instrument_prices.py,sha256=
|
|
283
|
+
wbfdm/tests/models/test_instrument_prices.py,sha256=dRaFGc3epG_N6p0KtDzXOH7Gkx_aCSUKNn3JZBhHr8M,15875
|
|
283
284
|
wbfdm/tests/models/test_instruments.py,sha256=Vg2cYWAwdu00dziKDUe_MrTzrsygHaZQHnvibF8pvew,9784
|
|
284
285
|
wbfdm/tests/models/test_merge.py,sha256=tXD5xIxZyZtXpm9WIQ4Yc8TQwsUnkxkKIvMNwaHOvgM,4632
|
|
285
286
|
wbfdm/tests/models/test_options.py,sha256=DoEAHhNQE4kucpBRRm2S05ozabkERz-I4mUolsE2Qi8,2269
|
|
@@ -360,6 +361,6 @@ wbfdm/viewsets/statements/__init__.py,sha256=odxtFYUDICPmz8WCE3nx93EvKZLSPBEI4d7
|
|
|
360
361
|
wbfdm/viewsets/statements/statements.py,sha256=gA6RCI8-B__JwjEb6OZxpn8Y-9aF-YQ3HIQ7e1vfJMw,4304
|
|
361
362
|
wbfdm/viewsets/technical_analysis/__init__.py,sha256=qtCIBg0uSiZeJq_1tEQFilnorMBkMe6uCMfqar6-cLE,77
|
|
362
363
|
wbfdm/viewsets/technical_analysis/monthly_performances.py,sha256=O1j8CGfOranL74LqVvcf7jERaDIboEJZiBf_AbbVDQ8,3974
|
|
363
|
-
wbfdm-1.55.
|
|
364
|
-
wbfdm-1.55.
|
|
365
|
-
wbfdm-1.55.
|
|
364
|
+
wbfdm-1.55.1.dist-info/METADATA,sha256=Fd7TZoh4t4Osc-BzujFsIrlDHsLjzELt6aOsDLOtZ-c,768
|
|
365
|
+
wbfdm-1.55.1.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
|
366
|
+
wbfdm-1.55.1.dist-info/RECORD,,
|
|
File without changes
|