artesian-sdk 3.1.4.dev2__py3-none-any.whl → 3.1.4.dev10__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.
@@ -1,5 +1,7 @@
1
1
  from __future__ import annotations
2
2
  from typing import List, Optional, cast, Dict
3
+
4
+ from Artesian.MarketData._Dto import DeleteData
3
5
  from .._ClientsExecutor.RequestExecutor import _RequestExecutor
4
6
  from .._ClientsExecutor.Client import _Client
5
7
  from ..ArtesianConfig import ArtesianConfig
@@ -399,6 +401,15 @@ class MarketDataService:
399
401
  def upsertData(self: MarketDataService, data: UpsertData) -> None:
400
402
  return _get_event_loop().run_until_complete(self.upsertDataAsync(data))
401
403
 
404
+ async def deleteDataAsync(self: MarketDataService, data: DeleteData) -> None:
405
+ url = "/marketdata/deletedata"
406
+ with self.__client as c:
407
+ await asyncio.gather(*[self.__executor.exec(c.exec, "POST", url, data)])
408
+ return None
409
+
410
+ def deleteData(self: MarketDataService, data: DeleteData) -> None:
411
+ return _get_event_loop().run_until_complete(self.deleteDataAsync(data))
412
+
402
413
 
403
414
  def _get_event_loop() -> asyncio.AbstractEventLoop:
