artesian-sdk 4.2.2.dev2__py3-none-any.whl → 4.2.2.dev12__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.
@@ -2,7 +2,9 @@ from dataclasses import dataclass
2
2
  from datetime import datetime
3
3
  from typing import Dict, List, Optional
4
4
  from dateutil import tz
5
+
5
6
  from Artesian.MarketData._Dto import MarketDataIdentifier
7
+ from .._Enum import UpsertMode
6
8
 
7
9
 
8
10
  @dataclass
@@ -104,6 +106,7 @@ class UpsertData:
104
106
  deferDataGeneration: flag to choose between synchronous
105
107
  and asynchronous data generation (MUV)
106
108
  keepNulls: when false, nulls are discarded client side and not sent
109
+ upsertMode: Merge or Replace, when None/Merge then data is merged with existing data
107
110
  """
108
111
 
109
112
  ID: MarketDataIdentifier
@@ -117,3 +120,4 @@ class UpsertData:
117
120
  deferCommandExecution: bool = False
118
121
  deferDataGeneration: bool = True
119
122
  keepNulls: bool = False
123
+ upsertMode: Optional[UpsertMode] = None
@@ -0,0 +1,6 @@
1
+ from enum import Enum
2
+
3
+
4
+ class UpsertMode(Enum):
5
+ Merge = 0
6
+ Replace = 1
@@ -3,6 +3,7 @@ from ...Granularity import Granularity
3
3
  from .MarketDataType import MarketDataType
4
4
  from .ArtesianMetadataFacetType import ArtesianMetadataFacetType
5
5
  from .DerivedAlgorithm import DerivedAlgorithm
6
+ from .UpsertMode import UpsertMode
6
7
 
7
8
  __all__ = [
8
9
  AggregationRule.__name__,
@@ -10,4 +11,5 @@ __all__ = [
10
11
  MarketDataType.__name__,
11
12
  ArtesianMetadataFacetType.__name__,
12
13
  DerivedAlgorithm.__name__,
14
+ UpsertMode.__name__
13
15
  ] # type: ignore
Artesian/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '4.2.2.dev2'
32
- __version_tuple__ = version_tuple = (4, 2, 2, 'dev2')
31
+ __version__ = version = '4.2.2.dev12'
32
+ __version_tuple__ = version_tuple = (4, 2, 2, 'dev12')
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: artesian-sdk
3
- Version: 4.2.2.dev2
3
+ Version: 4.2.2.dev12
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>
@@ -783,8 +783,19 @@ data = MarketData.UpsertData(mkdid, 'CET',
783
783
  )
784
784
 
785
785
  mkservice.upsertData(data)
786
+ ```
786
787
 
788
+ Upsert has optional switches that can be applied
789
+ ```
790
+ mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
787
791
  ```
792
+ The switch details are,
793
+
794
+ deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
795
+ deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
796
+ keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
797
+ upsertMode (Merge/Replace) for ActualTimeSeries the two modes are equivalent. Leaving Null/None/Empty is equivalent to Merge.
798
+
788
799
 
789
800
  DerivedCfg can be of algorithm type: Coalesce, Sum, Muv.
790
801
 
@@ -884,6 +895,37 @@ mkservice.upsertData(data)
884
895
 
885
896
  ```
886
897
 
898
+ Upsert has optional switches that can be applied
899
+ ```
900
+ mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
901
+ ```
902
+ The switch details are,
903
+
904
+ deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
905
+ deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
906
+ keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
907
+ upsertMode (Merge/Replace) for VersionedTimeSeries the merge writes in to the curve replacing existing data for an existing instant, replace writes the payload removing any previous data for the version. Leaving Null/None/Empty is equivalent to Merge.
908
+
909
+ | DATETIME | EXISTING | PAYLOAD | MERGE | REPALACE |
910
+ |---|---|---|---|---|
911
+ | VERSION NAME | 2025-01-01 | 2025-01-01 | 2025-01-01 | 2025-01-01 |
912
+ | 2025-01-01 | | | | |
913
+ | 2025-01-02 | 999.99 | 222.22 | 222.22 | 222.22 |
914
+ | 2025-01-03 | 999.99 | 222.22 | 222.22 | 222.22 |
915
+ | 2025-01-04 | 999.99 | 222.22 | 222.22 | 222.22 |
916
+ | 2025-01-05 | 999.99 | 222.22 | 222.22 | 222.22 |
917
+ | 2025-01-06 | 999.99 | 222.22 | 222.22 | 222.22 |
918
+ | 2025-01-07 | 999.99 | 222.22 | 222.22 | 222.22 |
919
+ | 2025-01-08 | | 222.22 | 222.22 | 222.22 |
920
+ | 2025-01-09 | | | | |
921
+ | 2025-01-10 | | | | |
922
+ | 2025-01-11 | 999.99 | | 999.99 | |
923
+ | 2025-01-12 | 999.99 | | 999.99 | |
924
+ | 2025-01-13 | 999.99 | | 999.99 | |
925
+ | 2025-01-14 | | | | |
926
+ | 2025-01-15 | | | | |
927
+
928
+
887
929
  ### Write Data in a Market Assessment Time Series
888
930
 
889
931
  ```Python
@@ -931,6 +973,18 @@ mkservice.upsertData(marketAssessment)
931
973
 
932
974
  ```
933
975
 
976
+ Upsert has optional switches that can be applied
977
+ ```
978
+ mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
979
+ ```
980
+ The switch details are,
981
+
982
+ deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
983
+ deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
984
+ keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
985
+ upsertMode (Merge/Replace) for MarketAssessment merge adds the new products to the existing and overwrites existing with the new ones while replace replaces all the existing products with the new ones. Leaving Null/None/Empty is equivalent to Merge.
986
+
987
+
934
988
  ### Write Data in a Bid Ask Time Series
935
989
 
936
990
  ```Python
@@ -977,6 +1031,18 @@ bidAsk = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER', 'MARK
977
1031
  mkservice.upsertData(bidAsk)
978
1032
  ```
979
1033
 
1034
+ Upsert has optional switches that can be applied
1035
+ ```
1036
+ mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
1037
+ ```
1038
+ The switch details are,
1039
+
1040
+ deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
1041
+ deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
1042
+ keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
1043
+ upsertMode (Merge/Replace) for BidAsk merge adds the new products to the existing and overwrites existing with the new ones while replace replaces all the existing products with the new ones. Leaving Null/None/Empty is equivalent to Merge.
1044
+
1045
+
980
1046
  ### Write Data in an Auction Time Series
981
1047
 
982
1048
  ```Python
@@ -1021,8 +1087,19 @@ auctionRows = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER',
1021
1087
 
1022
1088
  mkservice.upsertData(auctionRows)
1023
1089
 
1090
+ ```
1024
1091
 
1092
+ Upsert has optional switches that can be applied
1025
1093
  ```
1094
+ mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
1095
+ ```
1096
+ The switch details are,
1097
+
1098
+ deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
1099
+ deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
1100
+ keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
1101
+ upsertMode (Merge/Replace) for Auction merge and replace are equivalent. Leaving Null/None/Empty is equivalent to Merge.
1102
+
1026
1103
 
1027
1104
  ## Delete Data in Artesian
1028
1105
 
@@ -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=c-Fu4VGOuvQCGRefF5C4CY9OxoGTDce7CgjipZN8lIo,1119
7
- Artesian/_version.py,sha256=okjYkL3eRro8MybmD00XtTcXNtJLhlGW1t4nzg9LkfM,717
7
+ Artesian/_version.py,sha256=RXYMDcb_s5g4k--ioMmgAT40gVAvn2AwBO_r3RyKsi0,719
8
8
  Artesian/GMEPublicOffers/ExtractionRangeConfig.py,sha256=pXVFdLpLqFvgzu2Y5UTckDWysFiJDKc0ZaXjuv46iJU,415
9
9
  Artesian/GMEPublicOffers/GMEPublicOfferQuery.py,sha256=IECU7nk6wN7alLIxiUQmPUWaeXWsoSDC1R9qv5JMjYI,15367
10
10
  Artesian/GMEPublicOffers/GMEPublicOfferQueryParameters.py,sha256=gs5SVNEYJTpwV9whZFw07jm5cIsion6TvgRDAeHj1Kw,3330
@@ -33,13 +33,14 @@ Artesian/MarketData/_Dto/MarketDataEntityOutput.py,sha256=TKV4n0aBZzInFVY_yI8UAS
33
33
  Artesian/MarketData/_Dto/MarketDataIdentifier.py,sha256=egNOuOI3qugbFl8_w3IUSV9mOdBj-akq7M4Gj0X4Ig8,289
34
34
  Artesian/MarketData/_Dto/PagedResult.py,sha256=-o0zKOLTbLg2wdz8K4K4qQJTkarEl-4SYppS6cf6j2o,736
35
35
  Artesian/MarketData/_Dto/UnitOfMeasure.py,sha256=B6Axt5wxMhLsjdXIiK0K912REmbCaZcaxWMImxEjXXY,304
36
- Artesian/MarketData/_Dto/UpsertData.py,sha256=qMEULDYcXG4s44P8jrBLFExPF4Ad4sVCgsKz6oMbO9U,3829
36
+ Artesian/MarketData/_Dto/UpsertData.py,sha256=abIA7kQTW-9u3D-sjgv7mMEiY6UCARnj8Z1dMNYc8hM,3998
37
37
  Artesian/MarketData/_Dto/__init__.py,sha256=iTYvyR14J0tq7iuj-zQtn9xO1W1eJCX1GzsDvGrMkhQ,1289
38
38
  Artesian/MarketData/_Enum/AggregationRule.py,sha256=fkYmouBQwC68rFMyG_j-D_0IQA5JVrJRfSA7KxsCF-4,120
39
39
  Artesian/MarketData/_Enum/ArtesianMetadataFacetType.py,sha256=1wE9VOzZ4gHk5oBjwpJd_kCgrUIfyNQmxuOZevj4f28,92
40
40
  Artesian/MarketData/_Enum/DerivedAlgorithm.py,sha256=m64IQxmlyGPghLuTKaBAE6Y5afYBJdYofp8z0FQbASw,95
41
41
  Artesian/MarketData/_Enum/MarketDataType.py,sha256=lIXV21b1wNWEah0q76OD4bMV1n_dtsUHQNSr8SbTBcE,159
42
- Artesian/MarketData/_Enum/__init__.py,sha256=wdXoxKaDXNiMqeNAQg8UZH8EGp2I8Bea9PiYHrbjVNg,426
42
+ Artesian/MarketData/_Enum/UpsertMode.py,sha256=UuAMKcvehXN8pagJ-UtadbVIer7mjJaYOoEop-QjvrU,78
43
+ Artesian/MarketData/_Enum/__init__.py,sha256=7YM19VPx7kz7prHe3fHj23aF3efievZziaND50AxKUA,485
43
44
  Artesian/Query/ActualQuery.py,sha256=R3rKa8RAlximWhjflUh5M5SkAA_mlt-p6okFb31aN3c,10554
44
45
  Artesian/Query/AuctionQuery.py,sha256=Ns9e1YhY-Gaj35pMIOtVPhMmFYn0fnh_LufKIOnM27E,5087
45
46
  Artesian/Query/BidAskQuery.py,sha256=0KOeEX5C-GAlIMpEzpWguqW4zpFr7tyryWyGmUFU-lI,8125
@@ -67,8 +68,8 @@ Artesian/_ClientsExecutor/ArtesianJsonSerializer.py,sha256=CDnq1sgKLvxSampykFtF9
67
68
  Artesian/_ClientsExecutor/Client.py,sha256=AYVMOj9mf3QmCY1vmWzHQA4WRL2zqCB-yhE5XRfk8RE,3833
68
69
  Artesian/_ClientsExecutor/RequestExecutor.py,sha256=KKq31g8GFS-Mdp3S1QXFm5tZhacjnIeWs1YFc3f8NkY,10613
69
70
  Artesian/_ClientsExecutor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
- artesian_sdk-4.2.2.dev2.dist-info/licenses/LICENSE,sha256=Y27w-dSf1pHlXO4yNy70OCCO4VuYYVxUdDOQ-sLdXds,1074
71
- artesian_sdk-4.2.2.dev2.dist-info/METADATA,sha256=OORtvJNkAuTqyBLZUG04gAaw3REUh57xGOFkM3h9sKA,33761
72
- artesian_sdk-4.2.2.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- artesian_sdk-4.2.2.dev2.dist-info/top_level.txt,sha256=1Fv89OOnRKHLMmQEBRXPaNuPMoZytK4dnfrOFDdGGYI,9
74
- artesian_sdk-4.2.2.dev2.dist-info/RECORD,,
71
+ artesian_sdk-4.2.2.dev12.dist-info/licenses/LICENSE,sha256=Y27w-dSf1pHlXO4yNy70OCCO4VuYYVxUdDOQ-sLdXds,1074
72
+ artesian_sdk-4.2.2.dev12.dist-info/METADATA,sha256=jIrJz9VFCaDKwZlU6Udf1Df7G_NweKAQcvS6Tgx3Uvc,38369
73
+ artesian_sdk-4.2.2.dev12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
+ artesian_sdk-4.2.2.dev12.dist-info/top_level.txt,sha256=1Fv89OOnRKHLMmQEBRXPaNuPMoZytK4dnfrOFDdGGYI,9
75
+ artesian_sdk-4.2.2.dev12.dist-info/RECORD,,