matelab-python-sdk 0.1.0a13__tar.gz → 0.1.0a14__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 (65) hide show
  1. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/CHANGELOG.md +6 -0
  2. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/PKG-INFO +49 -3
  3. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/README.md +48 -2
  4. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/pyproject.toml +1 -1
  5. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/__init__.py +49 -1
  6. matelab_python_sdk-0.1.0a14/src/matelab/domains/template_documents.py +527 -0
  7. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/templates.py +26 -12
  8. matelab_python_sdk-0.1.0a14/tests/test_template_documents.py +393 -0
  9. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/typing/consumer.py +27 -0
  10. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/uv.lock +1 -1
  11. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/.env.example +0 -0
  12. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/.github/workflows/release.yml +0 -0
  13. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/.gitignore +0 -0
  14. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/AGENTS.md +0 -0
  15. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/LICENSE +0 -0
  16. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/NOTICE +0 -0
  17. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/contracts/matelab-integration-v1.lock.json +0 -0
  18. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/contracts/matelab-integration-v1.openapi.yaml +0 -0
  19. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/docs/operation-coverage.yaml +0 -0
  20. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/scripts/check_installed_package.py +0 -0
  21. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/scripts/check_release.py +0 -0
  22. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/scripts/generate_models.py +0 -0
  23. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/_generated/__init__.py +0 -0
  24. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/_generated/models.py +0 -0
  25. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/_transport.py +0 -0
  26. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/_wire_validation.py +0 -0
  27. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/client.py +0 -0
  28. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/__init__.py +0 -0
  29. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/_attachment_content.py +0 -0
  30. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/cloud_drive.py +0 -0
  31. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/groups.py +0 -0
  32. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/literature.py +0 -0
  33. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/notebooks.py +0 -0
  34. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/records.py +0 -0
  35. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/uploads.py +0 -0
  36. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/domains/users.py +0 -0
  37. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/errors.py +0 -0
  38. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/py.typed +0 -0
  39. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/session.py +0 -0
  40. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/src/matelab/streaming.py +0 -0
  41. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/conftest.py +0 -0
  42. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/provider/test_provider_smoke.py +0 -0
  43. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_async_attachment_upload.py +0 -0
  44. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_client.py +0 -0
  45. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_cloud_drive.py +0 -0
  46. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_comments_and_downloads.py +0 -0
  47. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_consumer_smoke.py +0 -0
  48. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_errors.py +0 -0
  49. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_extended_records.py +0 -0
  50. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_generation.py +0 -0
  51. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_groups.py +0 -0
  52. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_notebook_lifecycle.py +0 -0
  53. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_notebooks.py +0 -0
  54. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_operation_coverage.py +0 -0
  55. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_record_lifecycle.py +0 -0
  56. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_record_mutations.py +0 -0
  57. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_records.py +0 -0
  58. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_release.py +0 -0
  59. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_streaming.py +0 -0
  60. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_template_lifecycle.py +0 -0
  61. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_templates.py +0 -0
  62. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_transport.py +0 -0
  63. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_uploads_and_literature.py +0 -0
  64. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/test_users.py +0 -0
  65. {matelab_python_sdk-0.1.0a13 → matelab_python_sdk-0.1.0a14}/tests/typing/pyproject.toml +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0a14 - 2026-08-10
4
+
5
+ - Adds immutable semantic template modules, editable `TemplateDocument` values, ordered name-based patch intents,
6
+ stable content fingerprints, and `Templates.read_document()`, `save_document()`, and `patch_content()` while
7
+ retaining the low-level `TemplateModule`, `read()`, and `save_content()` interface.
8
+
3
9
  ## 0.1.0a13 - 2026-08-08
4
10
 
5
11
  - Breaking: `Identity.username` now removes surrounding whitespace and rejects values that become empty.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matelab-python-sdk
3
- Version: 0.1.0a13
3
+ Version: 0.1.0a14
4
4
  Summary: Reusable async Python client for the Matelab Integration Contract
5
5
  Author-email: 朱天念 <zhutiannian@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -30,7 +30,7 @@ Description-Content-Type: text/markdown
30
30
 
31
31
  Reusable async Python client for the Matelab Integration Contract.
32
32
 
33
- The current alpha is `0.1.0a13`. `[project].version` in `pyproject.toml` is the sole SDK version source;
33
+ The current alpha is `0.1.0a14`. `[project].version` in `pyproject.toml` is the sole SDK version source;
34
34
  `uv.lock` only mirrors that source.
35
35
 
36
36
  The SDK is pinned to the immutable `matelab-spec v0.4.0` Contract Release. The sole release pin is
@@ -59,7 +59,7 @@ To test the same artifact a downstream Consumer will install, build and install
59
59
 