404
415
  """
@@ -0,0 +1,34 @@
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from typing import List, Optional
4
+ from Artesian.MarketData._Dto import MarketDataIdentifier
5
+
6
+
7
+ @dataclass
8
+ class DeleteData:
9
+ """
10
+ Class for the Delete Data.
11
+
12
+ Attributes:
13
+ ID: the MarketDataIdentifier
14
+ timezone: the Timezone of the rows. Must be the OriginalTimezone
15
+ when writing Dates or must be ""UTC"" when writing Times
16
+ rangeStart: LocalDateTime start of the range to be deleted
17
+ rangeEnd: LocalDateTime end of the range to be deleted
18
+ product: The list of Product. Only *,
19
+ is special character for 'delete all products in the range'
20
+ version: the Version to operate on
21
+ deferCommandExecution: flag to choose between synchronous
22
+ and asynchronous command execution
23
+ deferDataGeneration: flag to choose between synchronous
24
+ and asynchronous data generation (MUV)
25
+ """
26
+
27
+ ID: MarketDataIdentifier
28
+ timezone: str
29
+ rangeStart: datetime
30
+ rangeEnd: datetime
31
+ product: Optional[List[str]] = None
32
+ version: Optional[datetime] = None
33
+ deferCommandExecution: bool = False
34
+ deferDataGeneration: bool = True
@@ -12,6 +12,7 @@ from .UpsertData import (
12
12
  MarketAssessmentValue,
13
13
  UpsertData,
14
14
  )
15
+ from .DeleteData import DeleteData
15
16
 
16
17
  __all__ = [
17
18
  MarketDataEntityOutput.__name__,
@@ -24,6 +25,7 @@ __all__ = [
24
25
  BidAskValue.__name__,
25
26
  MarketAssessmentValue.__name__,
26
27
  UpsertData.__name__,
28
+ DeleteData.__name__,
27
29
  ArtesianSearchResults.__name__,
28
30
  ArtesianMetadataFacet.__name__,
29
31
  ArtesianMetadataFacetCount.__name__,
@@ -14,6 +14,7 @@ from ._Dto import (
14
14
  MarketDataEntityOutput,
15
15
  MarketDataIdentifier,
16
16
  UpsertData,
17
+ DeleteData,
17
18
  PagedResultCurveRangeEntity,
18
19
  ArtesianSearchResults,
19
20
  ArtesianMetadataFacet,
@@ -35,6 +36,7 @@ __all__ = [
35
36
  MarketDataEntityOutput.__name__,
36
37
  MarketDataIdentifier.__name__,
37
38
  UpsertData.__name__,
39
+ DeleteData.__name__,
38
40
  ArtesianSearchResults.__name__,
39
41
  ArtesianMetadataFacet.__name__,
40
42
  ArtesianMetadataFacetCount.__name__,
Artesian/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '3.1.4.dev2'
16
- __version_tuple__ = version_tuple = (3, 1, 4, 'dev2')
15
+ __version__ = version = '3.1.4.dev10'
16
+ __version_tuple__ = version_tuple = (3, 1, 4, 'dev10')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: artesian-sdk
3
- Version: 3.1.4.dev2
3
+ Version: 3.1.4.dev10
4
4
  Summary: Library provides read access to the Artesian API
5
5
  Author-email: ARK Lab <arklab@ark-energy.eu>
6
6
  Maintainer-email: ARK Lab <arklab@ark-energy.eu>
@@ -419,6 +419,48 @@ Latest Value to propagate the latest value, not older than a certain threshold e
419
419
  .withFillLatestValue("P5D", "True")
420
420
  ```
421
421
 
422
+ ### Query written Versions or Products
423
+
424
+ Using MarketDataService is possible to query all the Versions and all the Products curves which has been written in a MarketData.
425
+
426
+ ```Python
427
+ from Artesian.MarketData import MarketDataService
428
+
429
+ mds = MarketDataService(cfg)
430
+
431
+ ```
432
+
433
+ To list MarketData curves
434
+
435
+ ```Python
436
+ page = 1
437
+ pageSize = 100
438
+ res = mds.readCurveRange(100042422, page, pageSize, versionFrom="2016-12-20" , versionTo="2019-03-12")
439
+ ```
440
+
441
+ ### Search the MarketData collection with faceted results
442
+
443
+ Using MarketDataService is possible to query and search the MarketData collection with faceted results. Supports paging, filtering and free text.
444
+
445
+ ```Python
446
+ from Artesian.MarketData import MarketDataService
447
+
448
+ mds = MarketDataService(cfg)
449
+
450
+ ```
451
+
452
+ To list MarketData curves
453
+
454
+ ```Python
455
+ page = 1
456
+ pageSize = 100
457
+ searchText = "Riconsegnato_"
458
+ filters = {"ProviderName": ["SNAM", "France"]}
459
+ sorts=["MarketDataId asc"]
460
+ doNotLoadAdditionalInfo=True
461
+ res = mds.searchFacet(page, pageSize, searchText, filters, sorts, doNotLoadAdditionalInfo)
462
+ ```
463
+
422
464
  ## GME Public Offer
423
465
 
424
466
  Artesian support Query over GME Public Offers which comes in a custom and dedicated format.
@@ -799,6 +841,11 @@ auctionRows = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER',
799
841
 
800
842
  ```
801
843
 
844
+
845
+ ## Delete Data in Artesian
846
+
847
+ Using the MarketDataService is possible to delete MarketData and its curves.
848
+
802
849
  ### Delete MarketData in Artesian
803
850
 
804
851
  Using the MarketDataService is possible to delete MarketData and its curves.
@@ -815,46 +862,120 @@ mkservice.deleteMarketData(100042422)
815
862
 
816
863
  ```
817
864
 
818
- ### Query written Versions or Products
865
+ Depending on the Type of the MarketData, the DeletData should be composed as per example below.
819
866
 
820
- Using MarketDataService is possible to query all the Versions and all the Products curves which has been written in a MarketData.
867
+ ### Delete Data in an Actual Time Series
821
868
 
822
869
  ```Python
823
- from Artesian.MarketData import MarketDataService
870
+ from Artesian import ArtesianConfig, Granularity, MarketData
871
+ from Artesian.MarketData import AggregationRule
872
+ from datetime import datetime
873
+ from dateutil import tz
824
874
 
825
- mds = MarketDataService(cfg)
875
+ cfg = ArtesianConfg()
826
876
 
877
+ mkservice = MarketData.MarketDataService(cfg)
878
+
879
+ mkdid = MarketData.MarketDataIdentifier('PROVIDER', 'MARKETDATANAME')
880
+ deleteData = MarketData.DeleteData(
881
+ ID=mkdid,
882
+ timezone='CET',
883
+ rangeStart=datetime(2020, 1, 1, 6),
884
+ rangeEnd=datetime(2020, 1, 1, 18),
885
+ )
886
+
887
+ mkdservice.deleteData(deleteData)
827
888
  ```
828
889
 
829
- To list MarketData curves
890
+ ### Delete Data in an Versioned Time Series
830
891
 
831
892
  ```Python
832
- page = 1
833
- pageSize = 100
834
- res = mds.readCurveRange(100042422, page, pageSize, versionFrom="2016-12-20" , versionTo="2019-03-12")
893
+ from Artesian import ArtesianConfig, Granularity, MarketData
894
+ from Artesian.MarketData import AggregationRule
895
+ from datetime import datetime
896
+ from dateutil import tz
897
+
898
+ cfg = ArtesianConfg()
899
+
900
+ mkservice = MarketData.MarketDataService(cfg)
901
+
902
+ mkdid = MarketData.MarketDataIdentifier('PROVIDER', 'MARKETDATANAME')
903
+ deleteData = MarketData.DeleteData(
904
+ ID=mkdid,
905
+ timezone='CET',
906
+ rangeStart=datetime(2020, 1, 1, 0),
907
+ rangeEnd=datetime(2020, 1, 7, 0),
908
+ version=datetime(2020, 1, 1, 0)
909
+ )
910
+
911
+ mkdservice.deleteData(deleteData)
835
912
  ```
836
913
 
837
- ### Search the MarketData collection with faceted results
914
+ ### Delte Data in a Market Assessment Time Series
838
915
 
839
- Using MarketDataService is possible to query and search the MarketData collection with faceted results. Supports paging, filtering and free text.
916
+ ```Python
917
+ from Artesian import ArtesianConfig, Granularity, MarketData
918
+ from datetime import datetime
919
+ from dateutil import tz
920
+
921
+ cfg = ArtesianConfg()
922
+ mkservice = MarketData.MarketDataService(cfg)
923
+
924
+ mkdid = MarketData.MarketDataIdentifier('PROVIDER', 'MARKETDATANAME')
925
+ deleteData = MarketData.DeleteData(
926
+ ID= mkdid,
927
+ timezone='CET',
928
+ rangeStart=datetime(2020, 1, 1, 0),
929
+ rangeEnd=datetime(2020, 1, 3, 0),
930
+ product=["Feb-20"]
931
+ )
932
+
933
+ mkdservice.deleteData(deleteData)
934
+ ```
935
+
936
+ ### Delte Data in a Bid Ask Time Series
840
937
 
841
938
  ```Python
842
- from Artesian.MarketData import MarketDataService
939
+ from Artesian import ArtesianConfig, Granularity, MarketData
940
+ from datetime import datetime
941
+ from dateutil import tz
843
942
 
844
- mds = MarketDataService(cfg)
943
+ cfg = ArtesianConfg()
944
+ mkservice = MarketData.MarketDataService(cfg)
945
+
946
+ mkdid = MarketData.MarketDataIdentifier('PROVIDER', 'MARKETDATANAME')
947
+ deleteData = MarketData.DeleteData(
948
+ ID= mkdid,
949
+ timezone='CET',
950
+ rangeStart=datetime(2020, 1, 1, 0),
951
+ rangeEnd=datetime(2020, 1, 3, 0),
952
+ product=["Feb-20"]
953
+ )
845
954
 
955
+ mkdservice.deleteData(deleteData)
846
956
  ```
847
957
 
848
- To list MarketData curves
958
+ ### Delete Data in an Auction Time Series
849
959
 
850
960
  ```Python
851
- page = 1
852
- pageSize = 100
853
- searchText = "Riconsegnato_"
854
- filters = {"ProviderName": ["SNAM", "France"]}
855
- sorts=["MarketDataId asc"]
856
- doNotLoadAdditionalInfo=True
857
- res = mds.searchFacet(page, pageSize, searchText, filters, sorts, doNotLoadAdditionalInfo)
961
+ from Artesian import ArtesianConfig, Granularity, MarketData
962
+ from Artesian.MarketData import AggregationRule
963
+ from datetime import datetime
964
+ from dateutil import tz
965
+
966
+ cfg = ArtesianConfg()
967
+
968
+ mkservice = MarketData.MarketDataService(cfg)
969
+
970
+ mkdid = MarketData.MarketDataIdentifier('PROVIDER', 'MARKETDATANAME')
971
+ deleteData = MarketData.DeleteData(
972
+ ID=mkdid,
973
+ timezone='CET',
974
+ rangeStart=datetime(2020, 1, 1, 6),
975
+ rangeEnd=datetime(2020, 1, 1, 18),
976
+ )
977
+
978
+ mkdservice.deleteData(deleteData)
858
979
  ```
859
980
 
860
981
  ## Jupyter Support
@@ -4,7 +4,7 @@ Artesian/ArtesianPolicyConfig.py,sha256=ULLngwH1762K8Kre08_JZ7aNYs4LZOxocTYLPJjX
4
4
  Artesian/Exceptions.py,sha256=asPwxz8TaIpjZV4GJmWchGen_04Ib3Rdd7_Btud4X9E,6141
5
5
  Artesian/Granularity.py,sha256=EOeBP9Wz-tAhdm3rVVJBXx9jAkiMH9OIMJUsrNawsNU,206
6
6
  Artesian/__init__.py,sha256=iptHA43Sm3XKYvast5wUH1lrWs5sDfQEo4niZNuONaQ,1120
7
- Artesian/_version.py,sha256=hI4yaN4B-sfkVpgS1AqSatveblrVT1XjSOr0hSw5T6Q,424
7
+ Artesian/_version.py,sha256=Vfu1N6S8XP2m6aEcD45n1HdKtDSYxa1lKBTWSns7Yio,426
8
8
  Artesian/GMEPublicOffers/ExtractionRangeConfig.py,sha256=pXVFdLpLqFvgzu2Y5UTckDWysFiJDKc0ZaXjuv46iJU,415
9
9
  Artesian/GMEPublicOffers/GMEPublicOfferQuery.py,sha256=qG4Iw1CoCN9plftcQvA0a2LBNhZK3qhkmxSkv5XOqTM,15292
10
10
  Artesian/GMEPublicOffers/GMEPublicOfferQueryParameters.py,sha256=vG2MXW5HmT9gaIQnJvwDd26Oq-c-qNzoIwlUkSosJDE,3325
@@ -19,17 +19,18 @@ Artesian/GMEPublicOffers/_Enum/Status.py,sha256=wJ6d7Lbr30EbPRUnnhCkCXeF1-d3MSYw
19
19
  Artesian/GMEPublicOffers/_Enum/UnitType.py,sha256=PukftC_s7BTYQmHa-LNgz7G-QliPci7mod8DX0dWTDQ,109
20
20
  Artesian/GMEPublicOffers/_Enum/Zone.py,sha256=-Wd_QmOIDsg1NPeb8dr3GfqjnKGquiQxPP0P7t724fk,352
21
21
  Artesian/GMEPublicOffers/_Enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- Artesian/MarketData/MarketDataService.py,sha256=8U2gJKAHQE953b3nmn5yWcN848-3ePewl41BTCXZfTA,13721
23
- Artesian/MarketData/__init__.py,sha256=SgIYI0WDlobKj97sS8iAU4u9iBiYFYeoaxohLRBNwrI,1226
22
+ Artesian/MarketData/MarketDataService.py,sha256=SV4TQQ-vE-uIRRkHesP9Mqb6Z6LxgUtRCdRV4Ozq6jc,14186
23
+ Artesian/MarketData/__init__.py,sha256=mm42mCexlAz9XPKSBvfDAqw8laeBpHhuXaT9qEp8wqo,1267
24
24
  Artesian/MarketData/_Dto/ArtesianMetadataFacet.py,sha256=Ib9YYpGp1_6LdHy2WjL5pUlUVNNGQiyXfCUeh6t5ky4,800
25
25
  Artesian/MarketData/_Dto/ArtesianSearchResults.py,sha256=nazdj1G4jpOUhn1irML3Duafp4I0kNhyfnZZzL4496k,581
26
26
  Artesian/MarketData/_Dto/CurveRangeEntity.py,sha256=_zjXxuueNoIG4Xg1K-5TeJQBF0ejcDpFkvW5R9siby8,891
27
+ Artesian/MarketData/_Dto/DeleteData.py,sha256=yluM_oUDqfRcElyxPtYjVcb7eT5FhjOy8MLFodDS-3Y,1248
27
28
  Artesian/MarketData/_Dto/MarketDataEntityInput.py,sha256=sgHyJFOPy8n3atQOvVOHHRsIbP1NkrEbD85WKvuYwkM,1522
28
29
  Artesian/MarketData/_Dto/MarketDataEntityOutput.py,sha256=qYOyj6GJ9Lnbb6zT27ulkEW3sVmRTZKKKf0owOBGxX4,1755
29
30
  Artesian/MarketData/_Dto/MarketDataIdentifier.py,sha256=egNOuOI3qugbFl8_w3IUSV9mOdBj-akq7M4Gj0X4Ig8,289
30
31
  Artesian/MarketData/_Dto/PagedResult.py,sha256=-o0zKOLTbLg2wdz8K4K4qQJTkarEl-4SYppS6cf6j2o,736
31
32
  Artesian/MarketData/_Dto/UpsertData.py,sha256=qMEULDYcXG4s44P8jrBLFExPF4Ad4sVCgsKz6oMbO9U,3829
32
- Artesian/MarketData/_Dto/__init__.py,sha256=f55zO7HJXWVr2v8Jwa6I0POmIEllpjXStvwzdiCFrsk,1007
33
+ Artesian/MarketData/_Dto/__init__.py,sha256=3XiJ8kDLdspfsFbQlq9KmLMai5D-poXWJI36d-UKvWE,1067
33
34
  Artesian/MarketData/_Enum/AggregationRule.py,sha256=fkYmouBQwC68rFMyG_j-D_0IQA5JVrJRfSA7KxsCF-4,120
34
35
  Artesian/MarketData/_Enum/ArtesianMetadataFacetType.py,sha256=1wE9VOzZ4gHk5oBjwpJd_kCgrUIfyNQmxuOZevj4f28,92
35
36
  Artesian/MarketData/_Enum/MarketDataType.py,sha256=lIXV21b1wNWEah0q76OD4bMV1n_dtsUHQNSr8SbTBcE,159
@@ -61,8 +62,8 @@ Artesian/_ClientsExecutor/ArtesianJsonSerializer.py,sha256=ACYTfCF1orE9j3BEureiO
61
62
  Artesian/_ClientsExecutor/Client.py,sha256=AYVMOj9mf3QmCY1vmWzHQA4WRL2zqCB-yhE5XRfk8RE,3833
62
63
  Artesian/_ClientsExecutor/RequestExecutor.py,sha256=KKq31g8GFS-Mdp3S1QXFm5tZhacjnIeWs1YFc3f8NkY,10613
63
64
  Artesian/_ClientsExecutor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- artesian_sdk-3.1.4.dev2.dist-info/LICENSE,sha256=Y27w-dSf1pHlXO4yNy70OCCO4VuYYVxUdDOQ-sLdXds,1074
65
- artesian_sdk-3.1.4.dev2.dist-info/METADATA,sha256=VDAyKmtF1yBsIfyw1m4GXY5yblZXVi8gMuGsv7EDAIc,23828
66
- artesian_sdk-3.1.4.dev2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
67
- artesian_sdk-3.1.4.dev2.dist-info/top_level.txt,sha256=1Fv89OOnRKHLMmQEBRXPaNuPMoZytK4dnfrOFDdGGYI,9
68
- artesian_sdk-3.1.4.dev2.dist-info/RECORD,,
65
+ artesian_sdk-3.1.4.dev10.dist-info/LICENSE,sha256=Y27w-dSf1pHlXO4yNy70OCCO4VuYYVxUdDOQ-sLdXds,1074
66
+ artesian_sdk-3.1.4.dev10.dist-info/METADATA,sha256=3ixlFxlmvl835wLBZJ5jOiiPgWfrCasbjiuMpgINJxA,26763
67
+ artesian_sdk-3.1.4.dev10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
+ artesian_sdk-3.1.4.dev10.dist-info/top_level.txt,sha256=1Fv89OOnRKHLMmQEBRXPaNuPMoZytK4dnfrOFDdGGYI,9
69
+ artesian_sdk-3.1.4.dev10.dist-info/RECORD,,