matelab-python-sdk 0.1.0a1__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 (58) hide show
  1. matelab_python_sdk-0.1.0a1/.github/workflows/release.yml +117 -0
  2. matelab_python_sdk-0.1.0a1/.gitignore +9 -0
  3. matelab_python_sdk-0.1.0a1/AGENTS.md +120 -0
  4. matelab_python_sdk-0.1.0a1/CHANGELOG.md +13 -0
  5. matelab_python_sdk-0.1.0a1/LICENSE +202 -0
  6. matelab_python_sdk-0.1.0a1/NOTICE +2 -0
  7. matelab_python_sdk-0.1.0a1/PKG-INFO +538 -0
  8. matelab_python_sdk-0.1.0a1/README.md +512 -0
  9. matelab_python_sdk-0.1.0a1/contracts/matelab-integration-v1.lock.json +13 -0
  10. matelab_python_sdk-0.1.0a1/contracts/matelab-integration-v1.openapi.yaml +6894 -0
  11. matelab_python_sdk-0.1.0a1/docs/operation-coverage.yaml +716 -0
  12. matelab_python_sdk-0.1.0a1/docs/roadmap.md +884 -0
  13. matelab_python_sdk-0.1.0a1/pyproject.toml +68 -0
  14. matelab_python_sdk-0.1.0a1/scripts/check_installed_package.py +25 -0
  15. matelab_python_sdk-0.1.0a1/scripts/check_release.py +161 -0
  16. matelab_python_sdk-0.1.0a1/scripts/generate_models.py +349 -0
  17. matelab_python_sdk-0.1.0a1/src/matelab/__init__.py +372 -0
  18. matelab_python_sdk-0.1.0a1/src/matelab/_generated/__init__.py +1 -0
  19. matelab_python_sdk-0.1.0a1/src/matelab/_generated/models.py +3553 -0
  20. matelab_python_sdk-0.1.0a1/src/matelab/_transport.py +481 -0
  21. matelab_python_sdk-0.1.0a1/src/matelab/client.py +191 -0
  22. matelab_python_sdk-0.1.0a1/src/matelab/cloud_drive.py +789 -0
  23. matelab_python_sdk-0.1.0a1/src/matelab/errors.py +38 -0
  24. matelab_python_sdk-0.1.0a1/src/matelab/groups.py +78 -0
  25. matelab_python_sdk-0.1.0a1/src/matelab/literature.py +1243 -0
  26. matelab_python_sdk-0.1.0a1/src/matelab/models.py +27 -0
  27. matelab_python_sdk-0.1.0a1/src/matelab/notebooks.py +467 -0
  28. matelab_python_sdk-0.1.0a1/src/matelab/py.typed +1 -0
  29. matelab_python_sdk-0.1.0a1/src/matelab/records.py +2511 -0
  30. matelab_python_sdk-0.1.0a1/src/matelab/streaming.py +82 -0
  31. matelab_python_sdk-0.1.0a1/src/matelab/templates.py +737 -0
  32. matelab_python_sdk-0.1.0a1/src/matelab/uploads.py +247 -0
  33. matelab_python_sdk-0.1.0a1/src/matelab/users.py +77 -0
  34. matelab_python_sdk-0.1.0a1/tests/conftest.py +20 -0
  35. matelab_python_sdk-0.1.0a1/tests/provider/test_provider_smoke.py +128 -0
  36. matelab_python_sdk-0.1.0a1/tests/test_client.py +528 -0
  37. matelab_python_sdk-0.1.0a1/tests/test_cloud_drive.py +490 -0
  38. matelab_python_sdk-0.1.0a1/tests/test_comments_and_downloads.py +193 -0
  39. matelab_python_sdk-0.1.0a1/tests/test_consumer_smoke.py +129 -0
  40. matelab_python_sdk-0.1.0a1/tests/test_extended_records.py +578 -0
  41. matelab_python_sdk-0.1.0a1/tests/test_generation.py +251 -0
  42. matelab_python_sdk-0.1.0a1/tests/test_groups.py +91 -0
  43. matelab_python_sdk-0.1.0a1/tests/test_notebook_lifecycle.py +468 -0
  44. matelab_python_sdk-0.1.0a1/tests/test_notebooks.py +128 -0
  45. matelab_python_sdk-0.1.0a1/tests/test_operation_coverage.py +192 -0
  46. matelab_python_sdk-0.1.0a1/tests/test_record_lifecycle.py +422 -0
  47. matelab_python_sdk-0.1.0a1/tests/test_record_mutations.py +705 -0
  48. matelab_python_sdk-0.1.0a1/tests/test_records.py +361 -0
  49. matelab_python_sdk-0.1.0a1/tests/test_release.py +137 -0
  50. matelab_python_sdk-0.1.0a1/tests/test_streaming.py +272 -0
  51. matelab_python_sdk-0.1.0a1/tests/test_template_lifecycle.py +586 -0
  52. matelab_python_sdk-0.1.0a1/tests/test_templates.py +347 -0
  53. matelab_python_sdk-0.1.0a1/tests/test_transport.py +700 -0
  54. matelab_python_sdk-0.1.0a1/tests/test_uploads_and_literature.py +810 -0
  55. matelab_python_sdk-0.1.0a1/tests/test_users.py +201 -0
  56. matelab_python_sdk-0.1.0a1/tests/typing/consumer.py +7 -0
  57. matelab_python_sdk-0.1.0a1/tests/typing/pyproject.toml +3 -0
  58. matelab_python_sdk-0.1.0a1/uv.lock +748 -0
