proxyml-core 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.
@@ -0,0 +1,183 @@
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 made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of developing and
55
+ discussing the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any other
81
+ Contribution incorporated within the Work constitutes patent or
82
+ contributory patent infringement, then any patent licenses granted to
83
+ You under this License for that Work shall terminate as of the date
84
+ such litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text
107
+ file distributed as part of the Derivative Works; within
108
+ the Source form or documentation, if provided along with the
109
+ Derivative Works; or, within a display generated by the
110
+ Derivative Works, if and wherever such third-party notices
111
+ normally appear. The contents of the NOTICE file are for
112
+ informational purposes only and do not modify the License.
113
+ You may add Your own attribution notices within Derivative
114
+ Works that You distribute, alongside or in addition to the
115
+ NOTICE text from the Work, provided that such additional
116
+ attribution notices cannot be construed as modifying the License.
117
+
118
+ You may add Your own license statement for Your modifications and
119
+ may provide additional grant of rights to use, copy, modify, merge,
120
+ publish, distribute, sublicense, and/or sell copies of the
121
+ Contribution and such Derivative Works.
122
+
123
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
124
+ any Contribution intentionally submitted for inclusion in the Work
125
+ by You to the Licensor shall be under the terms and conditions of
126
+ this License, without any additional terms or conditions.
127
+ Notwithstanding the above, nothing herein shall supersede or modify
128
+ the terms of any separate license agreement you may have executed
129
+ with Licensor regarding such Contributions.
130
+
131
+ 6. Trademarks. This License does not grant permission to use the trade
132
+ names, trademarks, service marks, or product names of the Licensor,
133
+ except as required for reasonable and customary use in describing the
134
+ origin of the Work and reproducing the content of the NOTICE file.
135
+
136
+ 7. Disclaimer of Warranty. Unless required by applicable law or
137
+ agreed to in writing, Licensor provides the Work (and each
138
+ Contributor provides its Contributions) on an "AS IS" BASIS,
139
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
140
+ implied, including, without limitation, any conditions of TITLE,
141
+ NONINFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
142
+ PURPOSE. You are solely responsible for determining the
143
+ appropriateness of using or reproducing the Work and assume any
144
+ risks associated with Your exercise of permissions under this License.
145
+
146
+ 8. Limitation of Liability. In no event and under no legal theory,
147
+ whether in tort (including negligence), contract, or otherwise,
148
+ unless required by applicable law (such as deliberate and grossly
149
+ negligent acts) or agreed to in writing, shall any Contributor be
150
+ liable to You for damages, including any direct, indirect, special,
151
+ incidental, or exemplary damages of any character arising as a
152
+ result of this License or out of the use or inability to use the
153
+ Work (including but not limited to damages for loss of goodwill,
154
+ work stoppage, computer failure or malfunction, or all other
155
+ commercial damages or losses), even if such Contributor has been
156
+ advised of the possibility of such damages.
157
+
158
+ 9. Accepting Warranty or Additional Liability. While redistributing
159
+ the Work or Derivative Works thereof, You may choose to offer,
160
+ and charge a fee for, acceptance of support, warranty, indemnity,
161
+ or other liability obligations and/or rights consistent with this
162
+ License. However, in accepting such obligations, You may charge only
163
+ on Your own behalf and on Your sole responsibility, not on behalf of
164
+ any other Contributor, and only if You agree to indemnify, defend,
165
+ and hold each Contributor harmless for any liability incurred by,
166
+ or claims asserted against, such Contributor by reason of your
167
+ accepting any warranty or additional liability.
168
+
169
+ END OF TERMS AND CONDITIONS
170
+
171
+ Copyright 2026 ProxyML
172
+
173
+ Licensed under the Apache License, Version 2.0 (the "License");
174
+ you may not use this file except in compliance with the License.
175
+ You may obtain a copy of the License at
176
+
177
+ http://www.apache.org/licenses/LICENSE-2.0
178
+
179
+ Unless required by applicable law or agreed to in writing, software
180
+ distributed under the License is distributed on an "AS IS" BASIS,
181
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
182
+ See the License for the specific language governing permissions and
183
+ limitations under the License.
@@ -0,0 +1,239 @@
1
+ Metadata-Version: 2.4
2
+ Name: proxyml-core
3
+ Version: 0.1.0
4
+ Summary: Shared schema types, export contract, and modeling code for proxyml and its backend.
5
+ Author-email: ProxyML <contact@proxyml.ai>
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship made available under
41
+ the License, as indicated by a copyright notice that is included in
42
+ or attached to the work (an example is provided in the Appendix below).
43
+
44
+ "Derivative Works" shall mean any work, whether in Source or Object
45
+ form, that is based on (or derived from) the Work and for which the
46
+ editorial revisions, annotations, elaborations, or other modifications
47
+ represent, as a whole, an original work of authorship. For the purposes
48
+ of this License, Derivative Works shall not include works that remain
49
+ separable from, or merely link (or bind by name) to the interfaces of,
50
+ the Work and Derivative Works thereof.
51
+
52
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
53
+ in the Work by the copyright owner or by an individual or Legal Entity
54
+ authorized to submit on behalf of the copyright owner. For the purposes
55
+ of this definition, "submitted" means any form of electronic, verbal,
56
+ or written communication sent to the Licensor or its representatives,
57
+ including but not limited to communication on electronic mailing lists,
58
+ source code control systems, and issue tracking systems that are managed
59
+ by, or on behalf of, the Licensor for the purpose of developing and
60
+ discussing the Work, but excluding communication that is conspicuously
61
+ marked or designated in writing by the copyright owner as "Not a
62
+ Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
65
+ whom a Contribution has been received by the Licensor and included
66
+ within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by the combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a cross-claim
85
+ or counterclaim in a lawsuit) alleging that the Work or any other
86
+ Contribution incorporated within the Work constitutes patent or
87
+ contributory patent infringement, then any patent licenses granted to
88
+ You under this License for that Work shall terminate as of the date
89
+ such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or Derivative
97
+ Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, You must include a readable copy of the
110
+ attribution notices contained within such NOTICE file, in
111
+ at least one of the following places: within a NOTICE text
112
+ file distributed as part of the Derivative Works; within
113
+ the Source form or documentation, if provided along with the
114
+ Derivative Works; or, within a display generated by the
115
+ Derivative Works, if and wherever such third-party notices
116
+ normally appear. The contents of the NOTICE file are for
117
+ informational purposes only and do not modify the License.
118
+ You may add Your own attribution notices within Derivative
119
+ Works that You distribute, alongside or in addition to the
120
+ NOTICE text from the Work, provided that such additional
121
+ attribution notices cannot be construed as modifying the License.
122
+
123
+ You may add Your own license statement for Your modifications and
124
+ may provide additional grant of rights to use, copy, modify, merge,
125
+ publish, distribute, sublicense, and/or sell copies of the
126
+ Contribution and such Derivative Works.
127
+
128
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
129
+ any Contribution intentionally submitted for inclusion in the Work
130
+ by You to the Licensor shall be under the terms and conditions of
131
+ this License, without any additional terms or conditions.
132
+ Notwithstanding the above, nothing herein shall supersede or modify
133
+ the terms of any separate license agreement you may have executed
134
+ with Licensor regarding such Contributions.
135
+
136
+ 6. Trademarks. This License does not grant permission to use the trade
137
+ names, trademarks, service marks, or product names of the Licensor,
138
+ except as required for reasonable and customary use in describing the
139
+ origin of the Work and reproducing the content of the NOTICE file.
140
+
141
+ 7. Disclaimer of Warranty. Unless required by applicable law or
142
+ agreed to in writing, Licensor provides the Work (and each
143
+ Contributor provides its Contributions) on an "AS IS" BASIS,
144
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
145
+ implied, including, without limitation, any conditions of TITLE,
146
+ NONINFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
147
+ PURPOSE. You are solely responsible for determining the
148
+ appropriateness of using or reproducing the Work and assume any
149
+ risks associated with Your exercise of permissions under this License.
150
+
151
+ 8. Limitation of Liability. In no event and under no legal theory,
152
+ whether in tort (including negligence), contract, or otherwise,
153
+ unless required by applicable law (such as deliberate and grossly
154
+ negligent acts) or agreed to in writing, shall any Contributor be
155
+ liable to You for damages, including any direct, indirect, special,
156
+ incidental, or exemplary damages of any character arising as a
157
+ result of this License or out of the use or inability to use the
158
+ Work (including but not limited to damages for loss of goodwill,
159
+ work stoppage, computer failure or malfunction, or all other
160
+ commercial damages or losses), even if such Contributor has been
161
+ advised of the possibility of such damages.
162
+
163
+ 9. Accepting Warranty or Additional Liability. While redistributing
164
+ the Work or Derivative Works thereof, You may choose to offer,
165
+ and charge a fee for, acceptance of support, warranty, indemnity,
166
+ or other liability obligations and/or rights consistent with this
167
+ License. However, in accepting such obligations, You may charge only
168
+ on Your own behalf and on Your sole responsibility, not on behalf of
169
+ any other Contributor, and only if You agree to indemnify, defend,
170
+ and hold each Contributor harmless for any liability incurred by,
171
+ or claims asserted against, such Contributor by reason of your
172
+ accepting any warranty or additional liability.
173
+
174
+ END OF TERMS AND CONDITIONS
175
+
176
+ Copyright 2026 ProxyML
177
+
178
+ Licensed under the Apache License, Version 2.0 (the "License");
179
+ you may not use this file except in compliance with the License.
180
+ You may obtain a copy of the License at
181
+
182
+ http://www.apache.org/licenses/LICENSE-2.0
183
+
184
+ Unless required by applicable law or agreed to in writing, software
185
+ distributed under the License is distributed on an "AS IS" BASIS,
186
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
187
+ See the License for the specific language governing permissions and
188
+ limitations under the License.
189
+
190
+ Project-URL: Homepage, https://proxyml.ai
191
+ Project-URL: Repository, https://github.com/proxyml/proxyml-core
192
+ Project-URL: Bug Tracker, https://github.com/proxyml/proxyml-core/issues
193
+ Keywords: machine learning,surrogate models,explainability
194
+ Classifier: Development Status :: 3 - Alpha
195
+ Classifier: Intended Audience :: Developers
196
+ Classifier: Intended Audience :: Science/Research
197
+ Classifier: License :: OSI Approved :: Apache Software License
198
+ Classifier: Programming Language :: Python :: 3
199
+ Classifier: Programming Language :: Python :: 3.10
200
+ Classifier: Programming Language :: Python :: 3.11
201
+ Classifier: Programming Language :: Python :: 3.12
202
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
203
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
204
+ Requires-Python: >=3.10
205
+ Description-Content-Type: text/markdown
206
+ License-File: LICENSE
207
+ Requires-Dist: numpy>=1.24
208
+ Provides-Extra: modeling
209
+ Requires-Dist: scikit-learn>=1.4; extra == "modeling"
210
+ Requires-Dist: scipy>=1.10; extra == "modeling"
211
+ Provides-Extra: dev
212
+ Requires-Dist: pytest; extra == "dev"
213
+ Requires-Dist: ruff; extra == "dev"
214
+ Dynamic: license-file
215
+
216
+ # proxyml-core
217
+
218
+ Shared library for [proxyml](https://proxyml.ai) — schema types, the export
219
+ JSON contract, and (behind the `modeling` extra) the sklearn-based training
220
+ and preprocessing code used by both the proxyml backend and the `proxyml`
221
+ SDK's local challenger training.
222
+
223
+ ## Layout
224
+
225
+ - `proxyml_core.schema` — pure. `Feature` hierarchy, `FeatureSchema`.
226
+ - `proxyml_core.export` — pure. Export dataclasses, `EXPORT_SCHEMA_VERSION`,
227
+ `predict_from_export()`.
228
+ - `proxyml_core.modeling` — requires `proxyml-core[modeling]` (scikit-learn,
229
+ scipy). Preprocessing, default estimators, export extraction.
230
+
231
+ The pure base (`schema`, `export`, `_version`) depends only on `numpy`, so a
232
+ REST-only `proxyml` install never needs scikit-learn.
233
+
234
+ ## Install
235
+
236
+ ```
237
+ pip install proxyml-core # pure: schema + export
238
+ pip install proxyml-core[modeling] # + scikit-learn, scipy
239
+ ```
@@ -0,0 +1,24 @@
1
+ # proxyml-core
2
+
3
+ Shared library for [proxyml](https://proxyml.ai) — schema types, the export
4
+ JSON contract, and (behind the `modeling` extra) the sklearn-based training
5
+ and preprocessing code used by both the proxyml backend and the `proxyml`
6
+ SDK's local challenger training.
7
+
8
+ ## Layout
9
+
10
+ - `proxyml_core.schema` — pure. `Feature` hierarchy, `FeatureSchema`.
11
+ - `proxyml_core.export` — pure. Export dataclasses, `EXPORT_SCHEMA_VERSION`,
12
+ `predict_from_export()`.
13
+ - `proxyml_core.modeling` — requires `proxyml-core[modeling]` (scikit-learn,
14
+ scipy). Preprocessing, default estimators, export extraction.
15
+
16
+ The pure base (`schema`, `export`, `_version`) depends only on `numpy`, so a
17
+ REST-only `proxyml` install never needs scikit-learn.
18
+
19
+ ## Install
20
+
21
+ ```
22
+ pip install proxyml-core # pure: schema + export
23
+ pip install proxyml-core[modeling] # + scikit-learn, scipy
24
+ ```
@@ -0,0 +1,48 @@
1
+ [project]
2
+ name = "proxyml-core"
3
+ version = "0.1.0"
4
+ description = "Shared schema types, export contract, and modeling code for proxyml and its backend."
5
+ readme = "README.md"
6
+ license = {file = "LICENSE"}
7
+ authors = [
8
+ {name = "ProxyML", email = "contact@proxyml.ai"}
9
+ ]
10
+ keywords = ["machine learning", "surrogate models", "explainability"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Intended Audience :: Developers",
14
+ "Intended Audience :: Science/Research",
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
22
+ ]
23
+ requires-python = ">=3.10"
24
+ dependencies = [
25
+ "numpy>=1.24",
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ modeling = [
30
+ "scikit-learn>=1.4",
31
+ "scipy>=1.10",
32
+ ]
33
+ dev = [
34
+ "pytest",
35
+ "ruff",
36
+ ]
37
+
38
+ [project.urls]
39
+ Homepage = "https://proxyml.ai"
40
+ Repository = "https://github.com/proxyml/proxyml-core"
41
+ "Bug Tracker" = "https://github.com/proxyml/proxyml-core/issues"
42
+
43
+ [build-system]
44
+ requires = ["setuptools>=68", "wheel"]
45
+ build-backend = "setuptools.build_meta"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,45 @@
1
+ from proxyml_core._version import (
2
+ EXPORT_SCHEMA_VERSION,
3
+ IncompatibleExportVersionError,
4
+ check_compatible,
5
+ )
6
+ from proxyml_core.export import (
7
+ ExportError,
8
+ FeatureExportEntry,
9
+ PerClassCoefficients,
10
+ PerClassIntercept,
11
+ SurrogateExport,
12
+ predict_from_export,
13
+ score_export,
14
+ )
15
+ from proxyml_core.schema import (
16
+ CategoricalFeature,
17
+ CategoricalOrdinalFeature,
18
+ ContinuousFeature,
19
+ CountFeature,
20
+ Feature,
21
+ FeatureSchema,
22
+ FeatureValidationError,
23
+ NumericOrdinalFeature,
24
+ )
25
+
26
+ __all__ = [
27
+ "Feature",
28
+ "FeatureSchema",
29
+ "FeatureValidationError",
30
+ "ContinuousFeature",
31
+ "CategoricalFeature",
32
+ "CategoricalOrdinalFeature",
33
+ "NumericOrdinalFeature",
34
+ "CountFeature",
35
+ "SurrogateExport",
36
+ "FeatureExportEntry",
37
+ "PerClassCoefficients",
38
+ "PerClassIntercept",
39
+ "ExportError",
40
+ "score_export",
41
+ "predict_from_export",
42
+ "EXPORT_SCHEMA_VERSION",
43
+ "IncompatibleExportVersionError",
44
+ "check_compatible",
45
+ ]
@@ -0,0 +1,21 @@
1
+ """Export-format versioning.
2
+
3
+ The export JSON is a versioned contract: every artifact produced by
4
+ ``extract_export_data``/``SurrogateExport.to_dict`` is stamped with
5
+ ``EXPORT_SCHEMA_VERSION``, and loaders check compatibility before trusting
6
+ the payload shape. This is what lets a client and server built against
7
+ different versions of this library still register/diff/score models: as
8
+ long as a loader's version is >= the payload's stamped version, it knows
9
+ how to read that (older) shape.
10
+ """
11
+
12
+ EXPORT_SCHEMA_VERSION = 1
13
+
14
+
15
+ class IncompatibleExportVersionError(ValueError):
16
+ """Raised when an export payload is newer than this library understands."""
17
+
18
+
19
+ def check_compatible(payload_version: int) -> bool:
20
+ """Return True if this library can read a payload stamped with ``payload_version``."""
21
+ return payload_version <= EXPORT_SCHEMA_VERSION