artesian-sdk 4.2.1.dev2__tar.gz → 4.2.2.dev12__tar.gz
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_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.flake8 +1 -1
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.github/workflows/dependency-review.yaml +1 -1
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.github/workflows/python-tests.yml +2 -2
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/PKG-INFO +78 -1
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/README.md +77 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteActual.py +15 -15
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteAuction.py +14 -13
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteVersioned.py +80 -5
- artesian_sdk-4.2.2.dev12/samples/TestWriteDataAndQueryBidAsk.py +91 -0
- artesian_sdk-4.2.2.dev12/samples/TestWriteDataAndQueryMas.py +88 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/UpsertData.py +4 -0
- artesian_sdk-4.2.2.dev12/src/Artesian/MarketData/_Enum/UpsertMode.py +6 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Enum/__init__.py +2 -0
- artesian_sdk-4.2.2.dev12/src/Artesian/_version.py +34 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/artesian_sdk.egg-info/PKG-INFO +78 -1
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/artesian_sdk.egg-info/SOURCES.txt +1 -0
- artesian_sdk-4.2.1.dev2/samples/TestWriteDataAndQueryBidAsk.py +0 -57
- artesian_sdk-4.2.1.dev2/samples/TestWriteDataAndQueryMas.py +0 -57
- artesian_sdk-4.2.1.dev2/src/Artesian/_version.py +0 -21
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.github/dependabot.yml +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.gitignore +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.vscode/extensions.json +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.vscode/launch.json +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/.vscode/settings.json +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/CODEOWNERS +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/CONTRIBUTING.md +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/LICENSE +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/pyproject.toml +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/renovate.json +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestActual.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestAuction.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestBidAsk.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestDerivedCfg.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestGMEOffers.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestMarketDataService.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestMas.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestSearchFacet.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestVersioned.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteBidAsk.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteMas.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndQueryActual.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndQueryAuction.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/setup.cfg +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/.gitignore +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/ArtesianConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/ArtesianPolicyConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Exceptions.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/ExtractionRangeConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/GMEPublicOfferQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/GMEPublicOfferQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/GMEPublicOfferService.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/BaType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/GenerationType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/Market.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/Purpose.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/Scope.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/Status.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/UnitType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/Zone.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/_Enum/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/GMEPublicOffers/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Granularity.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/CommonUnitOfMeasure.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/MarketDataService.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/ArtesianMetadataFacet.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/ArtesianSearchResults.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/CheckConversionResult.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/CurveRangeEntity.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/DeleteData.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/DerivedCfg.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/MarketDataEntityInput.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/MarketDataEntityOutput.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/MarketDataIdentifier.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/PagedResult.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/UnitOfMeasure.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Dto/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Enum/AggregationRule.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Enum/ArtesianMetadataFacetType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Enum/DerivedAlgorithm.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/_Enum/MarketDataType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/MarketData/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/ActualQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/AuctionQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/BidAskQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/DefaultPartitionStrategy.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/MasQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/QueryService.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/RelativeInterval.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/VersionedQuery.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_Query.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/ActualQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/AuctionQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/BidAskQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/ExtractionRangeConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/ExtractionRangeType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/MasQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/MostRecentSelectionConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/QueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/VersionSelectionConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/VersionSelectionType.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/VersionedQueryParameters.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/VersionsRangeSelectionConfig.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/_QueryParameters/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/Query/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/_ClientsExecutor/ArtesianJsonSerializer.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/_ClientsExecutor/Client.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/_ClientsExecutor/RequestExecutor.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/_ClientsExecutor/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/Artesian/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/artesian_sdk.egg-info/dependency_links.txt +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/artesian_sdk.egg-info/requires.txt +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/src/artesian_sdk.egg-info/top_level.txt +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestActual.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestBidAsk.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestClientErrorHandling.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestGMEPO.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestMarketDataDeleteData.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestMarketDataService.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestMarketDataUpsertData.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestMas.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/TestVersioned.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/__init__.py +0 -0
- {artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/tests/helpers.py +0 -0
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
|
|
22
22
|
|
|
23
23
|
steps:
|
|
24
|
-
- uses: actions/checkout@
|
|
24
|
+
- uses: actions/checkout@v5
|
|
25
25
|
- name: Set up Python ${{ matrix.python-version }}
|
|
26
26
|
uses: actions/setup-python@v5
|
|
27
27
|
with:
|
|
@@ -64,7 +64,7 @@ jobs:
|
|
|
64
64
|
python-version: "3.11"
|
|
65
65
|
|
|
66
66
|
steps:
|
|
67
|
-
- uses: actions/checkout@
|
|
67
|
+
- uses: actions/checkout@v5
|
|
68
68
|
with:
|
|
69
69
|
fetch-depth: 0
|
|
70
70
|
- name: Set up Python ${{ env.python-version }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: artesian-sdk
|
|
3
|
-
Version: 4.2.
|
|
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
|
|
|
@@ -728,8 +728,19 @@ data = MarketData.UpsertData(mkdid, 'CET',
|
|
|
728
728
|
)
|
|
729
729
|
|
|
730
730
|
mkservice.upsertData(data)
|
|
731
|
+
```
|
|
731
732
|
|
|
733
|
+
Upsert has optional switches that can be applied
|
|
734
|
+
```
|
|
735
|
+
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
732
736
|
```
|
|
737
|
+
The switch details are,
|
|
738
|
+
|
|
739
|
+
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
740
|
+
deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
|
|
741
|
+
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
742
|
+
upsertMode (Merge/Replace) for ActualTimeSeries the two modes are equivalent. Leaving Null/None/Empty is equivalent to Merge.
|
|
743
|
+
|
|
733
744
|
|
|
734
745
|
DerivedCfg can be of algorithm type: Coalesce, Sum, Muv.
|
|
735
746
|
|
|
@@ -829,6 +840,37 @@ mkservice.upsertData(data)
|
|
|
829
840
|
|
|
830
841
|
```
|
|
831
842
|
|
|
843
|
+
Upsert has optional switches that can be applied
|
|
844
|
+
```
|
|
845
|
+
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
846
|
+
```
|
|
847
|
+
The switch details are,
|
|
848
|
+
|
|
849
|
+
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
850
|
+
deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
|
|
851
|
+
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
852
|
+
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.
|
|
853
|
+
|
|
854
|
+
| DATETIME | EXISTING | PAYLOAD | MERGE | REPALACE |
|
|
855
|
+
|---|---|---|---|---|
|
|
856
|
+
| VERSION NAME | 2025-01-01 | 2025-01-01 | 2025-01-01 | 2025-01-01 |
|
|
857
|
+
| 2025-01-01 | | | | |
|
|
858
|
+
| 2025-01-02 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
859
|
+
| 2025-01-03 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
860
|
+
| 2025-01-04 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
861
|
+
| 2025-01-05 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
862
|
+
| 2025-01-06 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
863
|
+
| 2025-01-07 | 999.99 | 222.22 | 222.22 | 222.22 |
|
|
864
|
+
| 2025-01-08 | | 222.22 | 222.22 | 222.22 |
|
|
865
|
+
| 2025-01-09 | | | | |
|
|
866
|
+
| 2025-01-10 | | | | |
|
|
867
|
+
| 2025-01-11 | 999.99 | | 999.99 | |
|
|
868
|
+
| 2025-01-12 | 999.99 | | 999.99 | |
|
|
869
|
+
| 2025-01-13 | 999.99 | | 999.99 | |
|
|
870
|
+
| 2025-01-14 | | | | |
|
|
871
|
+
| 2025-01-15 | | | | |
|
|
872
|
+
|
|
873
|
+
|
|
832
874
|
### Write Data in a Market Assessment Time Series
|
|
833
875
|
|
|
834
876
|
```Python
|
|
@@ -876,6 +918,18 @@ mkservice.upsertData(marketAssessment)
|
|
|
876
918
|
|
|
877
919
|
```
|
|
878
920
|
|
|
921
|
+
Upsert has optional switches that can be applied
|
|
922
|
+
```
|
|
923
|
+
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
924
|
+
```
|
|
925
|
+
The switch details are,
|
|
926
|
+
|
|
927
|
+
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
928
|
+
deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
|
|
929
|
+
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
930
|
+
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.
|
|
931
|
+
|
|
932
|
+
|
|
879
933
|
### Write Data in a Bid Ask Time Series
|
|
880
934
|
|
|
881
935
|
```Python
|
|
@@ -922,6 +976,18 @@ bidAsk = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER', 'MARK
|
|
|
922
976
|
mkservice.upsertData(bidAsk)
|
|
923
977
|
```
|
|
924
978
|
|
|
979
|
+
Upsert has optional switches that can be applied
|
|
980
|
+
```
|
|
981
|
+
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
982
|
+
```
|
|
983
|
+
The switch details are,
|
|
984
|
+
|
|
985
|
+
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
986
|
+
deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
|
|
987
|
+
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
988
|
+
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.
|
|
989
|
+
|
|
990
|
+
|
|
925
991
|
### Write Data in an Auction Time Series
|
|
926
992
|
|
|
927
993
|
```Python
|
|
@@ -966,8 +1032,19 @@ auctionRows = MarketData.UpsertData(MarketData.MarketDataIdentifier('PROVIDER',
|
|
|
966
1032
|
|
|
967
1033
|
mkservice.upsertData(auctionRows)
|
|
968
1034
|
|
|
1035
|
+
```
|
|
969
1036
|
|
|
1037
|
+
Upsert has optional switches that can be applied
|
|
970
1038
|
```
|
|
1039
|
+
mkservice.upsertData(data, deferCommandExecution, deferDataGeneration, keepNulls, upsertMode)
|
|
1040
|
+
```
|
|
1041
|
+
The switch details are,
|
|
1042
|
+
|
|
1043
|
+
deferCommandExecution (true/false) choose between syncronoys and asyncronous command execution, default is false.
|
|
1044
|
+
deferDataGeneration (true/false) choose between syncronoys and asyncronous precomputed data generation, default is true.
|
|
1045
|
+
keepNulls (true/false) if true then nulls are written in the curve replacing any data present for the instant, default is false.
|
|
1046
|
+
upsertMode (Merge/Replace) for Auction merge and replace are equivalent. Leaving Null/None/Empty is equivalent to Merge.
|
|
1047
|
+
|
|
971
1048
|
|
|
972
1049
|
## Delete Data in Artesian
|
|
973
1050
|
|
{artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteActual.py
RENAMED
|
@@ -3,31 +3,35 @@ import Artesian
|
|
|
3
3
|
from Artesian import Query
|
|
4
4
|
from Artesian.Granularity import Granularity
|
|
5
5
|
from Artesian.MarketData._Enum.MarketDataType import MarketDataType
|
|
6
|
+
from Artesian.MarketData._Enum.UpsertMode import UpsertMode
|
|
6
7
|
|
|
7
8
|
cfg = Artesian.ArtesianConfig("https://arkive.artesian.cloud/tenantName/", "APIKey")
|
|
8
9
|
mkdservice = Artesian.MarketData.MarketDataService(cfg)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
mktId = Artesian.MarketData.MarketDataIdentifier(
|
|
11
12
|
"PythonSDK",
|
|
12
|
-
"TestActualWriteAndDelete"
|
|
13
|
+
"TestActualWriteAndDelete"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
mktDataEntity = Artesian.MarketData.MarketDataEntityInput(
|
|
17
|
+
mktId.provider,
|
|
18
|
+
mktId.name,
|
|
13
19
|
Granularity.Hour,
|
|
14
20
|
MarketDataType.ActualTimeSerie,
|
|
15
21
|
"CET",
|
|
16
22
|
tags={"TestSDKPython": ["PythonValue2"]},
|
|
17
23
|
)
|
|
18
24
|
|
|
19
|
-
registered = mkdservice.readMarketDataRegistryByName(
|
|
20
|
-
|
|
21
|
-
)
|
|
25
|
+
registered = mkdservice.readMarketDataRegistryByName(mktId.provider, mktId.name)
|
|
26
|
+
|
|
22
27
|
if registered is None:
|
|
23
|
-
registered = mkdservice.registerMarketData(
|
|
28
|
+
registered = mkdservice.registerMarketData(mktDataEntity)
|
|
24
29
|
|
|
25
30
|
data = Artesian.MarketData.UpsertData(
|
|
26
|
-
|
|
27
|
-
actual.providerName, actual.marketDataName
|
|
28
|
-
),
|
|
31
|
+
mktId,
|
|
29
32
|
"UTC",
|
|
30
33
|
rows={datetime(2020, 1, 1, h): 42.0 + h / 24.0 for h in range(0, 23)},
|
|
34
|
+
upsertMode=UpsertMode.Merge
|
|
31
35
|
)
|
|
32
36
|
|
|
33
37
|
mkdservice.upsertData(data)
|
|
@@ -47,9 +51,7 @@ print(res)
|
|
|
47
51
|
|
|
48
52
|
# Delete data between 2020-01-01 06:00 and 2020-01-01 18:00
|
|
49
53
|
deleteData = Artesian.MarketData.DeleteData(
|
|
50
|
-
|
|
51
|
-
registered.providerName, registered.marketDataName
|
|
52
|
-
),
|
|
54
|
+
mktId,
|
|
53
55
|
timezone="CET",
|
|
54
56
|
rangeStart=datetime(2020, 1, 1, 6),
|
|
55
57
|
rangeEnd=datetime(2020, 1, 1, 18),
|
|
@@ -71,9 +73,7 @@ print(res)
|
|
|
71
73
|
|
|
72
74
|
# Delete data between 2020-01-01 06:00 and 2020-01-01 18:00 without Timezone
|
|
73
75
|
deleteData = Artesian.MarketData.DeleteData(
|
|
74
|
-
|
|
75
|
-
registered.providerName, registered.marketDataName
|
|
76
|
-
),
|
|
76
|
+
mktId,
|
|
77
77
|
rangeStart=datetime(2020, 1, 1, 6),
|
|
78
78
|
rangeEnd=datetime(2020, 1, 1, 18),
|
|
79
79
|
)
|
{artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteAuction.py
RENAMED
|
@@ -4,13 +4,19 @@ from Artesian import Query
|
|
|
4
4
|
from dateutil import tz
|
|
5
5
|
from Artesian import MarketData
|
|
6
6
|
from Artesian.Granularity import Granularity
|
|
7
|
+
from Artesian.MarketData._Enum.UpsertMode import UpsertMode
|
|
7
8
|
|
|
8
9
|
cfg = Artesian.ArtesianConfig("https://arkive.artesian.cloud/tenantName/", "APIKey")
|
|
9
10
|
mkdservice = Artesian.MarketData.MarketDataService(cfg)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
mktId = Artesian.MarketData.MarketDataIdentifier(
|
|
12
13
|
"PythonSDK",
|
|
13
|
-
"TestAuctionWriteAndDelete"
|
|
14
|
+
"TestAuctionWriteAndDelete"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
mktDataEntity = Artesian.MarketData.MarketDataEntityInput(
|
|
18
|
+
mktId.provider,
|
|
19
|
+
mktId.name,
|
|
14
20
|
Granularity.Hour,
|
|
15
21
|
MarketData.MarketDataType.Auction,
|
|
16
22
|
"CET",
|
|
@@ -18,10 +24,10 @@ auction = Artesian.MarketData.MarketDataEntityInput(
|
|
|
18
24
|
)
|
|
19
25
|
|
|
20
26
|
registered = mkdservice.readMarketDataRegistryByName(
|
|
21
|
-
|
|
27
|
+
mktId.provider, mktId.name
|
|
22
28
|
)
|
|
23
29
|
if registered is None:
|
|
24
|
-
registered = mkdservice.registerMarketData(
|
|
30
|
+
registered = mkdservice.registerMarketData(mktDataEntity)
|
|
25
31
|
|
|
26
32
|
auctionRowData = {
|
|
27
33
|
datetime(2020, 1, 1, h): MarketData.AuctionBids(
|
|
@@ -39,12 +45,11 @@ auctionRowData = {
|
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
auctionRows = MarketData.UpsertData(
|
|
42
|
-
|
|
43
|
-
auction.providerName, auction.marketDataName
|
|
44
|
-
),
|
|
48
|
+
mktId,
|
|
45
49
|
"UTC",
|
|
46
50
|
auctionRows=auctionRowData,
|
|
47
51
|
downloadedAt=datetime(2020, 1, 3).replace(tzinfo=tz.UTC),
|
|
52
|
+
upsertMode=UpsertMode.Merge
|
|
48
53
|
)
|
|
49
54
|
|
|
50
55
|
mkdservice.upsertData(auctionRows)
|
|
@@ -63,9 +68,7 @@ print(res)
|
|
|
63
68
|
|
|
64
69
|
# Delete data between 2020-01-01 06:00 and 2020-01-01 18:00
|
|
65
70
|
deleteData = Artesian.MarketData.DeleteData(
|
|
66
|
-
ID=
|
|
67
|
-
registered.providerName, registered.marketDataName
|
|
68
|
-
),
|
|
71
|
+
ID=mktId,
|
|
69
72
|
timezone="CET",
|
|
70
73
|
rangeStart=datetime(2020, 1, 1, 6),
|
|
71
74
|
rangeEnd=datetime(2020, 1, 1, 18),
|
|
@@ -85,9 +88,7 @@ print(res)
|
|
|
85
88
|
|
|
86
89
|
# Delete data between 2020-01-01 06:00 and 2020-01-01 18:00 without Timezone
|
|
87
90
|
deleteData = Artesian.MarketData.DeleteData(
|
|
88
|
-
ID=
|
|
89
|
-
registered.providerName, registered.marketDataName
|
|
90
|
-
),
|
|
91
|
+
ID=mktId,
|
|
91
92
|
rangeStart=datetime(2020, 1, 1, 6),
|
|
92
93
|
rangeEnd=datetime(2020, 1, 1, 18),
|
|
93
94
|
)
|
{artesian_sdk-4.2.1.dev2 → artesian_sdk-4.2.2.dev12}/samples/TestWriteDataAndDeleteVersioned.py
RENAMED
|
@@ -3,6 +3,7 @@ import Artesian
|
|
|
3
3
|
from Artesian import Query
|
|
4
4
|
from Artesian.Granularity import Granularity
|
|
5
5
|
from Artesian.MarketData._Enum.MarketDataType import MarketDataType
|
|
6
|
+
from Artesian.MarketData._Enum.UpsertMode import UpsertMode
|
|
6
7
|
|
|
7
8
|
cfg = Artesian.ArtesianConfig("https://arkive.artesian.cloud/tenantName/", "APIKey")
|
|
8
9
|
mkdservice = Artesian.MarketData.MarketDataService(cfg)
|
|
@@ -12,7 +13,7 @@ versioned = Artesian.MarketData.MarketDataEntityInput(
|
|
|
12
13
|
"TestVersionedWriteAndDelete",
|
|
13
14
|
Granularity.Hour,
|
|
14
15
|
MarketDataType.VersionedTimeSerie,
|
|
15
|
-
"
|
|
16
|
+
"UTC",
|
|
16
17
|
tags={"TestSDKPython": ["PythonValue2"]},
|
|
17
18
|
)
|
|
18
19
|
|
|
@@ -31,7 +32,33 @@ data = Artesian.MarketData.UpsertData(
|
|
|
31
32
|
marketIdentifier,
|
|
32
33
|
"UTC",
|
|
33
34
|
version=testVersion,
|
|
34
|
-
rows={
|
|
35
|
+
rows={
|
|
36
|
+
datetime(2020, 1, 1, 0): 11.0,
|
|
37
|
+
datetime(2020, 1, 1, 1): 22.0,
|
|
38
|
+
datetime(2020, 1, 1, 2): 33.0,
|
|
39
|
+
datetime(2020, 1, 1, 3): 44.0,
|
|
40
|
+
datetime(2020, 1, 1, 4): 55.0,
|
|
41
|
+
datetime(2020, 1, 1, 5): 66.0,
|
|
42
|
+
datetime(2020, 1, 1, 6): 77.0,
|
|
43
|
+
datetime(2020, 1, 1, 7): 88.0,
|
|
44
|
+
datetime(2020, 1, 1, 8): 99.0,
|
|
45
|
+
datetime(2020, 1, 1, 9): 100.1,
|
|
46
|
+
datetime(2020, 1, 1, 10): 111.1,
|
|
47
|
+
datetime(2020, 1, 1, 11): 122.1,
|
|
48
|
+
datetime(2020, 1, 1, 12): 133.1,
|
|
49
|
+
datetime(2020, 1, 1, 13): 144.1,
|
|
50
|
+
datetime(2020, 1, 1, 14): 155.1,
|
|
51
|
+
datetime(2020, 1, 1, 15): 166.1,
|
|
52
|
+
datetime(2020, 1, 1, 16): 177.1,
|
|
53
|
+
datetime(2020, 1, 1, 17): 188.1,
|
|
54
|
+
datetime(2020, 1, 1, 18): 199.1,
|
|
55
|
+
datetime(2020, 1, 1, 19): 200.2,
|
|
56
|
+
datetime(2020, 1, 1, 20): 211.2,
|
|
57
|
+
datetime(2020, 1, 1, 21): 222.2,
|
|
58
|
+
datetime(2020, 1, 1, 22): 233.2,
|
|
59
|
+
datetime(2020, 1, 1, 23): 244.2
|
|
60
|
+
},
|
|
61
|
+
upsertMode=UpsertMode.Merge
|
|
35
62
|
)
|
|
36
63
|
|
|
37
64
|
mkdservice.upsertData(data)
|
|
@@ -42,7 +69,7 @@ res = (
|
|
|
42
69
|
query.createVersioned()
|
|
43
70
|
.forMarketData([registered.marketDataId])
|
|
44
71
|
.inAbsoluteDateRange("2020-01-01", "2020-01-02")
|
|
45
|
-
.inTimeZone("
|
|
72
|
+
.inTimeZone("UTC")
|
|
46
73
|
.inGranularity(Granularity.Hour)
|
|
47
74
|
# .forMUV()
|
|
48
75
|
# .forLastNVersions(2)
|
|
@@ -57,7 +84,7 @@ deleteData = Artesian.MarketData.DeleteData(
|
|
|
57
84
|
ID=Artesian.MarketData.MarketDataIdentifier(
|
|
58
85
|
registered.providerName, registered.marketDataName
|
|
59
86
|
),
|
|
60
|
-
timezone="
|
|
87
|
+
timezone="UTC",
|
|
61
88
|
rangeStart=datetime(2020, 1, 1, 6),
|
|
62
89
|
rangeEnd=datetime(2020, 1, 1, 18),
|
|
63
90
|
version=testVersion,
|
|
@@ -69,7 +96,7 @@ res = (
|
|
|
69
96
|
query.createVersioned()
|
|
70
97
|
.forMarketData([registered.marketDataId])
|
|
71
98
|
.inAbsoluteDateRange("2020-01-01", "2020-01-02")
|
|
72
|
-
.inTimeZone("
|
|
99
|
+
.inTimeZone("UTC")
|
|
73
100
|
.inGranularity(Granularity.Hour)
|
|
74
101
|
.forVersion("2020-01-01T12:00:00")
|
|
75
102
|
.execute()
|
|
@@ -101,5 +128,53 @@ res = (
|
|
|
101
128
|
|
|
102
129
|
print(res)
|
|
103
130
|
|
|
131
|
+
data = Artesian.MarketData.UpsertData(
|
|
132
|
+
marketIdentifier,
|
|
133
|
+
"UTC",
|
|
134
|
+
version=testVersion,
|
|
135
|
+
rows={
|
|
136
|
+
datetime(2020, 1, 1, 3): 944.0,
|
|
137
|
+
datetime(2020, 1, 1, 4): 955.0,
|
|
138
|
+
datetime(2020, 1, 1, 5): 966.0,
|
|
139
|
+
datetime(2020, 1, 1, 6): 977.0,
|
|
140
|
+
datetime(2020, 1, 1, 7): 988.0,
|
|
141
|
+
datetime(2020, 1, 1, 8): 999.0,
|
|
142
|
+
datetime(2020, 1, 1, 9): 9100.1,
|
|
143
|
+
datetime(2020, 1, 1, 10): 9111.1,
|
|
144
|
+
datetime(2020, 1, 1, 11): 9122.1,
|
|
145
|
+
datetime(2020, 1, 1, 12): 9133.1,
|
|
146
|
+
datetime(2020, 1, 1, 13): 9144.1,
|
|
147
|
+
datetime(2020, 1, 1, 14): 9155.1,
|
|
148
|
+
datetime(2020, 1, 1, 15): 9166.1,
|
|
149
|
+
datetime(2020, 1, 1, 16): 9177.1,
|
|
150
|
+
datetime(2020, 1, 1, 17): 9188.1,
|
|
151
|
+
datetime(2020, 1, 1, 18): 9199.1,
|
|
152
|
+
datetime(2020, 1, 1, 19): 9200.2,
|
|
153
|
+
datetime(2020, 1, 1, 20): 9211.2,
|
|
154
|
+
datetime(2020, 1, 1, 21): 9222.2,
|
|
155
|
+
datetime(2020, 1, 1, 22): 9233.2,
|
|
156
|
+
datetime(2020, 1, 1, 23): 9244.2
|
|
157
|
+
},
|
|
158
|
+
upsertMode=UpsertMode.Replace
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
mkdservice.upsertData(data)
|
|
162
|
+
|
|
163
|
+
query = Query.QueryService(cfg)
|
|
164
|
+
|
|
165
|
+
res = (
|
|
166
|
+
query.createVersioned()
|
|
167
|
+
.forMarketData([registered.marketDataId])
|
|
168
|
+
.inAbsoluteDateRange("2020-01-01", "2020-01-02")
|
|
169
|
+
.inTimeZone("UTC")
|
|
170
|
+
.inGranularity(Granularity.Hour)
|
|
171
|
+
# .forMUV()
|
|
172
|
+
# .forLastNVersions(2)
|
|
173
|
+
.forVersion("2020-01-01T12:00:00")
|
|
174
|
+
.execute()
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
print(res)
|
|
178
|
+
|
|
104
179
|
# Delete the curve completely
|
|
105
180
|
mkdservice.deleteMarketData(registered.marketDataId)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
import Artesian
|
|
3
|
+
from Artesian import Query
|
|
4
|
+
from dateutil import tz
|
|
5
|
+
from Artesian import MarketData
|
|
6
|
+
from Artesian.Granularity import Granularity
|
|
7
|
+
from Artesian.MarketData._Enum.UpsertMode import UpsertMode
|
|
8
|
+
|
|
9
|
+
cfg = Artesian.ArtesianConfig("https://arkive.artesian.cloud/tenantName/", "APIKey")
|
|
10
|
+
mkdservice = Artesian.MarketData.MarketDataService(cfg)
|
|
11
|
+
|
|
12
|
+
mktId = Artesian.MarketData.MarketDataIdentifier("PythonSDK", "TestBidAskWriteAndRead")
|
|
13
|
+
|
|
14
|
+
registered = mkdservice.readMarketDataRegistryByName(mktId.provider, mktId.name)
|
|
15
|
+
|
|
16
|
+
mktDataInput = Artesian.MarketData.MarketDataEntityInput(
|
|
17
|
+
mktId.provider,
|
|
18
|
+
mktId.name,
|
|
19
|
+
Granularity.Hour,
|
|
20
|
+
MarketData.MarketDataType.BidAsk,
|
|
21
|
+
"CET",
|
|
22
|
+
tags={"TestSDKPython": ["PythonValue2"]}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if registered is None:
|
|
26
|
+
registered = mkdservice.registerMarketData(mktDataInput)
|
|
27
|
+
|
|
28
|
+
bidAsk = MarketData.UpsertData(
|
|
29
|
+
mktId,
|
|
30
|
+
"UTC",
|
|
31
|
+
bidAsk={
|
|
32
|
+
datetime(2020, 1, 1, 3): {
|
|
33
|
+
"Feb-20": MarketData.BidAskValue(bestBidPrice=15.5, bestAskQuantity=20.3, lastPrice=16.7, lastQuantity=14.1),
|
|
34
|
+
"Mar-20": MarketData.BidAskValue(bestBidPrice=25.5, bestAskQuantity=30.4, lastPrice=26.4, lastQuantity=24.3),
|
|
35
|
+
},
|
|
36
|
+
datetime(2020, 1, 1, 6): {
|
|
37
|
+
"Feb-20": MarketData.BidAskValue(bestBidPrice=15.7, bestAskQuantity=20.2, lastPrice=16.6, lastQuantity=14.7),
|
|
38
|
+
"Mar-20": MarketData.BidAskValue(bestBidPrice=25.4, bestAskQuantity=30.3, lastPrice=26.8, lastQuantity=24.9),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
downloadedAt=datetime(2020, 1, 3).replace(tzinfo=tz.UTC),
|
|
42
|
+
upsertMode=UpsertMode.Merge
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
mkdservice.upsertData(bidAsk)
|
|
46
|
+
|
|
47
|
+
query = Query.QueryService(cfg)
|
|
48
|
+
|
|
49
|
+
res = (
|
|
50
|
+
query.createBidAsk()
|
|
51
|
+
.forMarketData([registered.marketDataId])
|
|
52
|
+
.inAbsoluteDateRange("2020-01-01", "2020-01-02")
|
|
53
|
+
.forProducts(["Feb-20", "Mar-20"])
|
|
54
|
+
.inTimeZone("CET")
|
|
55
|
+
.execute()
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
print(res)
|
|
59
|
+
|
|
60
|
+
bidAsk2 = MarketData.UpsertData(
|
|
61
|
+
mktId,
|
|
62
|
+
"UTC",
|
|
63
|
+
bidAsk={
|
|
64
|
+
datetime(2020, 1, 1, 6): {
|
|
65
|
+
"Mar-20": MarketData.BidAskValue(bestBidPrice=25.2, bestAskQuantity=20.8, lastPrice=16.4, lastQuantity=24.3),
|
|
66
|
+
},
|
|
67
|
+
datetime(2020, 1, 1, 12): {
|
|
68
|
+
"Mar-20": MarketData.BidAskValue(bestBidPrice=25.1, bestAskQuantity=20.5, lastPrice=16.8, lastQuantity=24.7),
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
downloadedAt=datetime(2020, 1, 3).replace(tzinfo=tz.UTC),
|
|
72
|
+
upsertMode=UpsertMode.Replace
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
mkdservice.upsertData(bidAsk2)
|
|
76
|
+
|
|
77
|
+
query2 = Query.QueryService(cfg)
|
|
78
|
+
|
|
79
|
+
res2 = (
|
|
80
|
+
query2.createBidAsk()
|
|
81
|
+
.forMarketData([registered.marketDataId])
|
|
82
|
+
.inAbsoluteDateRange("2020-01-01", "2020-01-02")
|
|
83
|
+
.forProducts(["Feb-20", "Mar-20"])
|
|
84
|
+
.inTimeZone("CET")
|
|
85
|
+
.execute()
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
print(res2)
|
|
89
|
+
|
|
90
|
+
# Delete the curve completely
|
|
91
|
+
mkdservice.deleteMarketData(registered.marketDataId)
|