wbfdm 1.46.1__py2.py3-none-any.whl → 1.46.3__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/contrib/qa/dataloaders/market_data.py +11 -1
- wbfdm/filters/instruments.py +2 -0
- wbfdm/import_export/resources/instruments.py +0 -54
- wbfdm/models/instruments/mixin/instruments.py +1 -0
- wbfdm/serializers/instruments/instruments.py +1 -0
- wbfdm/viewsets/configs/buttons/instruments.py +2 -0
- wbfdm/viewsets/configs/display/instruments.py +2 -0
- {wbfdm-1.46.1.dist-info → wbfdm-1.46.3.dist-info}/METADATA +1 -1
- {wbfdm-1.46.1.dist-info → wbfdm-1.46.3.dist-info}/RECORD +10 -10
- {wbfdm-1.46.1.dist-info → wbfdm-1.46.3.dist-info}/WHEEL +0 -0
|
@@ -68,6 +68,10 @@ class DatastreamMarketDataDataloader(MarketDataProtocol, Dataloader):
|
|
|
68
68
|
fx_code = pk.Table("DS2FxCode")
|
|
69
69
|
fx = pk.Table("DS2FxRate")
|
|
70
70
|
|
|
71
|
+
quotes = pk.Table("DS2CtryQtInfo")
|
|
72
|
+
securities = pk.Table("DS2Security")
|
|
73
|
+
securities2 = pk.Table("DS2Security", alias="securities2")
|
|
74
|
+
|
|
71
75
|
mapping, create_mapping_table = create_table(
|
|
72
76
|
"#ds2infoexchcode", Column("InfoCode", SqlTypes.INTEGER), Column("ExchIntCode", SqlTypes.INTEGER)
|
|
73
77
|
)
|
|
@@ -83,8 +87,14 @@ class DatastreamMarketDataDataloader(MarketDataProtocol, Dataloader):
|
|
|
83
87
|
fn.Cast(pricing.MarketDate, SqlTypes.DATE).as_("valuation_date"),
|
|
84
88
|
ValueWrapper("qa-ds2").as_("source"),
|
|
85
89
|
)
|
|
90
|
+
.join(quotes)
|
|
91
|
+
.on_field("InfoCode")
|
|
92
|
+
.join(securities)
|
|
93
|
+
.on(quotes.DsSecCode == securities.DsSecCode)
|
|
94
|
+
.join(securities2)
|
|
95
|
+
.on((securities2.DsCmpyCode == securities.DsCmpyCode) & securities2.IsMajorSec == "Y")
|
|
86
96
|
.left_join(market_val)
|
|
87
|
-
.on((
|
|
97
|
+
.on((securities2.PrimQtInfoCode == market_val.InfoCode) & (pricing.MarketDate == market_val.ValDate))
|
|
88
98
|
# We join on _codes, which removes all instruments not in _codes - implicit where
|
|
89
99
|
.join(mapping)
|
|
90
100
|
.on((pricing.InfoCode == mapping.InfoCode) & (pricing.ExchIntCode == mapping.ExchIntCode))
|
wbfdm/filters/instruments.py
CHANGED
|
@@ -140,6 +140,8 @@ class InstrumentFilterSet(TagFilterMixin, InstrumentFavoriteGroupFilterSet):
|
|
|
140
140
|
"instrument_type": ["exact"],
|
|
141
141
|
"isin": ["exact"],
|
|
142
142
|
"ticker": ["exact"],
|
|
143
|
+
"refinitiv_mnemonic_code": ["exact"],
|
|
144
|
+
"refinitiv_identifier_code": ["exact"],
|
|
143
145
|
"currency": ["exact"],
|
|
144
146
|
# "related_instruments": ["exact"], # I don't think this filter is necessary
|
|
145
147
|
"country": ["exact"],
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import magic
|
|
2
|
-
from django.apps import apps
|
|
3
1
|
from django.db.models import Q
|
|
4
2
|
from import_export import fields
|
|
5
|
-
from import_export.formats.base_formats import CSV
|
|
6
|
-
from import_export.results import RowResult
|
|
7
|
-
from import_export.signals import post_import
|
|
8
3
|
from import_export.widgets import CharWidget, ForeignKeyWidget, ManyToManyWidget
|
|
9
|
-
from rest_framework.reverse import reverse
|
|
10
4
|
from wbcore.contrib.currency.models import Currency
|
|
11
5
|
from wbcore.contrib.geography.import_export.resources.geography import (
|
|
12
6
|
CountryForeignKeyWidget,
|
|
13
7
|
)
|
|
14
8
|
from wbcore.contrib.io.resources import FilterModelResource
|
|
15
|
-
from wbcore.contrib.notifications.dispatch import send_notification
|
|
16
9
|
|
|
17
10
|
from wbfdm.models import Exchange, Instrument, InstrumentClassificationThroughModel
|
|
18
11
|
|
|
@@ -128,50 +121,3 @@ class InstrumentResource(FilterModelResource):
|
|
|
128
121
|
)
|
|
129
122
|
export_order = fields
|
|
130
123
|
model = Instrument
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
# This parser satisfy the import source framework interface. The generic logic will probably need to move the io module to avoid repetition
|
|
134
|
-
def parse(import_source):
|
|
135
|
-
input_format = CSV(encoding="utf-8-sig")
|
|
136
|
-
|
|
137
|
-
file_stream = import_source.file.read()
|
|
138
|
-
if input_format.CONTENT_TYPE == magic.from_buffer(file_stream, mime=True):
|
|
139
|
-
dataset = input_format.create_dataset(file_stream)
|
|
140
|
-
|
|
141
|
-
model = apps.get_model(import_source.parser_handler.handler)
|
|
142
|
-
result = InstrumentResource().import_data(
|
|
143
|
-
dataset,
|
|
144
|
-
dry_run=False,
|
|
145
|
-
file_name=import_source.file.name,
|
|
146
|
-
user=import_source.creator,
|
|
147
|
-
rollback_on_validation_errors=True,
|
|
148
|
-
)
|
|
149
|
-
import_source.file.close()
|
|
150
|
-
post_import.send(sender=None, model=model)
|
|
151
|
-
success_message = """
|
|
152
|
-
{} import finished:
|
|
153
|
-
* new {}
|
|
154
|
-
* updated {}
|
|
155
|
-
* skipped {}
|
|
156
|
-
* failed {}
|
|
157
|
-
* deleted {}
|
|
158
|
-
* invalid {}
|
|
159
|
-
""".format(
|
|
160
|
-
model._meta.verbose_name_plural,
|
|
161
|
-
result.totals[RowResult.IMPORT_TYPE_NEW],
|
|
162
|
-
result.totals[RowResult.IMPORT_TYPE_UPDATE],
|
|
163
|
-
result.totals[RowResult.IMPORT_TYPE_SKIP],
|
|
164
|
-
result.totals[RowResult.IMPORT_TYPE_ERROR],
|
|
165
|
-
result.totals[RowResult.IMPORT_TYPE_DELETE],
|
|
166
|
-
result.totals[RowResult.IMPORT_TYPE_INVALID],
|
|
167
|
-
)
|
|
168
|
-
import_source.log = success_message
|
|
169
|
-
import_source.save()
|
|
170
|
-
if import_source.creator:
|
|
171
|
-
send_notification(
|
|
172
|
-
code="io.import_done",
|
|
173
|
-
name="Your import is done",
|
|
174
|
-
body=success_message,
|
|
175
|
-
user=import_source.creator,
|
|
176
|
-
endpoint=reverse(f"{model.get_base_endpoint()}-list") if hasattr(model, "get_base_endpoint") else None,
|
|
177
|
-
)
|
|
@@ -9,6 +9,8 @@ from wbfdm.models import Instrument
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ChildrenInstrumentModelViewConfig(ButtonViewConfig):
|
|
12
|
+
SHOW_INLINE = True
|
|
13
|
+
|
|
12
14
|
def get_custom_buttons(self) -> set:
|
|
13
15
|
with suppress(Instrument.DoesNotExist):
|
|
14
16
|
instrument = Instrument.objects.get(id=self.view.kwargs.get("instrument_id"))
|
|
@@ -77,6 +77,8 @@ class InstrumentDisplayConfig(DisplayViewConfig):
|
|
|
77
77
|
dp.Field(key="exchange", label=_("Exchange"), show="open"),
|
|
78
78
|
dp.Field(key="isin", label=_("ISIN")),
|
|
79
79
|
dp.Field(key="ticker", label=_("Ticker")),
|
|
80
|
+
dp.Field(key="refinitiv_identifier_code", label=_("RIC")),
|
|
81
|
+
dp.Field(key="refinitiv_mnemonic_code", label=_("Refinitiv Mnemonic")),
|
|
80
82
|
dp.Field(key="description", label=_("Description"), show="open"),
|
|
81
83
|
dp.Field(key="currency", label=_("Currency"), show="open"),
|
|
82
84
|
dp.Field(key="country", label=_("Country"), show="open"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wbfdm
|
|
3
|
-
Version: 1.46.
|
|
3
|
+
Version: 1.46.3
|
|
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.*
|
|
@@ -99,7 +99,7 @@ wbfdm/contrib/qa/dataloaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
99
99
|
wbfdm/contrib/qa/dataloaders/adjustments.py,sha256=DQEexOLA7WyBB1dZJHQd-6zbzyEIURgSSgS7bJRvXzQ,2980
|
|
100
100
|
wbfdm/contrib/qa/dataloaders/corporate_actions.py,sha256=lWT6klrTXKqxiko2HGrxHH8E2C00FJS-AOX3IhglRrI,2912
|
|
101
101
|
wbfdm/contrib/qa/dataloaders/financials.py,sha256=xUHpvhUkvmdPL_RyWCrs7XgChgTklX5qemmaXMedgkY,3475
|
|
102
|
-
wbfdm/contrib/qa/dataloaders/market_data.py,sha256=
|
|
102
|
+
wbfdm/contrib/qa/dataloaders/market_data.py,sha256=QmsqAJG5EZPXwEHPLsj-Nu0ZROpA-GVq0KvyvfcuTk0,6300
|
|
103
103
|
wbfdm/contrib/qa/dataloaders/officers.py,sha256=vytlQJJxmn4Y5HfNh5mHJAvuIrrsQSkNO-sONyhxftY,2940
|
|
104
104
|
wbfdm/contrib/qa/dataloaders/reporting_dates.py,sha256=Wu5nWeu-opbHTnBzKkud7qaMMPiXyCUMqqLi8xDYumE,2493
|
|
105
105
|
wbfdm/contrib/qa/dataloaders/statements.py,sha256=hC6YErJcvBTmaAmzscgeC4sBK3lYE2U5eIKRIE9b_cs,10094
|
|
@@ -139,7 +139,7 @@ wbfdm/filters/exchanges.py,sha256=84N4AQoCwgdnxTxmhMob5Yndfr5gy_DRQ_-m2ilVLVM,83
|
|
|
139
139
|
wbfdm/filters/financials.py,sha256=mYb2nvZo3UWtN7pWQQcug0YMgQ6uEIlDR5GhwID_Um0,2539
|
|
140
140
|
wbfdm/filters/financials_analysis.py,sha256=EiWMWZ9cc3Pm7ySTKRHlM2XmB2NDFBIGKdAWNwDhJ3A,4087
|
|
141
141
|
wbfdm/filters/instrument_prices.py,sha256=_yDyKWwaUIVvsSCJAitILtLdhzschVpkuyi8X8QHpAs,3647
|
|
142
|
-
wbfdm/filters/instruments.py,sha256=
|
|
142
|
+
wbfdm/filters/instruments.py,sha256=EKJDhkgGvwXbu8ejxJgbGn0rma64cwltZhRT1t7pZnM,7695
|
|
143
143
|
wbfdm/filters/utils.py,sha256=p5UsDWaJiHYKxm4WCu2EPfyqK4j2_lZte1uDCbPcxQg,1478
|
|
144
144
|
wbfdm/import_export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
145
145
|
wbfdm/import_export/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -183,7 +183,7 @@ wbfdm/import_export/parsers/refinitiv/utils.py,sha256=i1NVzlbontbn19y7kTGnMnP7rU
|
|
|
183
183
|
wbfdm/import_export/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
184
184
|
wbfdm/import_export/resources/classification.py,sha256=Ngvh7luGyYr-gcFJD7rch9LVt-3C4tnueKST3imgBmU,1051
|
|
185
185
|
wbfdm/import_export/resources/instrument_prices.py,sha256=01Sc-4crwiqAnQI0-ir5RdfsdLS69Uq5hbVtVbEVYso,937
|
|
186
|
-
wbfdm/import_export/resources/instruments.py,sha256=
|
|
186
|
+
wbfdm/import_export/resources/instruments.py,sha256=KK4Vw58-SqbYOpKxH7X0uxsR_H5cUftDnCyrIVKmYIU,4580
|
|
187
187
|
wbfdm/management/__init__.py,sha256=u9-xEgneYh3DvuHceeAMt8mihGXZGp6WIwVxve-6GHA,1265
|
|
188
188
|
wbfdm/migrations/0001_initial.py,sha256=xbAuv-HTzqa8krqSpjRokVptqY8raGrHjwDvKjep4Cw,2742
|
|
189
189
|
wbfdm/migrations/0002_rename_statements_instrumentlookup_financials_and_more.py,sha256=XnIajiZeR6bEvzRZ4TczoE-3xoVJMUQj3hOSC3FOtMM,5441
|
|
@@ -239,7 +239,7 @@ wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=Eza3
|
|
|
239
239
|
wbfdm/models/instruments/mixin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
240
240
|
wbfdm/models/instruments/mixin/financials_computed.py,sha256=L5wjXDsR0maiwfOKP6KyWNJNH4nGOoAjSc_hDM7fsj0,35105
|
|
241
241
|
wbfdm/models/instruments/mixin/financials_serializer_fields.py,sha256=Au3P9LqByh5LGyv8w_miJamtHiEerOGZQhM1NzrfECM,68768
|
|
242
|
-
wbfdm/models/instruments/mixin/instruments.py,sha256=
|
|
242
|
+
wbfdm/models/instruments/mixin/instruments.py,sha256=bT4bpNTgFHtmFhd33CpHczgT2K3bIb8U7khmrVejLyU,15162
|
|
243
243
|
wbfdm/serializers/__init__.py,sha256=AXb03RKHo6B0ts_IQOvx89n9wKG8pxiumYv9cr4EhvA,197
|
|
244
244
|
wbfdm/serializers/esg.py,sha256=epoX8cjkPuVv45aW-Jf85-rSO_ZrSnXcTxMcadKdC-I,1086
|
|
245
245
|
wbfdm/serializers/exchanges.py,sha256=vi5kFadYRQo-6CV2b56nrABpt80LPtjZumJVaBE4bcc,1175
|
|
@@ -250,7 +250,7 @@ wbfdm/serializers/instruments/instrument_lists.py,sha256=M9RnH-Iy095m5xgkVcPHfvK
|
|
|
250
250
|
wbfdm/serializers/instruments/instrument_prices.py,sha256=de-IlwUJC6gSYVztuTmOXQK3r-Gjn8tVWaSCx0PXh_Q,2593
|
|
251
251
|
wbfdm/serializers/instruments/instrument_relationships.py,sha256=3hChFzdekoPtMYolEhWafcb9nTLPmx6WGEq_Hgck8jA,6454
|
|
252
252
|
wbfdm/serializers/instruments/instrument_requests.py,sha256=Sl4gfkUu63zk4o2iGFVE59wx1rKkLUG6SPYCE7Dqrs4,2176
|
|
253
|
-
wbfdm/serializers/instruments/instruments.py,sha256=
|
|
253
|
+
wbfdm/serializers/instruments/instruments.py,sha256=0uxSmbg1CmsfkwLhDsgR9tKKd52R_T5AlnoouEE98W0,11535
|
|
254
254
|
wbfdm/serializers/instruments/mixins.py,sha256=kxvjgi6zgAeIDkryDm3x3VYtiwP-rk4mcI825RsVXWM,4394
|
|
255
255
|
wbfdm/sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
256
256
|
wbfdm/sync/abstract.py,sha256=u1zjHT0ZJabUZpy3_EUCTtEig0p5Fuhlx69O9BsV_Gs,849
|
|
@@ -286,7 +286,7 @@ wbfdm/viewsets/configs/buttons/__init__.py,sha256=anGBjblMGGvyAUblYbnpmUulXQaulG
|
|
|
286
286
|
wbfdm/viewsets/configs/buttons/classifications.py,sha256=sxfwIItdNGoJ1slnbKmWbxgN5nYq3fzVEUfeNFLebII,823
|
|
287
287
|
wbfdm/viewsets/configs/buttons/exchanges.py,sha256=2swv3ORAaYF525mXRpp_3zmEl760FJSKYZfsR1ai8KM,255
|
|
288
288
|
wbfdm/viewsets/configs/buttons/instrument_prices.py,sha256=Tvbbwl8FmXU7vZdhe9n0ICfYO1QkUlw7pD4WSfdSxp0,1873
|
|
289
|
-
wbfdm/viewsets/configs/buttons/instruments.py,sha256=
|
|
289
|
+
wbfdm/viewsets/configs/buttons/instruments.py,sha256=EhNxOu4WNMLwGGnThUjgu8uQa-oSKAmTBk0V7znnlO0,12330
|
|
290
290
|
wbfdm/viewsets/configs/display/__init__.py,sha256=9ogNTPHvsuxPf53snrEGFhEPFqcO1sth5PkPBrqAfng,1024
|
|
291
291
|
wbfdm/viewsets/configs/display/classifications.py,sha256=xolaLg6WDG7Dtwd3gQXWElmyH10GgaT03tL3a3PhKfE,5206
|
|
292
292
|
wbfdm/viewsets/configs/display/esg.py,sha256=NcBZDxkIsGd-APYt4yJRNJjfmbmkC0O-H1q7fg_bBcU,3640
|
|
@@ -295,7 +295,7 @@ wbfdm/viewsets/configs/display/financial_summary.py,sha256=K8CPV9uy0wsK-yLQIDTqM
|
|
|
295
295
|
wbfdm/viewsets/configs/display/instrument_lists.py,sha256=b0dq6py5Cn-_lONc1KXLoZydJ-LgOGpkB23QbLeQYBI,5124
|
|
296
296
|
wbfdm/viewsets/configs/display/instrument_prices.py,sha256=QWDIPxWfgJjqHNB0cEShw1jH7zRkIYhJK9jhTE983EA,6940
|
|
297
297
|
wbfdm/viewsets/configs/display/instrument_requests.py,sha256=CarX1MGe64roHZETm2N4HsEMssHVI5mWw2xTUBjgi-k,5129
|
|
298
|
-
wbfdm/viewsets/configs/display/instruments.py,sha256=
|
|
298
|
+
wbfdm/viewsets/configs/display/instruments.py,sha256=lX2neyAn3zu53ynL-_FYNCwtqyKqe6bw4udCjFGQDSQ,18200
|
|
299
299
|
wbfdm/viewsets/configs/display/instruments_relationships.py,sha256=BLAl2ZciWR5Waf3qPd1QQwdiupgIf_wGK6rmYe9byuY,2480
|
|
300
300
|
wbfdm/viewsets/configs/display/monthly_performances.py,sha256=ESsGTLhPmmXz3YjEWNjwaOjA1RNzVDKtJt3JILL2MMc,2973
|
|
301
301
|
wbfdm/viewsets/configs/display/officers.py,sha256=qUwN9HPSSlT85aUSFNY-30550P35j3RZCYqRPj_rFAs,654
|
|
@@ -350,6 +350,6 @@ wbfdm/viewsets/statements/__init__.py,sha256=odxtFYUDICPmz8WCE3nx93EvKZLSPBEI4d7
|
|
|
350
350
|
wbfdm/viewsets/statements/statements.py,sha256=kmtM0uZ3f7eJJe5gVmd-iVra9dHwTB9x12p7f5qTEx8,4084
|
|
351
351
|
wbfdm/viewsets/technical_analysis/__init__.py,sha256=qtCIBg0uSiZeJq_1tEQFilnorMBkMe6uCMfqar6-cLE,77
|
|
352
352
|
wbfdm/viewsets/technical_analysis/monthly_performances.py,sha256=O1j8CGfOranL74LqVvcf7jERaDIboEJZiBf_AbbVDQ8,3974
|
|
353
|
-
wbfdm-1.46.
|
|
354
|
-
wbfdm-1.46.
|
|
355
|
-
wbfdm-1.46.
|
|
353
|
+
wbfdm-1.46.3.dist-info/METADATA,sha256=j6SZfgbuA581w5GErurpLGXuu_ChUqIkZhQJe4tA1_w,737
|
|
354
|
+
wbfdm-1.46.3.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
|
355
|
+
wbfdm-1.46.3.dist-info/RECORD,,
|
|
File without changes
|