elastly 0.1.0__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.
Files changed (55) hide show
  1. elastly-0.1.0/LICENSE +21 -0
  2. elastly-0.1.0/PKG-INFO +100 -0
  3. elastly-0.1.0/README.md +79 -0
  4. elastly-0.1.0/elastly/__init__.py +117 -0
  5. elastly-0.1.0/elastly/api/__init__.py +7 -0
  6. elastly-0.1.0/elastly/api/ingest_api.py +1167 -0
  7. elastly-0.1.0/elastly/api/prices_api.py +349 -0
  8. elastly-0.1.0/elastly/api/writebacks_api.py +618 -0
  9. elastly-0.1.0/elastly/api_client.py +805 -0
  10. elastly-0.1.0/elastly/api_response.py +21 -0
  11. elastly-0.1.0/elastly/configuration.py +606 -0
  12. elastly-0.1.0/elastly/exceptions.py +219 -0
  13. elastly-0.1.0/elastly/models/__init__.py +49 -0
  14. elastly-0.1.0/elastly/models/ack_writebacks_response.py +94 -0
  15. elastly-0.1.0/elastly/models/api_error.py +93 -0
  16. elastly-0.1.0/elastly/models/api_error_error.py +102 -0
  17. elastly-0.1.0/elastly/models/batch_created_response.py +91 -0
  18. elastly-0.1.0/elastly/models/batch_status_response.py +110 -0
  19. elastly-0.1.0/elastly/models/claim_writebacks_request.py +90 -0
  20. elastly-0.1.0/elastly/models/claim_writebacks_response.py +97 -0
  21. elastly-0.1.0/elastly/models/claim_writebacks_response_tasks_inner.py +122 -0
  22. elastly-0.1.0/elastly/models/commit_batch_response.py +89 -0
  23. elastly-0.1.0/elastly/models/prices_request.py +98 -0
  24. elastly-0.1.0/elastly/models/prices_request_lines_inner.py +114 -0
  25. elastly-0.1.0/elastly/models/prices_response.py +97 -0
  26. elastly-0.1.0/elastly/models/prices_response_lines_inner.py +138 -0
  27. elastly-0.1.0/elastly/models/prices_response_lines_inner_one_of.py +131 -0
  28. elastly-0.1.0/elastly/models/prices_response_lines_inner_one_of1.py +105 -0
  29. elastly-0.1.0/elastly/models/prices_response_lines_inner_one_of_explanation.py +121 -0
  30. elastly-0.1.0/elastly/models/prices_response_lines_inner_one_of_explanation_drivers_inner.py +102 -0
  31. elastly-0.1.0/elastly/models/prices_response_lines_inner_one_of_reason_inner.py +95 -0
  32. elastly-0.1.0/elastly/models/stage_records_request.py +166 -0
  33. elastly-0.1.0/elastly/models/stage_records_request_one_of.py +107 -0
  34. elastly-0.1.0/elastly/models/stage_records_request_one_of1.py +107 -0
  35. elastly-0.1.0/elastly/models/stage_records_request_one_of1_records_inner.py +126 -0
  36. elastly-0.1.0/elastly/models/stage_records_request_one_of2.py +107 -0
  37. elastly-0.1.0/elastly/models/stage_records_request_one_of2_records_inner.py +160 -0
  38. elastly-0.1.0/elastly/models/stage_records_request_one_of2_records_inner_lines_inner.py +119 -0
  39. elastly-0.1.0/elastly/models/stage_records_request_one_of3.py +107 -0
  40. elastly-0.1.0/elastly/models/stage_records_request_one_of3_records_inner.py +131 -0
  41. elastly-0.1.0/elastly/models/stage_records_request_one_of3_records_inner_lines_inner.py +98 -0
  42. elastly-0.1.0/elastly/models/stage_records_request_one_of_records_inner.py +118 -0
  43. elastly-0.1.0/elastly/models/stage_records_response.py +90 -0
  44. elastly-0.1.0/elastly/models/writeback_ack_request.py +98 -0
  45. elastly-0.1.0/elastly/models/writeback_ack_request_results_inner.py +93 -0
  46. elastly-0.1.0/elastly/py.typed +0 -0
  47. elastly-0.1.0/elastly/rest.py +264 -0
  48. elastly-0.1.0/elastly.egg-info/PKG-INFO +100 -0
  49. elastly-0.1.0/elastly.egg-info/SOURCES.txt +54 -0
  50. elastly-0.1.0/elastly.egg-info/dependency_links.txt +1 -0
  51. elastly-0.1.0/elastly.egg-info/requires.txt +4 -0
  52. elastly-0.1.0/elastly.egg-info/top_level.txt +1 -0
  53. elastly-0.1.0/pyproject.toml +95 -0
  54. elastly-0.1.0/setup.cfg +7 -0
  55. elastly-0.1.0/setup.py +49 -0