@@ -0,0 +1,117 @@
1
+ name: Publish release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ name: Test on Python ${{ matrix.python-version }}
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.11", "3.14"]
19
+ steps:
20
+ - name: Check out source
21
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
24
+ with:
25
+ version: "0.11.32"
26
+ - name: Sync locked environment
27
+ run: uv sync --frozen --python "${{ matrix.python-version }}"
28
+ - name: Check generated wire models
29
+ if: matrix.python-version == '3.14'
30
+ run: uv run python scripts/generate_models.py --check
31
+ - name: Lint
32
+ if: matrix.python-version == '3.14'
33
+ run: uv run ruff check .
34
+ - name: Check formatting
35
+ if: matrix.python-version == '3.14'
36
+ run: uv run ruff format --check .
37
+ - name: Type check
38
+ if: matrix.python-version == '3.14'
39
+ run: uv run basedpyright
40
+ - name: Test
41
+ run: uv run pytest
42
+
43
+ build:
44
+ name: Build reproducible distributions
45
+ needs: test
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - name: Check out tagged source
49
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
50
+ with:
51
+ fetch-depth: 0
52
+ - name: Install uv
53
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
54
+ with:
55
+ version: "0.11.32"
56
+ - name: Verify tag and configure timestamp
57
+ shell: bash
58
+ run: |
59
+ project_version="$(uv version --short)"
60
+ test "${GITHUB_REF_NAME}" = "v${project_version}"
61
+ echo "SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)" >> "${GITHUB_ENV}"
62
+ - name: Sync locked build environment
63
+ run: uv sync --frozen --python "3.14"
64
+ - name: Check generated wire models
65
+ run: uv run python scripts/generate_models.py --check
66
+ - name: Build twice
67
+ run: |
68
+ mkdir -p dist/release dist/reproducible
69
+ uv build --no-build-isolation --out-dir dist/release
70
+ uv build --no-build-isolation --out-dir dist/reproducible
71
+ - name: Verify reproducibility
72
+ run: |
73
+ cmp dist/release/*.whl dist/reproducible/*.whl
74
+ cmp dist/release/*.tar.gz dist/reproducible/*.tar.gz
75
+ - name: Audit distributions
76
+ run: |
77
+ uv run python scripts/check_release.py dist/release/*.whl dist/release/*.tar.gz
78
+ sha256sum dist/release/*.whl dist/release/*.tar.gz
79
+ - name: Verify installed-wheel consumer
80
+ run: |
81
+ uv venv --python "3.14" "${RUNNER_TEMP}/matelab-consumer"
82
+ uv pip install \
83
+ --python "${RUNNER_TEMP}/matelab-consumer/bin/python" \
84
+ dist/release/*.whl \
85
+ "basedpyright==1.39.9" \
86
+ "nodejs-wheel-binaries==22.20.0"
87
+ "${RUNNER_TEMP}/matelab-consumer/bin/python" scripts/check_installed_package.py
88
+ "${RUNNER_TEMP}/matelab-consumer/bin/basedpyright" \
89
+ --pythonpath "${RUNNER_TEMP}/matelab-consumer/bin/python" \
90
+ --project tests/typing/pyproject.toml
91
+ - name: Store distributions
92
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
93
+ with:
94
+ name: python-package-distributions
95
+ path: |
96
+ dist/release/*.whl
97
+ dist/release/*.tar.gz
98
+ if-no-files-found: error
99
+ retention-days: 7
100
+
101
+ publish:
102
+ name: Publish to PyPI
103
+ needs: build
104
+ runs-on: ubuntu-latest
105
+ environment:
106
+ name: pypi
107
+ url: https://pypi.org/p/matelab-python-sdk
108
+ permissions:
109
+ id-token: write
110
+ steps:
111
+ - name: Retrieve distributions
112
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
113
+ with:
114
+ name: python-package-distributions
115
+ path: dist
116
+ - name: Publish distributions
117
+ uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ .env.test
3
+ .uv-cache/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ __pycache__/
7
+ *.pyc
8
+ .generated/
9
+ dist/
@@ -0,0 +1,120 @@
1
+ # AGENTS.md
2
+
3
+ 本文档只保留维护 `matelab-python-sdk` 必须长期遵守的项目约束。当前能力和使用方式见
4
+ `README.md`,实现路线与进度见 `docs/roadmap.md`,operation 状态以
5
+ `docs/operation-coverage.yaml` 为机器权威。不要在本文记录阶段性完成状态、一次性验收数字或迁移历史。
6
+
7
+ ## 权威与范围
8
+
9
+ - 本项目是 Matelab Integration Contract 的通用异步 Python Consumer,负责隐藏 HTTP 编码、认证刷新、
10
+ Matelab 业务错误、wire model 和 Provider 兼容细节。
11
+ - `contracts/matelab-integration-v1.lock.json` 是 Contract pin 的唯一机器权威;HTTP method、path、编码、
12
+ 字段、required、nullable、默认值、成功码和响应结构以它固定的 OpenAPI snapshot 为准。
13
+ - `/home/tnzhu/projects/matelab-spec` 是 Wire Contract、兼容策略及 Provider 问题的权威。
14
+ `matelab-server` 是 Provider 实现,`matelab-mcp` 只是 Consumer 证据,均不能反向定义 SDK interface。
15
+ - 开始修改前先执行 `git status`;现有改动均视为用户工作,不覆盖、不移动、不清理。
16
+ - 默认只修改本仓库。未经用户明确授权,不修改相邻仓库,不迁移 MCP,不 commit、push、tag、发布,
17
+ 也不对真实 Provider 执行 mutation。
18
+ - Contract 无法安全表达某项能力时停止实现并报告缺口,不猜测协议,也不静默适配 Provider 漂移。
19
+
20
+ ## Public interface
21
+
22
+ - `AsyncMatelab` 是稳定入口;能力按 `groups`、`users`、`notebooks`、`records`、`templates`、`uploads`、
23
+ `literature` 和 `cloud_drive` 等领域组织,不按 PHP endpoint 平铺浅方法。
24
+ - public interface 只表达用户意图;controller、path、opcode、wire 字段和刷新细节必须留在内部。
25
+ - `src/matelab/__init__.py` 的 `__all__` 定义公开边界。`src/matelab/_generated/` 永远是私有实现,
26
+ Consumer 不得导入或接收 generated model。
27
+ - 公共类型使用含义明确、不可混用的资源身份;不得用模糊 `id` 混淆 userid、database id、UID、relation
28
+ id 或 staging id。
29
+ - Provider 未返回的 identity、affected rows、排序、分页、原子性、CAS、幂等性或持久化结果不得推测。
30
+ legacy 限制应通过类型、结果和文档诚实表达。
31
+ - MCP typed refs、capabilities、fingerprints、FastMCP context、Redis session 和 Agent 展示模型不得进入 SDK。
32
+ - 项目支持 Python 3.11+;源码不使用 `from __future__ import annotations`,前向引用优先通过定义顺序解决。
33
+ - 仅在存在真实第二种实现时增加新 seam,不为测试预设无用抽象。
34
+
35
+ ## Contract 与生成
36
+
37
+ - 每个 operation 都必须核对 pinned OpenAPI 中的 request、response、security、examples 和成功码,并查看相关
38
+ PVD/PCG;只有 Contract 不足以说明真实 use case 时才只读参考 Consumer。
39
+ - Contract Adoption 只能来自不可变 release tag;同一变更必须更新唯一 lock 的 tag、commit、snapshot
40
+ path 和 SHA-256,重新生成并复核差异。不得跟踪移动分支或为生成方便改写正式 snapshot。
41
+ - request 和 response 都由生成的 wire model 校验;公共 adapter 负责 Python 名称与 PHP wire 字段之间的映射。
42
+ - required nullable 表示为无默认值的 `T | None`;request 默认拒绝未知字段;response 必须兼容新增字段。
43
+ - 不手工编辑 `src/matelab/_generated/`。generation projection 只可补偿生成器表达能力,并必须保留 inherited
44
+ required 及 `if/then`、`oneOf`、`anyOf`、`not` 等约束。
45
+ - 生成变化必须能追溯到 Contract snapshot、生成器版本或受测试锁定的生成配置;`--check` 必须保持确定性、
46
+ 非写入并能发现 stale output。
47
+
48
+ ## Transport、认证与安全
49
+
50
+ - `base_url` 表示 Provider API 根。query、JSON、form-urlencoded、multipart 和 streaming 必须按各 operation
51
+ 定义分别实现。
52
+ - bearer 只用于要求认证的 operation;成功码按 operation 配置,不能全局接受 `{0, 10}`。
53
+ - 每个 `AsyncMatelab` 实例最多持有一个进程内 Session,包含 access/refresh token、毫秒 expiration 和可选
54
+ identity;不同用户的 token pair 必须拒绝绑定,失败时不得替换现有 Session。
55
+ - `client.session` 暴露实例内最新 Session。持久化、加密、撤销、`userid/session_id` 关联和跨进程锁属于
56
+ 集成方;不同逻辑 Session 不得共享同一个 `AsyncMatelab`,但多个实例可以共享注入的 `httpx.AsyncClient`。
57
+ - access 到期前按 skew 刷新;并发刷新使用单个异步锁;已认证且可安全重试的请求遇到 `code=5` 最多强制
58
+ 刷新并重试一次。
59
+ - mutation 默认不自动重试。multipart 或 stream 只有在确认可重放时才能重试;download stream 不自动重放,
60
+ 必须支持显式关闭。
61
+ - HTTP/transport、Provider business/authentication、Wire Contract/schema 和 client usage 错误必须稳定区分。
62
+ - password、token、SSO code/key、临时附件凭证、原始文件内容和敏感 payload 不得进入日志、异常或提交内容。
63
+
64
+ ## 测试与质量门槛
65
+
66
+ - 测试以 public interface 为主;不得把 `_generated` 或 raw HTTP adapter 当作 Consumer interface。
67
+ - 新增或修改 operation 至少覆盖 method/path/encoding、认证、成功映射、空结果、required nullable、
68
+ additive response fields、HTTP error、HTTP 200 business error、schema mismatch、刷新与重试边界。
69
+ - `docs/operation-coverage.yaml` 必须与 pinned OpenAPI exact match;implemented operation 必须有 public
70
+ interface、wire adapter 和测试,generated model 本身不算实现。
71
+ - 生成测试必须锁定 contract metadata/checksum、schema 覆盖、required/nullable、extra policy、
72
+ determinism 和 stale detection。
73
+ - Provider smoke 默认 skip 且不自动读取 `.env`。本地 `.env.test` 必须保持 Git ignore,且只可通过显式
74
+ `uv run --env-file .env.test` 在用户确认的目标和唯一 fixture 上 opt in;优先使用隔离实例,生产目标必须
75
+ 获得本轮明确授权并只使用专用测试 fixture。mutation 或带写痕迹的读取必须显式确认、回读并尽力清理。
76
+
77
+ Ruff、Basedpyright 和测试要求:
78
+
79
+ - Ruff 负责格式、lint 和 import sorting,行宽 120,启用 `I` 规则;`src`、`tests`、`scripts` 及生成输出都
80
+ 必须通过 `ruff check` 和 `ruff format --check`,不得以排除测试代码来消除诊断。
81
+ - Basedpyright 使用默认 `recommended` 模式,不在 `pyproject.toml` 重复声明 `typeCheckingMode`;
82
+ 检查 `src`、`tests`、`scripts`,仅排除 `_generated`,目标为 0 errors / 0 warnings。不得全局关闭规则;
83
+ 必要 ignore 必须精确到 rule 并说明原因。
84
+ - 改动时先运行相关 pytest;交付前运行完整测试。skip 必须有明确环境或 fixture 原因,不能把 skip 报告为通过。
85
+
86
+ 完整质量门槛:
87
+
88
+ ```bash
89
+ uv sync --frozen
90
+ uv run python scripts/generate_models.py --check
91
+ uv run ruff check .
92
+ uv run ruff format --check .
93
+ uv run basedpyright
94
+ uv run pytest
95
+ uv build --no-build-isolation
96
+ ```
97
+
98
+ Codex 受限沙箱可能阻止缓存写入、Node wheel 安装或 Python 环境发现,导致 Basedpyright 出现
99
+ `No python interpreter search path` 或大量虚假的 `reportMissingImports`。此时应使用同一条命令在沙箱外
100
+ 复核,不得添加 `venvPath`/`venv`、降低检查范围或改用未锁定的全局工具绕过。
101
+
102
+ ## 依赖、版本与发布
103
+
104
+ - 公开包的 runtime dependency 必须声明经受支持 Python 版本实测的兼容下限,并排除未经验证的下一个
105
+ major;`uv.lock` 只固定本仓库的开发、测试和构建环境,不能作为下游依赖约束。
106
+ - `hatchling` 作为 build backend 和 dev dependency 使用同一兼容范围,以支持锁定环境中的
107
+ `uv build --no-build-isolation`。wheel 显式打包 `src/matelab`,不得依赖与发行名不一致的自动发现。
108
+ - `basedpyright==1.39.9` 与其安装所需的 `nodejs-wheel-binaries==22.20.0` 保持精确约束;其他开发工具由
109
+ `uv.lock` 固定,不向下游发布。
110
+ - `[project].version` 是唯一 SDK 版本源;不得在 Python 模块中增加第二个 `__version__`。
111
+ - SDK 使用 SemVer;`integration-v1` 是 Contract Line,不是 SDK 版本。
112
+ - 公开发行采用 Apache-2.0;`LICENSE`、`NOTICE`、PEP 639 metadata 和构建产物必须保持一致。
113
+ - Gitee `origin` 是内部主仓库;私有 GitHub mirror 只承载 PyPI Trusted Publishing。release workflow 只能由
114
+ 与 `[project].version` 完全匹配的 `v*` tag 触发,第三方 Action 必须固定不可变 commit SHA。
115
+ - release 必须从干净 revision、锁定环境和固定 `SOURCE_DATE_EPOCH` 构建,并记录 Contract tag、commit、
116
+ OpenAPI checksum 和制品 checksum。
117
+ - release candidate 必须审计 wheel/sdist 内容与 METADATA、验证 wheel 安装后的公开导入及类型消费、
118
+ 覆盖最低和最高受支持 Python 版本,并确认连续两次固定时间戳构建字节一致。wheel 必须包含 `py.typed`,
119
+ 且安装后的 public interface 不得泄漏 `_generated`。
120
+ - public interface 的删除、重命名、类型收紧或行为变化均按 breaking change 处理。
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0a1 - 2026-07-27
4
+
5
+ First public alpha candidate of the asynchronous Matelab Integration Contract SDK.
6
+
7
+ - Binds the immutable `matelab-spec v0.1.0` release.
8
+ - Exposes all 71 pinned Contract operations through public domain interfaces: 15 are stable and 56 remain
9
+ experimental.
10
+ - Provides instance-owned immutable Sessions, bounded token refresh, typed public models, streaming downloads,
11
+ and generated private wire validation.
12
+ - Ships as a typed package for Python 3.11 through 3.14.
13
+ - Uses the Apache License 2.0 with PEP 639 package metadata.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ matelab-python-sdk
2
+ Copyright 2026 中国科学院物理研究所凝聚态物质科学数据中心