pycarlo 0.12.24__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.

Potentially problematic release.


This version of pycarlo might be problematic. Click here for more details.

Files changed (48) hide show
  1. pycarlo/__init__.py +0 -0
  2. pycarlo/common/__init__.py +31 -0
  3. pycarlo/common/errors.py +31 -0
  4. pycarlo/common/files.py +78 -0
  5. pycarlo/common/http.py +36 -0
  6. pycarlo/common/mcon.py +26 -0
  7. pycarlo/common/retries.py +129 -0
  8. pycarlo/common/settings.py +89 -0
  9. pycarlo/common/utils.py +51 -0
  10. pycarlo/core/__init__.py +10 -0
  11. pycarlo/core/client.py +267 -0
  12. pycarlo/core/endpoint.py +289 -0
  13. pycarlo/core/operations.py +25 -0
  14. pycarlo/core/session.py +127 -0
  15. pycarlo/features/__init__.py +10 -0
  16. pycarlo/features/circuit_breakers/__init__.py +3 -0
  17. pycarlo/features/circuit_breakers/exceptions.py +10 -0
  18. pycarlo/features/circuit_breakers/service.py +346 -0
  19. pycarlo/features/dbt/__init__.py +3 -0
  20. pycarlo/features/dbt/dbt_importer.py +208 -0
  21. pycarlo/features/dbt/queries.py +31 -0
  22. pycarlo/features/exceptions.py +18 -0
  23. pycarlo/features/metadata/__init__.py +32 -0
  24. pycarlo/features/metadata/asset_allow_block_list.py +22 -0
  25. pycarlo/features/metadata/asset_filters_container.py +79 -0
  26. pycarlo/features/metadata/base_allow_block_list.py +137 -0
  27. pycarlo/features/metadata/metadata_allow_block_list.py +94 -0
  28. pycarlo/features/metadata/metadata_filters_container.py +262 -0
  29. pycarlo/features/pii/__init__.py +5 -0
  30. pycarlo/features/pii/constants.py +3 -0
  31. pycarlo/features/pii/pii_filterer.py +179 -0
  32. pycarlo/features/pii/queries.py +20 -0
  33. pycarlo/features/pii/service.py +56 -0
  34. pycarlo/features/user/__init__.py +4 -0
  35. pycarlo/features/user/exceptions.py +10 -0
  36. pycarlo/features/user/models.py +9 -0
  37. pycarlo/features/user/queries.py +13 -0
  38. pycarlo/features/user/service.py +71 -0
  39. pycarlo/lib/README.md +35 -0
  40. pycarlo/lib/__init__.py +0 -0
  41. pycarlo/lib/schema.json +210020 -0
  42. pycarlo/lib/schema.py +82620 -0
  43. pycarlo/lib/types.py +68 -0
  44. pycarlo-0.12.24.dist-info/LICENSE +201 -0
  45. pycarlo-0.12.24.dist-info/METADATA +249 -0
  46. pycarlo-0.12.24.dist-info/RECORD +48 -0
  47. pycarlo-0.12.24.dist-info/WHEEL +5 -0
  48. pycarlo-0.12.24.dist-info/top_level.txt +1 -0