elastly-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Elastly
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
elastly-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: elastly
3
+ Version: 0.1.0
4
+ Summary: Elastly API
5
+ Home-page: https://elastly.io/docs/sdk
6
+ Author: Elastly
7
+ Author-email: Elastly <support@elastly.io>
8
+ License: MIT
9
+ Project-URL: Repository, https://github.com/elastly/elastly-python
10
+ Keywords: OpenAPI,OpenAPI-Generator,Elastly API
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
15
+ Requires-Dist: python-dateutil>=2.8.2
16
+ Requires-Dist: pydantic>=2.11
17
+ Requires-Dist: typing-extensions>=4.7.1
18
+ Dynamic: author
19
+ Dynamic: home-page
20
+ Dynamic: license-file
21
+
22
+ # Elastly Python SDK
23
+
24
+ The official Python client for the [Elastly](https://elastly.io) REST API.
25
+
26
+ Elastly prices quote and order lines for B2B sellers. Send a line (product, customer, quantity) and get back a price with the reasoning behind it: which pricing rules fired, what each one added, and how confident the engine is. The engine learns from the outcomes you feed back, so prices improve over time.
27
+
28
+ This client covers the full v1 API:
29
+
30
+ - **Prices**: price up to 100 lines in one call.
31
+ - **Ingest**: push products, customers, quotes, and orders from your own system in staged batches.
32
+ - **Write-backs**: pull approved price changes into your system and confirm them once applied.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install elastly
38
+ ```
39
+
40
+ Requires Python 3.9 or newer.
41
+
42
+ ## Authenticate
43
+
44
+ Create an API key in the dashboard (Settings, then API keys). Keys are scoped: an `erp` key prices lines, a `connector` key ingests data and claims write-backs. Send the key as a bearer token.
45
+
46
+ ## Price a line
47
+
48
+ ```python
49
+ import uuid
50
+
51
+ import elastly
52
+
53
+ configuration = elastly.Configuration(access_token="elastly_live_...")
54
+
55
+ with elastly.ApiClient(configuration) as api_client:
56
+ prices = elastly.PricesApi(api_client)
57
+
58
+ response = prices.get_prices(
59
+ idempotency_key=str(uuid.uuid4()),
60
+ prices_request=elastly.PricesRequest(
61
+ lines=[
62
+ elastly.PricesRequestLinesInner(
63
+ product_sku="SKU-1042",
64
+ customer_external_id="CUST-88",
65
+ quantity=25,
66
+ )
67
+ ]
68
+ ),
69
+ )
70
+
71
+ for line in response.lines:
72
+ result = line.actual_instance
73
+ if result.ok:
74
+ print(result.price_cents, result.currency, result.reason_summary)
75
+ else:
76
+ print("failed:", result.code, result.message)
77
+ ```
78
+
79
+ Every response line is either a priced result (`ok` is true) or a per-line error. One bad line never fails the batch.
80
+
81
+ ## Retries and idempotency
82
+
83
+ `POST /v1/prices` requires an `Idempotency-Key` header. Use a fresh key for each logical request and reuse the same key on retries. A replay returns the stored response, so a retried call never prices twice.
84
+
85
+ ## Close the loop
86
+
87
+ Elastly learns from the difference between the price it recommended and the price your team actually charged. When you ingest quotes, echo the `pricingDecisionId` you received from the prices call on the matching quote line. Skip that and the engine has nothing to learn from.
88
+
89
+ ## Documentation
90
+
91
+ - [API reference](https://elastly.io/docs/api)
92
+ - Per-endpoint docs for this client live in [docs](./docs).
93
+
94
+ ## About this repository
95
+
96
+ This code is generated from the Elastly OpenAPI contract, so pull requests against generated files get overwritten by the next release. If something is broken or missing, open an issue or email support@elastly.io.
97
+
98
+ ## License
99
+
100
+ [MIT](./LICENSE)
@@ -0,0 +1,79 @@
1
+ # Elastly Python SDK
2
+
3
+ The official Python client for the [Elastly](https://elastly.io) REST API.
4
+
5
+ Elastly prices quote and order lines for B2B sellers. Send a line (product, customer, quantity) and get back a price with the reasoning behind it: which pricing rules fired, what each one added, and how confident the engine is. The engine learns from the outcomes you feed back, so prices improve over time.
6
+
7
+ This client covers the full v1 API:
8
+
9
+ - **Prices**: price up to 100 lines in one call.
10
+ - **Ingest**: push products, customers, quotes, and orders from your own system in staged batches.
11
+ - **Write-backs**: pull approved price changes into your system and confirm them once applied.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pip install elastly
17
+ ```
18
+
19
+ Requires Python 3.9 or newer.
20
+
21
+ ## Authenticate
22
+
23
+ Create an API key in the dashboard (Settings, then API keys). Keys are scoped: an `erp` key prices lines, a `connector` key ingests data and claims write-backs. Send the key as a bearer token.
24
+
25
+ ## Price a line
26
+
27
+ ```python
28
+ import uuid
29
+
30
+ import elastly
31
+
32
+ configuration = elastly.Configuration(access_token="elastly_live_...")
33
+
34
+ with elastly.ApiClient(configuration) as api_client:
35
+ prices = elastly.PricesApi(api_client)
36
+
37
+ response = prices.get_prices(
38
+ idempotency_key=str(uuid.uuid4()),
39
+ prices_request=elastly.PricesRequest(
40
+ lines=[
41
+ elastly.PricesRequestLinesInner(
42
+ product_sku="SKU-1042",
43
+ customer_external_id="CUST-88",
44
+ quantity=25,
45
+ )
46
+ ]
47
+ ),
48
+ )
49
+
50
+ for line in response.lines:
51
+ result = line.actual_instance
52
+ if result.ok:
53
+ print(result.price_cents, result.currency, result.reason_summary)
54
+ else:
55
+ print("failed:", result.code, result.message)
56
+ ```
57
+
58
+ Every response line is either a priced result (`ok` is true) or a per-line error. One bad line never fails the batch.
59
+
60
+ ## Retries and idempotency
61
+
62
+ `POST /v1/prices` requires an `Idempotency-Key` header. Use a fresh key for each logical request and reuse the same key on retries. A replay returns the stored response, so a retried call never prices twice.
63
+
64
+ ## Close the loop
65
+
66
+ Elastly learns from the difference between the price it recommended and the price your team actually charged. When you ingest quotes, echo the `pricingDecisionId` you received from the prices call on the matching quote line. Skip that and the engine has nothing to learn from.
67
+
68
+ ## Documentation
69
+
70
+ - [API reference](https://elastly.io/docs/api)
71
+ - Per-endpoint docs for this client live in [docs](./docs).
72
+
73
+ ## About this repository
74
+
75
+ This code is generated from the Elastly OpenAPI contract, so pull requests against generated files get overwritten by the next release. If something is broken or missing, open an issue or email support@elastly.io.
76
+
77
+ ## License
78
+
79
+ [MIT](./LICENSE)
@@ -0,0 +1,117 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Elastly API
7
+
8
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
9
+
10
+ The version of the OpenAPI document: 1.0.0
11
+ Contact: support@elastly.io
12
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
13
+
14
+ Do not edit the class manually.
15
+ """ # noqa: E501
16
+
17
+
18
+ __version__ = "0.1.0"
19
+
20
+ # Define package exports
21
+ __all__ = [
22
+ "IngestApi",
23
+ "PricesApi",
24
+ "WritebacksApi",
25
+ "ApiResponse",
26
+ "ApiClient",
27
+ "Configuration",
28
+ "OpenApiException",
29
+ "ApiTypeError",
30
+ "ApiValueError",
31
+ "ApiKeyError",
32
+ "ApiAttributeError",
33
+ "ApiException",
34
+ "AckWritebacksResponse",
35
+ "ApiError",
36
+ "ApiErrorError",
37
+ "BatchCreatedResponse",
38
+ "BatchStatusResponse",
39
+ "ClaimWritebacksRequest",
40
+ "ClaimWritebacksResponse",
41
+ "ClaimWritebacksResponseTasksInner",
42
+ "CommitBatchResponse",
43
+ "PricesRequest",
44
+ "PricesRequestLinesInner",
45
+ "PricesResponse",
46
+ "PricesResponseLinesInner",
47
+ "PricesResponseLinesInnerOneOf",
48
+ "PricesResponseLinesInnerOneOf1",
49
+ "PricesResponseLinesInnerOneOfExplanation",
50
+ "PricesResponseLinesInnerOneOfExplanationDriversInner",
51
+ "PricesResponseLinesInnerOneOfReasonInner",
52
+ "StageRecordsRequest",
53
+ "StageRecordsRequestOneOf",
54
+ "StageRecordsRequestOneOf1",
55
+ "StageRecordsRequestOneOf1RecordsInner",
56
+ "StageRecordsRequestOneOf2",
57
+ "StageRecordsRequestOneOf2RecordsInner",
58
+ "StageRecordsRequestOneOf2RecordsInnerLinesInner",
59
+ "StageRecordsRequestOneOf3",
60
+ "StageRecordsRequestOneOf3RecordsInner",
61
+ "StageRecordsRequestOneOf3RecordsInnerLinesInner",
62
+ "StageRecordsRequestOneOfRecordsInner",
63
+ "StageRecordsResponse",
64
+ "WritebackAckRequest",
65
+ "WritebackAckRequestResultsInner",
66
+ ]
67
+
68
+ # import apis into sdk package
69
+ from elastly.api.ingest_api import IngestApi as IngestApi
70
+ from elastly.api.prices_api import PricesApi as PricesApi
71
+ from elastly.api.writebacks_api import WritebacksApi as WritebacksApi
72
+
73
+ # import ApiClient
74
+ from elastly.api_response import ApiResponse as ApiResponse
75
+ from elastly.api_client import ApiClient as ApiClient
76
+ from elastly.configuration import Configuration as Configuration
77
+ from elastly.exceptions import OpenApiException as OpenApiException
78
+ from elastly.exceptions import ApiTypeError as ApiTypeError
79
+ from elastly.exceptions import ApiValueError as ApiValueError
80
+ from elastly.exceptions import ApiKeyError as ApiKeyError
81
+ from elastly.exceptions import ApiAttributeError as ApiAttributeError
82
+ from elastly.exceptions import ApiException as ApiException
83
+
84
+ # import models into sdk package
85
+ from elastly.models.ack_writebacks_response import AckWritebacksResponse as AckWritebacksResponse
86
+ from elastly.models.api_error import ApiError as ApiError
87
+ from elastly.models.api_error_error import ApiErrorError as ApiErrorError
88
+ from elastly.models.batch_created_response import BatchCreatedResponse as BatchCreatedResponse
89
+ from elastly.models.batch_status_response import BatchStatusResponse as BatchStatusResponse
90
+ from elastly.models.claim_writebacks_request import ClaimWritebacksRequest as ClaimWritebacksRequest
91
+ from elastly.models.claim_writebacks_response import ClaimWritebacksResponse as ClaimWritebacksResponse
92
+ from elastly.models.claim_writebacks_response_tasks_inner import ClaimWritebacksResponseTasksInner as ClaimWritebacksResponseTasksInner
93
+ from elastly.models.commit_batch_response import CommitBatchResponse as CommitBatchResponse
94
+ from elastly.models.prices_request import PricesRequest as PricesRequest
95
+ from elastly.models.prices_request_lines_inner import PricesRequestLinesInner as PricesRequestLinesInner
96
+ from elastly.models.prices_response import PricesResponse as PricesResponse
97
+ from elastly.models.prices_response_lines_inner import PricesResponseLinesInner as PricesResponseLinesInner
98
+ from elastly.models.prices_response_lines_inner_one_of import PricesResponseLinesInnerOneOf as PricesResponseLinesInnerOneOf
99
+ from elastly.models.prices_response_lines_inner_one_of1 import PricesResponseLinesInnerOneOf1 as PricesResponseLinesInnerOneOf1
100
+ from elastly.models.prices_response_lines_inner_one_of_explanation import PricesResponseLinesInnerOneOfExplanation as PricesResponseLinesInnerOneOfExplanation
101
+ from elastly.models.prices_response_lines_inner_one_of_explanation_drivers_inner import PricesResponseLinesInnerOneOfExplanationDriversInner as PricesResponseLinesInnerOneOfExplanationDriversInner
102
+ from elastly.models.prices_response_lines_inner_one_of_reason_inner import PricesResponseLinesInnerOneOfReasonInner as PricesResponseLinesInnerOneOfReasonInner
103
+ from elastly.models.stage_records_request import StageRecordsRequest as StageRecordsRequest
104
+ from elastly.models.stage_records_request_one_of import StageRecordsRequestOneOf as StageRecordsRequestOneOf
105
+ from elastly.models.stage_records_request_one_of1 import StageRecordsRequestOneOf1 as StageRecordsRequestOneOf1
106
+ from elastly.models.stage_records_request_one_of1_records_inner import StageRecordsRequestOneOf1RecordsInner as StageRecordsRequestOneOf1RecordsInner
107
+ from elastly.models.stage_records_request_one_of2 import StageRecordsRequestOneOf2 as StageRecordsRequestOneOf2
108
+ from elastly.models.stage_records_request_one_of2_records_inner import StageRecordsRequestOneOf2RecordsInner as StageRecordsRequestOneOf2RecordsInner
109
+ from elastly.models.stage_records_request_one_of2_records_inner_lines_inner import StageRecordsRequestOneOf2RecordsInnerLinesInner as StageRecordsRequestOneOf2RecordsInnerLinesInner
110
+ from elastly.models.stage_records_request_one_of3 import StageRecordsRequestOneOf3 as StageRecordsRequestOneOf3
111
+ from elastly.models.stage_records_request_one_of3_records_inner import StageRecordsRequestOneOf3RecordsInner as StageRecordsRequestOneOf3RecordsInner
112
+ from elastly.models.stage_records_request_one_of3_records_inner_lines_inner import StageRecordsRequestOneOf3RecordsInnerLinesInner as StageRecordsRequestOneOf3RecordsInnerLinesInner
113
+ from elastly.models.stage_records_request_one_of_records_inner import StageRecordsRequestOneOfRecordsInner as StageRecordsRequestOneOfRecordsInner
114
+ from elastly.models.stage_records_response import StageRecordsResponse as StageRecordsResponse
115
+ from elastly.models.writeback_ack_request import WritebackAckRequest as WritebackAckRequest
116
+ from elastly.models.writeback_ack_request_results_inner import WritebackAckRequestResultsInner as WritebackAckRequestResultsInner
117
+
@@ -0,0 +1,7 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from elastly.api.ingest_api import IngestApi
5
+ from elastly.api.prices_api import PricesApi
6
+ from elastly.api.writebacks_api import WritebacksApi
7
+