artesian-sdk 4.2.3.dev43__py3-none-any.whl → 4.3.1.dev1__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.
- Artesian/MarketData/MarketDataService.py +49 -0
- Artesian/MarketData/_Dto/DerivedCfg.py +2 -1
- Artesian/MarketData/_Dto/DerivedTransformQueryValidation.py +34 -0
- Artesian/MarketData/_Dto/DerivedTransformQueryValidationResponse.py +30 -0
- Artesian/MarketData/_Dto/MarketDataEntityInput.py +25 -1
- Artesian/MarketData/_Dto/TimeSerieData.py +22 -0
- Artesian/MarketData/_Dto/__init__.py +2 -0
- Artesian/MarketData/_Enum/DerivedAlgorithm.py +1 -0
- Artesian/_ClientsExecutor/Client.py +2 -2
- Artesian/_version.py +2 -2
- {artesian_sdk-4.2.3.dev43.dist-info → artesian_sdk-4.3.1.dev1.dist-info}/METADATA +127 -27
- {artesian_sdk-4.2.3.dev43.dist-info → artesian_sdk-4.3.1.dev1.dist-info}/RECORD +15 -12
- {artesian_sdk-4.2.3.dev43.dist-info → artesian_sdk-4.3.1.dev1.dist-info}/WHEEL +0 -0
- {artesian_sdk-4.2.3.dev43.dist-info → artesian_sdk-4.3.1.dev1.dist-info}/licenses/LICENSE +0 -0
- {artesian_sdk-4.2.3.dev43.dist-info → artesian_sdk-4.3.1.dev1.dist-info}/top_level.txt +0 -0
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
from typing import List, Optional, cast, Dict
|
|
3
3
|
|
|
4
4
|
from Artesian.MarketData._Dto import DeleteData
|
|
5
|
+
from Artesian.MarketData._Dto.DerivedTransformQueryValidation import DerivedTransformQueryValidation
|
|
6
|
+
from Artesian.MarketData._Dto.DerivedTransformQueryValidationResponse import DerivedTransformQueryValidationResponse
|
|
5
7
|
from ._Dto.DerivedCfg import DerivedCfg
|
|
6
8
|
from .._ClientsExecutor.RequestExecutor import _RequestExecutor
|
|
7
9
|
from .._ClientsExecutor.Client import _Client
|
|
@@ -534,6 +536,53 @@ class MarketDataService:
|
|
|
534
536
|
def deleteData(self: MarketDataService, data: DeleteData) -> None:
|
|
535
537
|
return _get_event_loop().run_until_complete(self.deleteDataAsync(data))
|
|
536
538
|
|
|
539
|
+
async def derivedTransformQueryValidationAsync(
|
|
540
|
+
self: MarketDataService,
|
|
541
|
+
request: DerivedTransformQueryValidation
|
|
542
|
+
) -> DerivedTransformQueryValidationResponse:
|
|
543
|
+
"""
|
|
544
|
+
Derived Transform Query Validation.
|
|
545
|
+
|
|
546
|
+
Args:
|
|
547
|
+
request: Request containing TimeSerieData and the Query to be applied to verify the derived transformation
|
|
548
|
+
Returns:
|
|
549
|
+
DerivedTransformQueryValidationResponse Entity (Async).
|
|
550
|
+
"""
|
|
551
|
+
url = "/utils/derivedTransform/queryValidation"
|
|
552
|
+
|
|
553
|
+
with self.__client as c:
|
|
554
|
+
res = await asyncio.gather(
|
|
555
|
+
*[
|
|
556
|
+
self.__executor.exec(
|
|
557
|
+
c.exec,
|
|
558
|
+
"POST",
|
|
559
|
+
url,
|
|
560
|
+
request,
|
|
561
|
+
retcls=DerivedTransformQueryValidationResponse
|
|
562
|
+
)
|
|
563
|
+
]
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
return cast(DerivedTransformQueryValidationResponse, res[0])
|
|
567
|
+
|
|
568
|
+
def derivedTransformQueryValidation(
|
|
569
|
+
self: MarketDataService,
|
|
570
|
+
request: DerivedTransformQueryValidation
|
|
571
|
+
) -> DerivedTransformQueryValidationResponse:
|
|
572
|
+
"""
|
|
573
|
+
Derived Transform Query Validation.
|
|
574
|
+
|
|
575
|
+
Args:
|
|
576
|
+
request: Request containing TimeSerieData and the Query to be applied to verify the derived transformation
|
|
577
|
+
|
|
578
|
+
Returns:
|
|
579
|
+
DerivedTransformQueryValidationResponse Entity.
|
|
580
|
+
"""
|
|
581
|
+
|
|
582
|
+
return _get_event_loop().run_until_complete(
|
|
583
|
+
self.derivedTransformQueryValidationAsync(request)
|
|
584
|
+
)
|
|
585
|
+
|
|
537
586
|
|
|
538
587
|
def _get_event_loop() -> asyncio.AbstractEventLoop:
|
|
539
588
|
"""
|
|
@@ -9,7 +9,7 @@ class DerivedCfg:
|
|
|
9
9
|
Class for the Derived Configuration.
|
|
10
10
|
|
|
11
11
|
Attributes:
|
|
12
|
-
derivedAlgorithm: the derived configuration algorithm (MUV, Coalesce, Sum)
|
|
12
|
+
derivedAlgorithm: the derived configuration algorithm (MUV, Coalesce, Sum, Transform)
|
|
13
13
|
version: the derived configuration version
|
|
14
14
|
orderedReferencedMarketDataIds: the ordered reference MarketData Ids
|
|
15
15
|
used in the computation
|
|
@@ -19,3 +19,4 @@ class DerivedCfg:
|
|
|
19
19
|
derivedAlgorithm: DerivedAlgorithm
|
|
20
20
|
version: int
|
|
21
21
|
orderedReferencedMarketDataIds: Optional[List[int]]
|
|
22
|
+
transform: Optional[str] = None
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from .TimeSerieData import TimeSerieData
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class DerivedTransformQueryValidation:
|
|
9
|
+
"""
|
|
10
|
+
Class Derived transform query validation.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
data: The time series data used for the query validation
|
|
14
|
+
transform: The Transform query to apply on the referenced timeseries.
|
|
15
|
+
The query is executed against the helper table `$table`.
|
|
16
|
+
For ActualTimeSerie the table exposes `Time` (datetime) and `Value` (double).
|
|
17
|
+
For VersionedTimeSerie it exposes `Version` (datetime), `Time` (datetime) and `Value` (double).
|
|
18
|
+
The transform query should return `Time` and `Value` columns in the response.
|
|
19
|
+
Query examples
|
|
20
|
+
SELECT Time + INTERVAL 1 DAY AS Time, Value FROM $table
|
|
21
|
+
SELECT Time, CASE WHEN EXTRACT(HOUR FROM (Time AT TIME ZONE 'UTC') AT TIME ZONE 'Europe/Rome')
|
|
22
|
+
< 10 THEN Value + 1 ELSE Value END AS Value FROM $table WHERE Time IS NOT NULL
|
|
23
|
+
SELECT Time, Value FROM $table WHERE Version IS NOT NULL AND((EXTRACT(hour FROM Version)
|
|
24
|
+
< 10 AND Time >= date_trunc('day', Version + interval '1 day')) OR(EXTRACT(hour FROM Version)
|
|
25
|
+
>= 10 AND Time >= date_trunc('day', Version + interval '2 day')))
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
data: TimeSerieData
|
|
30
|
+
transform: Optional[str] = None
|
|
31
|
+
|
|
32
|
+
def __post_init__(self: "DerivedTransformQueryValidation") -> None:
|
|
33
|
+
if self.transform is None:
|
|
34
|
+
raise ValueError("transform must be provided for query validation.")
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from .TimeSerieData import TimeSerieData
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class Error:
|
|
8
|
+
"""
|
|
9
|
+
Class Represents an error in the derived transform query validation response.
|
|
10
|
+
Attributes:
|
|
11
|
+
message: The Error message when the query validation is invalid.
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
message: Optional[str] = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class DerivedTransformQueryValidationResponse:
|
|
20
|
+
"""
|
|
21
|
+
Class Represents the response of a derived transform query validation.
|
|
22
|
+
Attributes:
|
|
23
|
+
data: The time series data transformed by the query.
|
|
24
|
+
error: The Error in case of invalid query validation.
|
|
25
|
+
valid: The transformation is valid or invalid.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
data: TimeSerieData
|
|
29
|
+
valid: bool
|
|
30
|
+
error: Optional[Error] = None
|
|
@@ -70,7 +70,8 @@ class MarketDataEntityInput:
|
|
|
70
70
|
self.derivedCfg is not None
|
|
71
71
|
and self.derivedCfg.derivedAlgorithm in {
|
|
72
72
|
DerivedAlgorithm.Coalesce,
|
|
73
|
-
DerivedAlgorithm.Sum
|
|
73
|
+
DerivedAlgorithm.Sum,
|
|
74
|
+
DerivedAlgorithm.Transform
|
|
74
75
|
}
|
|
75
76
|
and self.type is not MarketDataType.ActualTimeSerie
|
|
76
77
|
):
|
|
@@ -88,3 +89,26 @@ class MarketDataEntityInput:
|
|
|
88
89
|
f"DerivedCfg with {self.derivedCfg.derivedAlgorithm} algorithm "
|
|
89
90
|
"must be set to MarketData of type Versioned only."
|
|
90
91
|
)
|
|
92
|
+
|
|
93
|
+
if (
|
|
94
|
+
self.derivedCfg is not None
|
|
95
|
+
and self.derivedCfg.derivedAlgorithm is DerivedAlgorithm.Transform
|
|
96
|
+
and self.derivedCfg.transform is None
|
|
97
|
+
):
|
|
98
|
+
raise Exception(
|
|
99
|
+
f"DerivedCfg with {self.derivedCfg.derivedAlgorithm} algorithm "
|
|
100
|
+
"must have transform set."
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
if (
|
|
104
|
+
self.derivedCfg is not None
|
|
105
|
+
and self.derivedCfg.derivedAlgorithm is DerivedAlgorithm.Transform
|
|
106
|
+
and (
|
|
107
|
+
self.derivedCfg.orderedReferencedMarketDataIds is None
|
|
108
|
+
or len(self.derivedCfg.orderedReferencedMarketDataIds) != 1
|
|
109
|
+
)
|
|
110
|
+
):
|
|
111
|
+
raise Exception(
|
|
112
|
+
f"DerivedCfg with {self.derivedCfg.derivedAlgorithm} algorithm "
|
|
113
|
+
"must have exactly one orderedReferencedMarketDataIds."
|
|
114
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Dict, Optional
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from Artesian.MarketData._Enum.MarketDataType import MarketDataType
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class TimeSerieData:
|
|
9
|
+
"""
|
|
10
|
+
Class Timeserie data.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
rows: The timeserie data in OriginalTimezone or, when Hourly, UTC.
|
|
14
|
+
type: MarketDataEntity Type
|
|
15
|
+
version: The Version to operate on
|
|
16
|
+
timezone: The timezone of the Rows. Must be the OriginalTimezone or, when Hourly, must be "UTC".
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
type: MarketDataType
|
|
20
|
+
rows: Optional[Dict[datetime, Optional[float]]] = None
|
|
21
|
+
version: Optional[datetime] = None
|
|
22
|
+
timezone: Optional[str] = None
|
|
@@ -2,6 +2,7 @@ from .MarketDataEntityInput import MarketDataEntityInput
|
|
|
2
2
|
from .MarketDataEntityOutput import MarketDataEntityOutput
|
|
3
3
|
from .CheckConversionResult import CheckConversionResult
|
|
4
4
|
from .UnitOfMeasure import UnitOfMeasure
|
|
5
|
+
from .TimeSerieData import TimeSerieData
|
|
5
6
|
from .CurveRangeEntity import CurveRangeEntity
|
|
6
7
|
from .PagedResult import PagedResultCurveRangeEntity
|
|
7
8
|
from .ArtesianSearchResults import ArtesianSearchResults
|
|
@@ -35,4 +36,5 @@ __all__ = [
|
|
|
35
36
|
DerivedCfg.__name__,
|
|
36
37
|
CheckConversionResult.__name__,
|
|
37
38
|
UnitOfMeasure.__name__,
|
|
39
|
+
TimeSerieData.__name__,
|
|
38
40
|
] # type: ignore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from email.message import Message
|
|
3
|
-
from typing import Any, Optional
|
|
3
|
+
from typing import Any, Optional, cast
|
|
4
4
|
import requests
|
|
5
5
|
import platform
|
|
6
6
|
|
|
@@ -57,7 +57,7 @@ class _Client:
|
|
|
57
57
|
retcls: Optional[type] = None,
|
|
58
58
|
params: Optional[dict] = None,
|
|
59
59
|
) -> Any | None:
|
|
60
|
-
json = artesianJsonSerialize(obj)
|
|
60
|
+
json = cast(Any, artesianJsonSerialize(obj))
|
|
61
61
|
url = self.__baseUrl + url
|
|
62
62
|
r = requests.Request(method, url, json=json, params=params)
|
|
63
63
|
prep = self.__session.prepare_request(r)
|
Artesian/_version.py
CHANGED
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '4.
|
|
22
|
-
__version_tuple__ = version_tuple = (4,
|
|
21
|
+
__version__ = version = '4.3.1.dev1'
|
|
22
|
+
__version_tuple__ = version_tuple = (4, 3, 1, 'dev1')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: artesian-sdk
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.1.dev1
|
|
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>
|
|
@@ -469,8 +469,8 @@ Artesian support Query over GME Public Offers which comes in a custom and dedica
|
|
|
469
469
|
Note (performance):
|
|
470
470
|
GME Public Offer data is partitioned by date, offerType, status, and market. Requesting very narrow subsets (for example a single status or offerType in several separate requests) does not improve performance and can cause the same data to be fetched multiple times.
|
|
471
471
|
For this reason, the examples below:
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
• Use a large page size so that all data for a given (date, market, filters) is typically returned in a single page.
|
|
473
|
+
• Loop over markets explicitly to cover all required markets without redundant fetches.
|
|
474
474
|
|
|
475
475
|
### Extract GME Public Offer
|
|
476
476
|
|
|
@@ -763,6 +763,76 @@ Extraction options for GME Public Offer queries.
|
|
|
763
763
|
.withAggregationRule(AggregationRule.SumAndDivide)
|
|
764
764
|
```
|
|
765
765
|
|
|
766
|
+
### DerivedTransform: Query Validation
|
|
767
|
+
|
|
768
|
+
Use the `DerivedTransformQueryValidation` to validate and execute a derived transform query against a sample TimeSerieData.
|
|
769
|
+
|
|
770
|
+
```Python
|
|
771
|
+
from Artesian.MarketData import MarketDataService
|
|
772
|
+
from Artesian.MarketData._Dto.DerivedTransformQueryValidation import DerivedTransformQueryValidation
|
|
773
|
+
from Artesian.MarketData._Dto.TimeSerieData import TimeSerieData
|
|
774
|
+
from Artesian import MarketDataType
|
|
775
|
+
from datetime import datetime
|
|
776
|
+
|
|
777
|
+
mds = MarketDataService(cfg)
|
|
778
|
+
|
|
779
|
+
request = DerivedTransformQueryValidation(
|
|
780
|
+
data=TimeSerieData(
|
|
781
|
+
rows=[
|
|
782
|
+
(datetime(2018, 10, 1, 0, 0), 100),
|
|
783
|
+
(datetime(2018, 10, 1, 1, 0), 100)
|
|
784
|
+
],
|
|
785
|
+
type=MarketDataType.ActualTimeSerie,
|
|
786
|
+
),
|
|
787
|
+
transform="SELECT Time, (Value + 1) as Value FROM $table"
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
derivedTransformResponse = mds.derivedTransformQueryValidation(request)
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
#### Available Columns
|
|
794
|
+
|
|
795
|
+
| Column | Type |
|
|
796
|
+
| ------ | -------- |
|
|
797
|
+
| Time | datetime |
|
|
798
|
+
| Value | double |
|
|
799
|
+
|
|
800
|
+
> `$table` is a virtual table exposed by the query engine.
|
|
801
|
+
|
|
802
|
+
**Returned Object: DerivedTransformQueryValidationResponse**
|
|
803
|
+
|
|
804
|
+
| Property | Description |
|
|
805
|
+
| -------- | ---------------------------------------------- |
|
|
806
|
+
| Data | Transformed time series generated by the query |
|
|
807
|
+
| Valid | Indicates whether the query is valid |
|
|
808
|
+
| Error | Validation error details when `Valid = false` |
|
|
809
|
+
|
|
810
|
+
#### Query examples
|
|
811
|
+
|
|
812
|
+
```sql
|
|
813
|
+
SELECT Time + INTERVAL 1 DAY AS Time, Value FROM $table
|
|
814
|
+
|
|
815
|
+
SELECT Time, CASE WHEN EXTRACT(HOUR FROM (Time AT TIME ZONE 'UTC') AT TIME ZONE 'Europe/Rome') < 10 THEN Value + 1 ELSE Value END AS Value FROM $table WHERE Time IS NOT NULL
|
|
816
|
+
|
|
817
|
+
SELECT Time, Value FROM $table WHERE Version IS NOT NULL AND ((EXTRACT(hour FROM Version) < 10 AND Time >= date_trunc('day', Version + interval '1 day')) OR (EXTRACT(hour FROM Version) >= 10 AND Time >= date_trunc('day', Version + interval '2 day')))
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
#### SQL Dialect & Execution Model
|
|
821
|
+
|
|
822
|
+
The query engine uses a DuckDB-compatible SQL dialect (PostgreSQL-like).
|
|
823
|
+
|
|
824
|
+
Queries are executed against a virtual table named `$table`, which represents the provided sample TimeSerieData.
|
|
825
|
+
|
|
826
|
+
The engine supports common SQL features including:
|
|
827
|
+
|
|
828
|
+
- SELECT expressions
|
|
829
|
+
- WHERE filtering
|
|
830
|
+
- CASE WHEN expressions
|
|
831
|
+
- Date/time arithmetic and functions
|
|
832
|
+
- Timezone conversion functions
|
|
833
|
+
|
|
834
|
+
Full DuckDB SQL reference: https://duckdb.org/docs/sql/introduction.html
|
|
835
|
+
|
|
766
836
|
## Write Data in Artesian
|
|
767
837
|
|
|
768
838
|
Using the MarketDataService is possible to register MarketData and write curves into it using the UpsertData method.
|
|
@@ -816,9 +886,11 @@ mkservice.upsertData(data)
|
|
|
816
886
|
```
|
|
817
887
|
|
|
818
888
|
Upsert has optional switches that can be applied
|
|
889
|
+
|
|
819
890
|
```
|
|
820
891
|
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
821
892
|
```
|
|
893
|
+
|
|
822
894
|
The switch details are,
|
|
823
895
|
|
|
824
896
|
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
@@ -826,12 +898,11 @@ deferDataGeneration (true/false) choose between syncronoys and asyncronous preco
|
|
|
826
898
|
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
827
899
|
upsertMode (Merge/Replace) for ActualTimeSeries the two modes are equivalent. Leaving Null/None/Empty is equivalent to Merge.
|
|
828
900
|
|
|
829
|
-
|
|
830
|
-
DerivedCfg can be of algorithm type: Coalesce, Sum, Muv.
|
|
901
|
+
DerivedCfg can be of algorithm type: Coalesce, Sum, Muv, Transform.
|
|
831
902
|
|
|
832
903
|
Updating the DerivedCfg can be performed with `updateDerivedConfiguration` on MarketDataService. A validation will be done on the existing DerivedCfg of the MarketData, that should be not null and with same type as the one used for the update.
|
|
833
904
|
|
|
834
|
-
```
|
|
905
|
+
```Python
|
|
835
906
|
derivedCfgUpdate = DerivedCfg(
|
|
836
907
|
version=1,
|
|
837
908
|
derivedAlgorithm=DerivedAlgorithm.Coalesce,
|
|
@@ -844,6 +915,31 @@ marketDataUpdated = mkdservice.updateDerivedConfiguration(
|
|
|
844
915
|
False)
|
|
845
916
|
```
|
|
846
917
|
|
|
918
|
+
For DerivedCfg Transform, `orderedReferencedMarketDataIds` contains a single source series (the series where the transform is applied), and `transform` contains the query to apply.
|
|
919
|
+
|
|
920
|
+
```Python
|
|
921
|
+
derivedCfgUpdate = DerivedCfg(
|
|
922
|
+
version=1,
|
|
923
|
+
derivedAlgorithm=DerivedAlgorithm.Transform,
|
|
924
|
+
orderedReferencedMarketDataIds=[10001],
|
|
925
|
+
transform="SELECT Time, (Value + 1) as Value FROM $table"
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
marketDataUpdated = mkdservice.updateDerivedConfiguration(
|
|
929
|
+
registeredDerived.marketDataId,
|
|
930
|
+
derivedCfgUpdate,
|
|
931
|
+
False)
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
#### Available Columns
|
|
935
|
+
|
|
936
|
+
| Column | Type |
|
|
937
|
+
| ------ | -------- |
|
|
938
|
+
| Time | datetime |
|
|
939
|
+
| Value | double |
|
|
940
|
+
|
|
941
|
+
> `$table` is a virtual table exposed by the query engine.
|
|
942
|
+
|
|
847
943
|
In case we want to write an hourly (or lower) time series the timezone for the upsert data must be UTC:
|
|
848
944
|
|
|
849
945
|
```Python
|
|
@@ -926,9 +1022,11 @@ mkservice.upsertData(data)
|
|
|
926
1022
|
```
|
|
927
1023
|
|
|
928
1024
|
Upsert has optional switches that can be applied
|
|
1025
|
+
|
|
929
1026
|
```
|
|
930
1027
|
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
931
1028
|
```
|
|
1029
|
+
|
|
932
1030
|
The switch details are,
|
|
933
1031
|
|
|
934
1032
|
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
@@ -936,25 +1034,24 @@ deferDataGeneration (true/false) choose between syncronoys and asyncronous preco
|
|
|
936
1034
|
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
937
1035
|
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.
|
|
938
1036
|
|
|
939
|
-
| DATETIME
|
|
940
|
-
|
|
1037
|
+
| DATETIME | EXISTING | PAYLOAD | MERGE | REPLACE |
|
|
1038
|
+
| ------------ | ---------- | ---------- | ---------- | ---------- |
|
|
941
1039
|
| VERSION NAME | 2025-01-01 | 2025-01-01 | 2025-01-01 | 2025-01-01 |
|
|
942
|
-
| 2025-01-01
|
|
943
|
-
| 2025-01-02
|
|
944
|
-
| 2025-01-03
|
|
945
|
-
| 2025-01-04
|
|
946
|
-
| 2025-01-05
|
|
947
|
-
| 2025-01-06
|
|
948
|
-
| 2025-01-07
|
|
949
|
-
| 2025-01-08
|
|
950
|
-
| 2025-01-09
|
|
951
|
-
| 2025-01-10
|
|
952
|
-
| 2025-01-11
|
|
953
|
-
| 2025-01-12
|
|
954
|
-
| 2025-01-13
|
|
955
|
-
| 2025-01-14
|
|
956
|
-
| 2025-01-15
|
|
957
|
-
|
|
1040
|
+
| 2025-01-01 | | | | |
|
|
1041
|
+
| 2025-01-02 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1042
|
+
| 2025-01-03 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1043
|
+
| 2025-01-04 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1044
|
+
| 2025-01-05 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1045
|
+
| 2025-01-06 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1046
|
+
| 2025-01-07 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
1047
|
+
| 2025-01-08 | | 222.22 | 222.22 | 222.22 |
|
|
1048
|
+
| 2025-01-09 | | | | |
|
|
1049
|
+
| 2025-01-10 | | | | |
|
|
1050
|
+
| 2025-01-11 | 999.99 | | 999.99 | |
|
|
1051
|
+
| 2025-01-12 | 999.99 | | 999.99 | |
|
|
1052
|
+
| 2025-01-13 | 999.99 | | 999.99 | |
|
|
1053
|
+
| 2025-01-14 | | | | |
|
|
1054
|
+
| 2025-01-15 | | | | |
|
|
958
1055
|
|
|
959
1056
|
### Write Data in a Market Assessment Time Series
|
|
960
1057
|
|
|
@@ -1004,9 +1101,11 @@ mkservice.upsertData(marketAssessment)
|
|
|
1004
1101
|
```
|
|
1005
1102
|
|
|
1006
1103
|
Upsert has optional switches that can be applied
|
|
1104
|
+
|
|
1007
1105
|
```
|
|
1008
1106
|
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
1009
1107
|
```
|
|
1108
|
+
|
|
1010
1109
|
The switch details are,
|
|
1011
1110
|
|
|
1012
1111
|
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
@@ -1014,7 +1113,6 @@ deferDataGeneration (true/false) choose between syncronoys and asyncronous preco
|
|
|
1014
1113
|
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
1015
1114
|
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.
|
|
1016
1115
|
|
|
1017
|
-
|
|
1018
1116
|
### Write Data in a Bid Ask Time Series
|
|
1019
1117
|
|
|
1020
1118
|
```Python
|
|
@@ -1062,9 +1160,11 @@ mkservice.upsertData(bidAsk)
|
|
|
1062
1160
|
```
|
|
1063
1161
|
|
|
1064
1162
|
Upsert has optional switches that can be applied
|
|
1163
|
+
|
|
1065
1164
|
```
|
|
1066
1165
|
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
1067
1166
|
```
|
|
1167
|
+
|
|
1068
1168
|
The switch details are,
|
|
1069
1169
|
|
|
1070
1170
|
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
@@ -1072,7 +1172,6 @@ deferDataGeneration (true/false) choose between syncronoys and asyncronous preco
|
|
|
1072
1172
|
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
1073
1173
|
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.
|
|
1074
1174
|
|
|
1075
|
-
|
|
1076
1175
|
### Write Data in an Auction Time Series
|
|
1077
1176
|
|
|
1078
1177
|
```Python
|
|
@@ -1120,9 +1219,11 @@ auctionRows = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER',
|
|
|
1120
1219
|
```
|
|
1121
1220
|
|
|
1122
1221
|
Upsert has optional switches that can be applied
|
|
1222
|
+
|
|
1123
1223
|
```
|
|
1124
1224
|
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
1125
1225
|
```
|
|
1226
|
+
|
|
1126
1227
|
The switch details are,
|
|
1127
1228
|
|
|
1128
1229
|
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
@@ -1130,7 +1231,6 @@ deferDataGeneration (true/false) choose between syncronoys and asyncronous preco
|
|
|
1130
1231
|
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
1131
1232
|
upsertMode (Merge/Replace) for Auction merge and replace are equivalent. Leaving Null/None/Empty is equivalent to Merge.
|
|
1132
1233
|
|
|
1133
|
-
|
|
1134
1234
|
## Delete Data in Artesian
|
|
1135
1235
|
|
|
1136
1236
|
Using the MarketDataService is possible to delete MarketData and its curves.
|
|
@@ -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=
|
|
7
|
+
Artesian/_version.py,sha256=ZTEKNYnjywWu256PpBSMk7LaZiCo9D9HKFJX7FHcWYU,533
|
|
8
8
|
Artesian/GMEPublicOffers/ExtractionRangeConfig.py,sha256=pXVFdLpLqFvgzu2Y5UTckDWysFiJDKc0ZaXjuv46iJU,415
|
|
9
9
|
Artesian/GMEPublicOffers/GMEPublicOfferQuery.py,sha256=zC2xChY1dug34japlfa9S-ehqCbIMXvPAboEiADNLGg,15590
|
|
10
10
|
Artesian/GMEPublicOffers/GMEPublicOfferQueryParameters.py,sha256=gs5SVNEYJTpwV9whZFw07jm5cIsion6TvgRDAeHj1Kw,3330
|
|
@@ -20,24 +20,27 @@ Artesian/GMEPublicOffers/_Enum/UnitType.py,sha256=p4ERSxHpDYIAhyPM3xoTBa9pYWMOs0
|
|
|
20
20
|
Artesian/GMEPublicOffers/_Enum/Zone.py,sha256=dl_3io_JZ1F9R7t1iEjexLKeNY1HWvV-CMVgh8XlVnw,380
|
|
21
21
|
Artesian/GMEPublicOffers/_Enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
Artesian/MarketData/CommonUnitOfMeasure.py,sha256=mybttan-Zpcf8NNYj48_xWpJSgadSXh-6mn4ZPvHvKo,257
|
|
23
|
-
Artesian/MarketData/MarketDataService.py,sha256=
|
|
23
|
+
Artesian/MarketData/MarketDataService.py,sha256=hfzR8F-sVkcYnuM8Ih6iDMOY0pa209BTsHd0VXFRQAQ,20128
|
|
24
24
|
Artesian/MarketData/__init__.py,sha256=fchVl7COy5IV9Kbsfuh94DT2v_IknVmfp0XM_Y-VhGM,1589
|
|
25
25
|
Artesian/MarketData/_Dto/ArtesianMetadataFacet.py,sha256=Ib9YYpGp1_6LdHy2WjL5pUlUVNNGQiyXfCUeh6t5ky4,800
|
|
26
26
|
Artesian/MarketData/_Dto/ArtesianSearchResults.py,sha256=nazdj1G4jpOUhn1irML3Duafp4I0kNhyfnZZzL4496k,581
|
|
27
27
|
Artesian/MarketData/_Dto/CheckConversionResult.py,sha256=vXyKtb-ZpcIL7QMKhSNiz9iV_FkGMoxQ2_aDOOV3Apk,570
|
|
28
28
|
Artesian/MarketData/_Dto/CurveRangeEntity.py,sha256=_zjXxuueNoIG4Xg1K-5TeJQBF0ejcDpFkvW5R9siby8,891
|
|
29
29
|
Artesian/MarketData/_Dto/DeleteData.py,sha256=0hLz28pdnNdUG82DGtPgW6NcsCNBOxIhGBD_dc8HLTA,1307
|
|
30
|
-
Artesian/MarketData/_Dto/DerivedCfg.py,sha256=
|
|
31
|
-
Artesian/MarketData/_Dto/
|
|
30
|
+
Artesian/MarketData/_Dto/DerivedCfg.py,sha256=vMTkoh4FVgh02EwglewlVC2e1nSvloiOjnFKQVZXMbs,614
|
|
31
|
+
Artesian/MarketData/_Dto/DerivedTransformQueryValidation.py,sha256=0v0QT5hEKlPudBavxwZEHhqPfZAnn2f_tgAYSaNrDmw,1641
|
|
32
|
+
Artesian/MarketData/_Dto/DerivedTransformQueryValidationResponse.py,sha256=TXVMEz6ARt-zWb6LqRyV9rgZ6NkTcKXJJZIM7LQcrLM,772
|
|
33
|
+
Artesian/MarketData/_Dto/MarketDataEntityInput.py,sha256=6QYnq07HmQFljnQqsM0e4lL3Q1xhz1ycp3HG3d7n8aA,4482
|
|
32
34
|
Artesian/MarketData/_Dto/MarketDataEntityOutput.py,sha256=TKV4n0aBZzInFVY_yI8UASIyYnnHGqs7N18nUrfCfGM,2254
|
|
33
35
|
Artesian/MarketData/_Dto/MarketDataIdentifier.py,sha256=egNOuOI3qugbFl8_w3IUSV9mOdBj-akq7M4Gj0X4Ig8,289
|
|
34
36
|
Artesian/MarketData/_Dto/PagedResult.py,sha256=-o0zKOLTbLg2wdz8K4K4qQJTkarEl-4SYppS6cf6j2o,736
|
|
37
|
+
Artesian/MarketData/_Dto/TimeSerieData.py,sha256=24jYzjxlrmxLCWwPcILjgd28aA0lRddi8vpRkj_U4gI,677
|
|
35
38
|
Artesian/MarketData/_Dto/UnitOfMeasure.py,sha256=B6Axt5wxMhLsjdXIiK0K912REmbCaZcaxWMImxEjXXY,304
|
|
36
39
|
Artesian/MarketData/_Dto/UpsertData.py,sha256=abIA7kQTW-9u3D-sjgv7mMEiY6UCARnj8Z1dMNYc8hM,3998
|
|
37
|
-
Artesian/MarketData/_Dto/__init__.py,sha256=
|
|
40
|
+
Artesian/MarketData/_Dto/__init__.py,sha256=HMZiX_S4DUGNqsyc0nmv3ieIWlk6S499T_YG3hvVUlc,1358
|
|
38
41
|
Artesian/MarketData/_Enum/AggregationRule.py,sha256=fkYmouBQwC68rFMyG_j-D_0IQA5JVrJRfSA7KxsCF-4,120
|
|
39
42
|
Artesian/MarketData/_Enum/ArtesianMetadataFacetType.py,sha256=1wE9VOzZ4gHk5oBjwpJd_kCgrUIfyNQmxuOZevj4f28,92
|
|
40
|
-
Artesian/MarketData/_Enum/DerivedAlgorithm.py,sha256=
|
|
43
|
+
Artesian/MarketData/_Enum/DerivedAlgorithm.py,sha256=aW6zzbT8-BJEM6AKPprIjWJa2NIgiqvxuRBzESoLTDE,113
|
|
41
44
|
Artesian/MarketData/_Enum/MarketDataType.py,sha256=lIXV21b1wNWEah0q76OD4bMV1n_dtsUHQNSr8SbTBcE,159
|
|
42
45
|
Artesian/MarketData/_Enum/UpsertMode.py,sha256=UuAMKcvehXN8pagJ-UtadbVIer7mjJaYOoEop-QjvrU,78
|
|
43
46
|
Artesian/MarketData/_Enum/__init__.py,sha256=7YM19VPx7kz7prHe3fHj23aF3efievZziaND50AxKUA,485
|
|
@@ -65,11 +68,11 @@ Artesian/Query/_QueryParameters/VersionedQueryParameters.py,sha256=rAiZieHfm3awb
|
|
|
65
68
|
Artesian/Query/_QueryParameters/VersionsRangeSelectionConfig.py,sha256=OP6dTHiBbCLcL9eCtgoWh50UEP0muNwM3bw-AqbvbW4,1508
|
|
66
69
|
Artesian/Query/_QueryParameters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
70
|
Artesian/_ClientsExecutor/ArtesianJsonSerializer.py,sha256=CDnq1sgKLvxSampykFtF9iZHZjgV6BPZvED6MU3K74Y,3563
|
|
68
|
-
Artesian/_ClientsExecutor/Client.py,sha256=
|
|
71
|
+
Artesian/_ClientsExecutor/Client.py,sha256=il2vebcCVwlVgdMxSSAzu24iw49cX2WjtpE4Uxz3Wdo,4071
|
|
69
72
|
Artesian/_ClientsExecutor/RequestExecutor.py,sha256=KKq31g8GFS-Mdp3S1QXFm5tZhacjnIeWs1YFc3f8NkY,10613
|
|
70
73
|
Artesian/_ClientsExecutor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
artesian_sdk-4.
|
|
72
|
-
artesian_sdk-4.
|
|
73
|
-
artesian_sdk-4.
|
|
74
|
-
artesian_sdk-4.
|
|
75
|
-
artesian_sdk-4.
|
|
74
|
+
artesian_sdk-4.3.1.dev1.dist-info/licenses/LICENSE,sha256=Y27w-dSf1pHlXO4yNy70OCCO4VuYYVxUdDOQ-sLdXds,1074
|
|
75
|
+
artesian_sdk-4.3.1.dev1.dist-info/METADATA,sha256=WGbFLh_9PFgpOHC8uiqvlpeDg5VX8kwxq4xMVPK8vdk,42984
|
|
76
|
+
artesian_sdk-4.3.1.dev1.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
77
|
+
artesian_sdk-4.3.1.dev1.dist-info/top_level.txt,sha256=1Fv89OOnRKHLMmQEBRXPaNuPMoZytK4dnfrOFDdGGYI,9
|
|
78
|
+
artesian_sdk-4.3.1.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|