pycarlo/lib/types.py ADDED
@@ -0,0 +1,68 @@
1
+ """
2
+ Custom GraphQL types for the Monte Carlo Python Schema Library.
3
+
4
+ This module provides custom implementations of/replacements for sgqlc types that are used
5
+ in the auto-generated schema.
6
+ """
7
+
8
+ import logging
9
+ from typing import Any, Optional, Union
10
+
11
+ import sgqlc.types
12
+
13
+ logger = logging.getLogger(__name__)
14
+
15
+
16
+ class Enum(sgqlc.types.Enum):
17
+ """
18
+ A backward-compatible GraphQL enum type that gracefully handles unknown values.
19
+
20
+ Problem:
21
+ When new enum values are added to the Monte Carlo GraphQL API, older SDK versions
22
+ that don't have these values in their generated schema will crash with a ValueError
23
+ when trying to deserialize API responses containing the new values.
24
+
25
+ Solution:
26
+ This custom Enum class returns unknown enum values as plain strings instead of
27
+ raising an error. Since sgqlc enums are already represented as strings internally,
28
+ this maintains full compatibility with existing code while preventing crashes.
29
+
30
+ Behavior:
31
+ - Known enum values: Returned as strings (same as sgqlc.types.Enum)
32
+ - Unknown enum values: Returned as strings with a warning logged
33
+ - All comparisons, collections, and operations work identically
34
+
35
+ Example:
36
+ # Previous Values for EntitlementTypes = ['SSO', 'MULTI_WORKSPACE']
37
+ # API is updated to return new value: ['SSO', 'NEW_FEATURE', 'MULTI_WORKSPACE']
38
+
39
+ # With standard sgqlc.types.Enum:
40
+ # ValueError: EntitlementTypes does not accept value NEW_FEATURE
41
+
42
+ # With this Enum:
43
+ # Will return the new value as str and log a warning, no exception raised
44
+
45
+ # Code still works:
46
+ if 'SSO' in entitlements: # Works
47
+ enable_sso()
48
+ if 'NEW_FEATURE' in entitlements: # Also works
49
+ enable_new_feature()
50
+ """
51
+
52
+ def __new__(
53
+ cls, json_data: Any, _: Optional[Any] = None
54
+ ) -> Union[str, sgqlc.types.Variable, None]:
55
+ try:
56
+ return sgqlc.types.get_variable_or_none(json_data)
57
+ except ValueError:
58
+ pass
59
+
60
+ if json_data not in cls:
61
+ # Log warning but don't crash - return the unknown value as a string
62
+ logger.warning(
63
+ f"Unknown enum value '{json_data}' for {cls.__name__}. "
64
+ f"This may indicate the SDK is out of date. Returning raw string value."
65
+ )
66
+ return str(json_data)
67
+
68
+ return str(json_data)
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.1
2
+ Name: pycarlo
3
+ Version: 0.12.24
4
+ Summary: Monte Carlo's Python SDK
5
+ Home-page: https://www.montecarlodata.com/
6
+ Author: Monte Carlo Data, Inc
7
+ Author-email: info@montecarlodata.com
8
+ License: Apache Software License (Apache 2.0)
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Natural Language :: English
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: dataclasses-json<6.0.0,>=0.5.7
23
+ Requires-Dist: python-box>=5.0.0
24
+ Requires-Dist: requests<3.0.0,>=2.0.0
25
+ Requires-Dist: responses>=0.20.0
26
+ Requires-Dist: sgqlc<17.0,>=14.1
27
+
28
+ # Pycarlo - Monte Carlo's Python SDK
29
+
30
+ ## Installation
31
+
32
+ Requires Python 3.9 or greater. Normally you can install and update using pip. For instance:
33
+
34
+ ```shell
35
+ virtualenv venv
36
+ . venv/bin/activate
37
+
38
+ pip install -U pycarlo
39
+ ```
40
+
41
+ ## Overview
42
+
43
+ Pycarlo comprises two components: `core` and `features`.
44
+
45
+ All Monte Carlo API queries and mutations that you could execute via the API are supported via the
46
+ `core` library. Operations can be executed as first class objects, using
47
+ [sgqlc](https://github.com/profusion/sgqlc), or as raw GQL with variables. In both cases, a
48
+ consistent object where fields can be referenced by dot notation and the more pythonic snake_case is
49
+ returned for ease of use.
50
+
51
+ The `features` library provides additional convenience for performing common operations like with
52
+ dbt, circuit breaking, and pii filtering.
53
+
54
+ Note that an API Key is required to use the SDK. See
55
+ [our docs on generating API keys](https://docs.getmontecarlo.com/docs/developer-resources#creating-an-api-key)
56
+ for details.
57
+
58
+ ## Basic usage
59
+
60
+ ### Core
61
+
62
+ ```python
63
+ from pycarlo.core import Client, Query, Mutation
64
+
65
+ # First create a client. This creates a session using the 'default' profile from
66
+ # '~/.mcd/profiles.ini'. This profile is created automatically via
67
+ # `montecarlo configure` on the CLI. See the session subsection for
68
+ # customizations, options and alternatives (e.g. using the environment, params,
69
+ # named profiles, etc.)
70
+ client = Client()
71
+
72
+ # Now you can can execute a query. For instance, getUser (selecting the email field).
73
+ # This would be like executing -
74
+ # curl --location --request POST 'https://api.getmontecarlo.com/graphql' \
75
+ # --header 'x-mcd-id: <ID>' \
76
+ # --header 'x-mcd-token: <TOKEN>' \
77
+ # --header 'Content-Type: application/json' \
78
+ # --data-raw '{"query": "query {getUser {email}}"}'
79
+ # Notice how the CamelCase from the Graphql query is converted to snake_case in
80
+ # both the request and response.
81
+ query = Query()
82
+ query.get_user.__fields__('email')
83
+ print(client(query).get_user.email)
84
+
85
+ # You can also execute a query that requires variables. For instance,
86
+ # testTelnetConnection (selecting all fields).
87
+ query = Query()
88
+ query.test_telnet_connection(host='montecarlodata.com', port=443)
89
+ print(client(query))
90
+
91
+ # If necessary, you can always generate (e.g. print) the raw query that would be executed.
92
+ print(query)
93
+ # query {
94
+ # testTelnetConnection(host: "montecarlodata.com", port: 443) {
95
+ # success
96
+ # validations {
97
+ # type
98
+ # message
99
+ # }
100
+ # warnings {
101
+ # type
102
+ # message
103
+ # }
104
+ # }
105
+ # }
106
+
107
+ # If you are not a fan of sgqlc operations (Query and Mutation) you can also execute any
108
+ # raw query using the client. For instance, if we want the first 10 tables from getTables.
109
+ get_table_query = """
110
+ query getTables{
111
+ getTables(first: 10) {
112
+ edges {
113
+ node {
114
+ fullTableId
115
+ }
116
+ }
117
+ }
118
+ }
119
+ """
120
+ response = client(get_table_query)
121
+ # This returns a Box object where fields can be accessed using dot notation.
122
+ # Notice how unlike with the API the response uses the more Pythonic snake_case.
123
+ for edge in response.get_tables.edges:
124
+ print(edge.node.full_table_id)
125
+ # The response can still be processed as a standard dictionary.
126
+ print(response['get_tables']['edges'][0]['node']['full_table_id'])
127
+
128
+ # You can also execute any mutations too. For instance, generateCollectorTemplate
129
+ # (selecting the templateLaunchUrl).
130
+ mutation = Mutation()
131
+ mutation.generate_collector_template().dc.template_launch_url()
132
+ print(client(mutation))
133
+
134
+ # Any errors will raise a GqlError with details. For instance, executing above with an
135
+ # invalid region.
136
+ mutation = Mutation()
137
+ mutation.generate_collector_template(region='artemis')
138
+ print(client(mutation))
139
+ # pycarlo.common.errors.GqlError: [
140
+ # {'message': 'Region "\'artemis\'" not currently active.'...
141
+ # ]
142
+ ```
143
+
144
+ ### Examples
145
+
146
+ We have [a few examples here you can reference](./examples).
147
+
148
+ See [Monte Carlo's API reference](https://apidocs.getmontecarlo.com/) for all supported queries and
149
+ mutations.
150
+
151
+ For details and additional examples on how to map (convert) GraphQL queries to `sgqlc` operations
152
+ please refer to [the sgqlc docs](https://sgqlc.readthedocs.io/en/latest/sgqlc.operation.html).
153
+
154
+ ### Features
155
+
156
+ You can use [pydoc](https://docs.python.org/library/pydoc.html) to retrieve documentation on any
157
+ feature packages (`pydoc pycarlo.features`).
158
+
159
+ For instance for [circuit breakers](https://docs.getmontecarlo.com/docs/circuit-breakers):
160
+
161
+ ```shell
162
+ pydoc pycarlo.features.circuit_breakers.service
163
+ ```
164
+
165
+ ## Session configuration
166
+
167
+ By default, when creating a client the `default` profile from `~/.mcd/profiles.ini` is used. This
168
+ file created via
169
+ [montecarlo configure](https://docs.getmontecarlo.com/docs/using-the-cli#setting-up-the-cli) on the
170
+ CLI. See [Monte Carlo's CLI reference](https://clidocs.getmontecarlo.com/) for more details.
171
+
172
+ You can override this usage by creating a custom `Session`. For instance, if you want to pass the ID
173
+ and Token:
174
+
175
+ ```python
176
+ from pycarlo.core import Client, Session
177
+
178
+ client = Client(session=Session(mcd_id='foo', mcd_token='bar'))
179
+ ```
180
+
181
+ Sessions support the following params:
182
+
183
+ - `mcd_id`: API Key ID.
184
+ - `mcd_token`: API secret.
185
+ - `mcd_profile`: Named profile containing credentials. This is created via the CLI (e.g.
186
+ `montecarlo configure --profile-name zeus`).
187
+ - `mcd_config_path`: Path to file containing credentials. Defaults to `~/.mcd/`.
188
+
189
+ You can also specify the API Key, secret or profile name using the following environment variables:
190
+
191
+ - `MCD_DEFAULT_API_ID`
192
+ - `MCD_DEFAULT_API_TOKEN`
193
+ - `MCD_DEFAULT_PROFILE`
194
+
195
+ When creating a session any explicitly passed `mcd_id` and `mcd_token` params take precedence,
196
+ followed by environmental variables and then any config-file options.
197
+
198
+ Environment variables can be mixed with passed credentials, but not the config-file profile.
199
+
200
+ **We do not recommend passing `mcd_token` as it is a secret and can be accidentally committed.**
201
+
202
+ ## Integration Gateway API
203
+
204
+ There are features that require the Integration Gateway API instead of the regular GraphQL
205
+ Application API, for example Airflow Callbacks invoked by the `airflow-mcd` library.
206
+
207
+ To use the Gateway you need to initialize the `Session` object passing a `scope` parameter and then
208
+ use `make_request` to invoke Gateway endpoints:
209
+
210
+ ```python
211
+ from pycarlo.core import Client, Session
212
+
213
+ client = Client(session=Session(mcd_id='foo', mcd_token='bar', scope='AirflowCallbacks'))
214
+ response = client.make_request(
215
+ path='/airflow/callbacks', method='POST', body={}, timeout_in_seconds=20
216
+ )
217
+ ```
218
+
219
+ ## Advanced configuration
220
+
221
+ The following values also be set by the environment:
222
+
223
+ - `MCD_VERBOSE_ERRORS`: Enable logging. This includes a trace ID for each session and request.
224
+ - `MCD_API_ENDPOINT`: Customize the endpoint where queries and mutations are executed.
225
+
226
+ ## Enum Backward Compatibility
227
+
228
+ Unlike the baseline `sgqlc` behavior, this SDK is designed to maintain backward compatibility when
229
+ new enum values are added to the Monte Carlo API. If the API returns an enum value that doesn't
230
+ exist in your SDK version, it will be returned as a string with a warning logged, rather than
231
+ raising an error. This allows older SDK versions to continue working when new features are added.
232
+
233
+ To avoid warnings and ensure full feature support, keep your SDK updated to the latest version.
234
+
235
+ ## Contributing
236
+
237
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
238
+
239
+ ## References
240
+
241
+ - Monte Carlo App: <https://getmontecarlo.com>
242
+ - Product docs: <https://docs.getmontecarlo.com>
243
+ - Status page: <https://status.getmontecarlo.com>
244
+ - API (and SDK): <https://apidocs.getmontecarlo.com>
245
+ - CLI: <https://clidocs.getmontecarlo.com>
246
+
247
+ ## License
248
+
249
+ Apache 2.0 - See the [LICENSE](./LICENSE) for more information.
@@ -0,0 +1,48 @@
1
+ pycarlo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pycarlo/common/__init__.py,sha256=HrV6VV9EPayWoxi9d1p5P55sx_DYTen0m8JXeOQQWMM,821
3
+ pycarlo/common/errors.py,sha256=xswSaB0qYJeNO8vDmJAdPxI37GXiOChi3O5L5odqi18,774
4
+ pycarlo/common/files.py,sha256=RDvf86A3ux4II2BXLwUNUbJOqMT4nIObYVexH0pAtsk,2168
5
+ pycarlo/common/http.py,sha256=s9AffJ6jXuW5yso1COPqMbKf9kc2dzjKRXbCjLx0t-M,1117
6
+ pycarlo/common/mcon.py,sha256=MoY7PPhTVCG7C2EH3IkFLCe1Qhbi0o726rKk53mrcdo,623
7
+ pycarlo/common/retries.py,sha256=NEKpVGQfXlkKGNHYCnATg9oRmskS0lOaPOkqGSx_yAE,4991
8
+ pycarlo/common/settings.py,sha256=KRrbmdbq93lb9HJPyidxhU00qDBcQc5H6ISrdjsrV4E,3130
9
+ pycarlo/common/utils.py,sha256=iql2fBBDwILDvRR15gkxuWMdivgfflMySOfzW7JLfgI,1570
10
+ pycarlo/core/__init__.py,sha256=_5VWu47qRHN3tSE5Ns74TuMzDdt_YTFi2C51tDzH-N8,205
11
+ pycarlo/core/client.py,sha256=fFhqrkOlcJ3hB2z8cKp-lr6tUXqr_BJ4i8iRqrjqfuw,9982
12
+ pycarlo/core/endpoint.py,sha256=nsMV-n-4YAek8oZjRtRf1yOUBpW4zm4AkNGk1lp1PYo,11378
13
+ pycarlo/core/operations.py,sha256=ZgHrbdJwkuPSy5OtwXUlhfgFMWV3AZ1SEnLUmFAGryM,605
14
+ pycarlo/core/session.py,sha256=D5GuKNyUhD06y4cKD5lauI7RcRoc2ky-whRsha8WKE8,4577
15
+ pycarlo/features/__init__.py,sha256=qQYUxiMsk4vI95q32VPQ9UHfAusEcwHsi9A1o-wlX1k,221
16
+ pycarlo/features/exceptions.py,sha256=H6m5BpIjwCkotfkgINRmDpUYrquVPpu0gKnyGd-i4q4,502
17
+ pycarlo/features/circuit_breakers/__init__.py,sha256=5ydaqLygNPJ7-0w35QCPJAUZGoy7gG-2a-h0zstowuU,113
18
+ pycarlo/features/circuit_breakers/exceptions.py,sha256=-ygc4SrPQg0X0JYGV34SoChDqodI-eoEyNKsrDpiWF0,266
19
+ pycarlo/features/circuit_breakers/service.py,sha256=TljwMOhA5igBumkpJwM22iEJGyvtQ4_VLqTLonHx2AY,14773
20
+ pycarlo/features/dbt/__init__.py,sha256=A2cFr8_aSY_kDw1m7jR6QkHfiBMC1cZ6O8WosF9XrRg,85
21
+ pycarlo/features/dbt/dbt_importer.py,sha256=eJb9Jiu7tAEb_xsLO-ycDOjjVm-LLfTtbAzlzIRxT5I,7328
22
+ pycarlo/features/dbt/queries.py,sha256=9o1HevRECYyGXQ0lG0LrN4iuuXCS-SWjz7NTgAAZIro,621
23
+ pycarlo/features/metadata/__init__.py,sha256=0RDVHnwPvQcNXkeXEAxL4VJ8VWrl2P0fft_Kl2nlo7I,912
24
+ pycarlo/features/metadata/asset_allow_block_list.py,sha256=jXCS7HtUJhexEXZyRzyN4MT-BPSaMTKWCWiBT_l-Ijo,761
25
+ pycarlo/features/metadata/asset_filters_container.py,sha256=O15SC6u7HMGlViYnX7H8MRFttQrIXQd3a0oOrz7My5U,3411
26
+ pycarlo/features/metadata/base_allow_block_list.py,sha256=c8zd0BXkNSfQ3LkNC_A0KrO2AsYtIowc8FjbdyDyDu0,4738
27
+ pycarlo/features/metadata/metadata_allow_block_list.py,sha256=HzgXE0WhwDZoBHeV04e8dwe88rUSVVnOl8nFEPlb0jA,3496
28
+ pycarlo/features/metadata/metadata_filters_container.py,sha256=p7FNg71KYZZrvgJmlx9rID2TAL_e9LKzNQZ9KKN5uGs,12812
29
+ pycarlo/features/pii/__init__.py,sha256=w5X-oD8HWaL6fP2jt40AhlXO-MNzlVAlhRaZ5kQqAZY,247
30
+ pycarlo/features/pii/constants.py,sha256=XWeiikXk9AtljdWsGfl49b9zI6w8EzK8F__Euc0vQ3w,70
31
+ pycarlo/features/pii/pii_filterer.py,sha256=k53b_V_mddY4A17-DJ5vQKszFDlUaiP3E650JFHAeJA,6209
32
+ pycarlo/features/pii/queries.py,sha256=IeV9Pdr1Jxc6uMYgKMeQ-beF0j635G2N0dZz4zAcoU4,272
33
+ pycarlo/features/pii/service.py,sha256=YEaFfxJrTuvnrRTm6cfqdJDL5cKw2Vx3woJgpBwLyko,1882
34
+ pycarlo/features/user/__init__.py,sha256=XgbIclLsy_1KHd3yMfcDuqa7YqKClbihscgH2nDzqxc,143
35
+ pycarlo/features/user/exceptions.py,sha256=Za5mPMynNDW_UQkfMbCSGjP1ht-xSUkwoI6hVOvgvTw,186
36
+ pycarlo/features/user/models.py,sha256=fhvS7tBhTtx7p9624yN5tzebXs5ERrl1XQ9B_DYor0E,126
37
+ pycarlo/features/user/queries.py,sha256=m97RvM0oiBlrU5xmOwe_JJ5N0G0NG5hIOeyQqN2O8_4,170
38
+ pycarlo/features/user/service.py,sha256=DHkhuonySaHro07NTd0YNe3cNkDk62CiRTY77dhVaMs,2890
39
+ pycarlo/lib/README.md,sha256=CVVrPPgje7pkXNNsPvwLSeUOm5aktb22MlttmoxX08k,1677
40
+ pycarlo/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
+ pycarlo/lib/schema.json,sha256=UTnO9C35A6lp-ecnPmfr5N7DQAaLDVsI2TcGMmuv7qM,6626491
42
+ pycarlo/lib/schema.py,sha256=wEIPX_cggQaaiKJ02AxUHALiVhGaNLfgF81BVS9cYLE,2879435
43
+ pycarlo/lib/types.py,sha256=lGOrm5Qm-SieDAkOkVOFSgyUJYGOjKnea961AD9Dv6s,2404
44
+ pycarlo-0.12.24.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
45
+ pycarlo-0.12.24.dist-info/METADATA,sha256=M9NRE1OJcKJeoDwl904ogjL40Uy7oQtJpETK9wDKaMs,8718
46
+ pycarlo-0.12.24.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
47
+ pycarlo-0.12.24.dist-info/top_level.txt,sha256=TIE04H4pgzGaFxAB-gvkmVAUOAoHxxFfhnEcpuQ5bF4,8
48
+ pycarlo-0.12.24.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.3.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ pycarlo