60
60
  ```bash
61
61
  uv build --no-build-isolation --out-dir dist/release
62
- python -m pip install dist/release/matelab_python_sdk-0.1.0a13-py3-none-any.whl
62
+ python -m pip install dist/release/matelab_python_sdk-0.1.0a14-py3-none-any.whl
63
63
  ```
64
64
 
65
65
  Do not infer Provider compatibility from the SDK version alone. A release is also bound to the Contract
@@ -450,6 +450,52 @@ market = await client.templates.search_market("calibration", page=1, page_size=2
450
450
  modules = await client.templates.read(templates.owned[0].ref)
451
451
  ```
452
452
 
453
+ Semantic template documents hide canonical `uid`, `width`, `data`, `rows`, `folders`, and option encoding:
454
+
455
+ ```python
456
+ from matelab import (
457
+ TemplateDocument,
458
+ TemplateFieldAdd,
459
+ TemplateFormField,
460
+ TemplateFormModule,
461
+ TemplatePatch,
462
+ TemplateRichTextModule,
463
+ )
464
+
465
+ document = TemplateDocument.create(
466
+ (
467
+ TemplateFormModule(
468
+ name="Basic",
469
+ fields=(TemplateFormField(name="Temperature", field_type="number", required=True, unit="K"),),
470
+ ),
471
+ TemplateRichTextModule(name="Notes", content="<p>Instructions</p>"),
472
+ )
473
+ )
474
+ template = await client.templates.create(title="Measurement")
475
+ await client.templates.save_document(template, document)
476
+
477
+ observed = await client.templates.read_document(template)
478
+ await client.templates.patch_content(
479
+ template,
480
+ TemplatePatch(
481
+ changes=(
482
+ TemplateFieldAdd(
483
+ module="Basic",
484
+ field=TemplateFormField(name="Operator", field_type="text", required=True),
485
+ ),
486
+ )
487
+ ),
488
+ expected_fingerprint=observed.fingerprint,
489
+ )
490
+ updated = await client.templates.read_document(template)
491
+ ```
492
+
493
+ `TemplateDocument` is immutable at its interface, preserves unknown canonical properties, keeps existing UIDs stable,
494
+ and converts losslessly back to `TemplateModule`. Patches are ordered name-based intents and reject missing, duplicate,
495
+ or incompatible targets before saving. The fingerprint preflight detects a stale prior read, but is client-side only:
496
+ the current Provider has no atomic template patch or CAS (PCG-007). `patch_content()` returns `None`; explicitly
497
+ re-read before using a new fingerprint because the mutation response contains no saved representation.
498
+
453
499
  The market result reports the Provider `total_count`, the requested and effective page sizes, and a `has_more`
454
500
  value derived from the total; it does not claim a stable order or continuation token. Canonical
455
501
  modules are mapped to public `TemplateModule` values and retain additive module attributes. Template reads remain
@@ -2,7 +2,7 @@
2
2
 
3
3
  Reusable async Python client for the Matelab Integration Contract.
4
4
 
5
- The current alpha is `0.1.0a13`. `[project].version` in `pyproject.toml` is the sole SDK version source;
5
+ The current alpha is `0.1.0a14`. `[project].version` in `pyproject.toml` is the sole SDK version source;
6
6
  `uv.lock` only mirrors that source.
7
7
 
8
8
  The SDK is pinned to the immutable `matelab-spec v0.4.0` Contract Release. The sole release pin is
@@ -31,7 +31,7 @@ To test the same artifact a downstream Consumer will install, build and install
31
31
 
32
32
  ```bash
33
33
  uv build --no-build-isolation --out-dir dist/release
34
- python -m pip install dist/release/matelab_python_sdk-0.1.0a13-py3-none-any.whl
34
+ python -m pip install dist/release/matelab_python_sdk-0.1.0a14-py3-none-any.whl
35
35
  ```
36
36
 
37
37
  Do not infer Provider compatibility from the SDK version alone. A release is also bound to the Contract
@@ -422,6 +422,52 @@ market = await client.templates.search_market("calibration", page=1, page_size=2
422
422
  modules = await client.templates.read(templates.owned[0].ref)
423
423
  ```
424
424
 
425
+ Semantic template documents hide canonical `uid`, `width`, `data`, `rows`, `folders`, and option encoding:
426
+
427
+ ```python
428
+ from matelab import (
429
+ TemplateDocument,
430
+ TemplateFieldAdd,
431
+ TemplateFormField,
432
+ TemplateFormModule,
433
+ TemplatePatch,
434
+ TemplateRichTextModule,
435
+ )
436
+
437
+ document = TemplateDocument.create(
438
+ (
439
+ TemplateFormModule(
440
+ name="Basic",
441
+ fields=(TemplateFormField(name="Temperature", field_type="number", required=True, unit="K"),),
442
+ ),
443
+ TemplateRichTextModule(name="Notes", content="<p>Instructions</p>"),
444
+ )
445
+ )
446
+ template = await client.templates.create(title="Measurement")
447
+ await client.templates.save_document(template, document)
448
+
449
+ observed = await client.templates.read_document(template)
450
+ await client.templates.patch_content(
451
+ template,
452
+ TemplatePatch(
453
+ changes=(
454
+ TemplateFieldAdd(
455
+ module="Basic",
456
+ field=TemplateFormField(name="Operator", field_type="text", required=True),
457
+ ),
458
+ )
459
+ ),
460
+ expected_fingerprint=observed.fingerprint,
461
+ )
462
+ updated = await client.templates.read_document(template)
463
+ ```
464
+
465
+ `TemplateDocument` is immutable at its interface, preserves unknown canonical properties, keeps existing UIDs stable,
466
+ and converts losslessly back to `TemplateModule`. Patches are ordered name-based intents and reject missing, duplicate,
467
+ or incompatible targets before saving. The fingerprint preflight detects a stale prior read, but is client-side only:
468
+ the current Provider has no atomic template patch or CAS (PCG-007). `patch_content()` returns `None`; explicitly
469
+ re-read before using a new fingerprint because the mutation response contains no saved representation.
470
+
425
471
  The market result reports the Provider `total_count`, the requested and effective page sizes, and a `has_more`
426
472
  value derived from the total; it does not claim a stable order or continuation token. Canonical
427
473
  modules are mapped to public `TemplateModule` values and retain additive module attributes. Template reads remain
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "matelab-python-sdk"
7
- version = "0.1.0a13"
7
+ version = "0.1.0a14"
8
8
  description = "Reusable async Python client for the Matelab Integration Contract"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -99,13 +99,38 @@ from matelab.domains.records import (
99
99
  StagedRecordAttachment,
100
100
  StagedRecordCommentAttachment,
101
101
  )
102
+ from matelab.domains.template_documents import (
103
+ TemplateChange,
104
+ TemplateCodeLanguage,
105
+ TemplateCodeModule,
106
+ TemplateCodeStyle,
107
+ TemplateDocument,
108
+ TemplateFieldAdd,
109
+ TemplateFieldRemove,
110
+ TemplateFieldRename,
111
+ TemplateFieldUpdate,
112
+ TemplateFilesModule,
113
+ TemplateFormField,
114
+ TemplateFormFieldType,
115
+ TemplateFormModule,
116
+ TemplateModule,
117
+ TemplateModuleAdd,
118
+ TemplateModuleContentUpdate,
119
+ TemplateModuleDefinition,
120
+ TemplateModuleRemove,
121
+ TemplateModuleRename,
122
+ TemplatePatch,
123
+ TemplateRichTextModule,
124
+ TemplateTableColumn,
125
+ TemplateTableColumnType,
126
+ TemplateTableModule,
127
+ )
102
128
  from matelab.domains.templates import (
103
129
  TemplateCollection,
104
130
  TemplateLibraryEntryRef,
105
131
  TemplateLibraryRelationKind,
106
132
  TemplateMarketEntry,
107
133
  TemplateMarketPage,
108
- TemplateModule,
109
134
  TemplateRef,
110
135
  TemplateSource,
111
136
  TemplateSummary,
@@ -235,15 +260,38 @@ __all__ = [
235
260
  "StagedRecordAttachment",
236
261
  "StagedRecordCommentAttachment",
237
262
  "StagedUploadSession",
263
+ "TemplateChange",
264
+ "TemplateCodeLanguage",
265
+ "TemplateCodeModule",
266
+ "TemplateCodeStyle",
238
267
  "TemplateCollection",
268
+ "TemplateDocument",
269
+ "TemplateFieldAdd",
270
+ "TemplateFieldRemove",
271
+ "TemplateFieldRename",
272
+ "TemplateFieldUpdate",
273
+ "TemplateFilesModule",
274
+ "TemplateFormField",
275
+ "TemplateFormFieldType",
276
+ "TemplateFormModule",
239
277
  "TemplateLibraryEntryRef",
240
278
  "TemplateLibraryRelationKind",
241
279
  "TemplateMarketEntry",
242
280
  "TemplateMarketPage",
243
281
  "TemplateModule",
282
+ "TemplateModuleAdd",
283
+ "TemplateModuleContentUpdate",
284
+ "TemplateModuleDefinition",
285
+ "TemplateModuleRemove",
286
+ "TemplateModuleRename",
287
+ "TemplatePatch",
244
288
  "TemplateRef",
289
+ "TemplateRichTextModule",
245
290
  "TemplateSource",
246
291
  "TemplateSummary",
292
+ "TemplateTableColumn",
293
+ "TemplateTableColumnType",
294
+ "TemplateTableModule",
247
295
  "Token",
248
296
  "UploadBindingRef",
249
297
  "UserRef",