gitoxide 0.1.0__cp39-abi3-win_amd64.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.
gitoxide/__init__.py ADDED
@@ -0,0 +1,50 @@
1
+ """gitoxide — fast, safe, pure-Rust Git for Python.
2
+
3
+ This package provides Python bindings to the `gitoxide <https://github.com/GitoxideLabs/gitoxide>`_
4
+ engine (the ``gix`` crate), the pure-Rust Git implementation created by Byron,
5
+ the original author of GitPython.
6
+
7
+ It aims to be a modern alternative to GitPython:
8
+
9
+ * **Fast** — no subprocess spawning like GitPython; work happens in-process in Rust.
10
+ * **Portable** — no dependency on a system ``libgit2`` like pygit2; ships as
11
+ self-contained wheels.
12
+ * **Safe** — memory-safe Rust under the hood.
13
+
14
+ Quick start
15
+ -----------
16
+
17
+ >>> import gitoxide
18
+ >>> repo = gitoxide.open(".")
19
+ >>> head = repo.head_commit()
20
+ >>> print(head.short_id, head.summary)
21
+ >>> for commit in repo.commits(max_count=10):
22
+ ... print(commit.short_id, commit.author.name, commit.summary)
23
+ """
24
+
25
+ from ._gitoxide import (
26
+ Commit,
27
+ GitoxideError,
28
+ Reference,
29
+ Repository,
30
+ Signature,
31
+ discover,
32
+ gix_version,
33
+ init,
34
+ open,
35
+ )
36
+
37
+ __all__ = [
38
+ "Commit",
39
+ "GitoxideError",
40
+ "Reference",
41
+ "Repository",
42
+ "Signature",
43
+ "discover",
44
+ "gix_version",
45
+ "init",
46
+ "open",
47
+ "__version__",
48
+ ]
49
+
50
+ __version__ = "0.1.0"
gitoxide/_gitoxide.pyd ADDED
Binary file
gitoxide/_gitoxide.pyi ADDED
@@ -0,0 +1,72 @@
1
+ """Type stubs for the native ``gitoxide._gitoxide`` extension module."""
2
+
3
+ from pathlib import Path
4
+ from typing import List, Optional, Union
5
+
6
+ StrPath = Union[str, Path]
7
+
8
+ class GitoxideError(Exception):
9
+ """Base error raised for failed gitoxide operations."""
10
+
11
+ class Signature:
12
+ """Authorship information (name, email, timestamp) attached to a commit."""
13
+
14
+ name: str
15
+ email: str
16
+ time: int
17
+ """Seconds since the Unix epoch."""
18
+ offset: int
19
+ """UTC offset in seconds (east of UTC is positive)."""
20
+
21
+ class Commit:
22
+ """A fully-decoded, owned view of a git commit."""
23
+
24
+ id: str
25
+ tree_id: str
26
+ message: str
27
+ author: Signature
28
+ committer: Signature
29
+ parents: List[str]
30
+ summary: str
31
+ """The first line of the commit message."""
32
+ short_id: str
33
+ """Abbreviated (7-char) commit id."""
34
+
35
+ class Reference:
36
+ """A git reference (branch, tag, ...) and the object it points at."""
37
+
38
+ name: str
39
+ shorthand: str
40
+ target: Optional[str]
41
+
42
+ class Repository:
43
+ """A handle to a git repository."""
44
+
45
+ @staticmethod
46
+ def open(path: StrPath) -> "Repository": ...
47
+ @staticmethod
48
+ def discover(path: StrPath) -> "Repository": ...
49
+ @staticmethod
50
+ def init(path: StrPath, bare: bool = False) -> "Repository": ...
51
+ git_dir: Path
52
+ workdir: Optional[Path]
53
+ is_bare: bool
54
+ is_shallow: bool
55
+ head_id: Optional[str]
56
+ head_name: Optional[str]
57
+ head_is_detached: bool
58
+ def head_commit(self) -> Commit: ...
59
+ def rev_parse(self, spec: str) -> str: ...
60
+ def commit(self, rev: str) -> Commit: ...
61
+ def commits(
62
+ self, rev: Optional[str] = None, max_count: Optional[int] = None
63
+ ) -> List[Commit]: ...
64
+ def references(self) -> List[Reference]: ...
65
+ def branches(self) -> List[str]: ...
66
+ def tags(self) -> List[str]: ...
67
+ def read_blob(self, rev: str) -> bytes: ...
68
+
69
+ def open(path: StrPath) -> Repository: ...
70
+ def discover(path: StrPath) -> Repository: ...
71
+ def init(path: StrPath, bare: bool = False) -> Repository: ...
72
+ def gix_version() -> str: ...
gitoxide/py.typed ADDED
File without changes
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitoxide
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.9
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
+ Classifier: Programming Language :: Rust
15
+ Classifier: Topic :: Software Development :: Version Control :: Git
16
+ Requires-Dist: pytest>=7.0 ; extra == 'test'
17
+ Provides-Extra: test
18
+ License-File: LICENSE-MIT
19
+ License-File: LICENSE-APACHE
20
+ Summary: Fast, safe, pure-Rust Git for Python — bindings to the gitoxide engine and a modern alternative to GitPython
21
+ Keywords: git,gitoxide,gix,vcs,version-control,gitpython
22
+ Author-email: Xianpeng Shen <xianpeng.shen@gmail.com>
23
+ License-Expression: MIT OR Apache-2.0
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
26
+ Project-URL: Homepage, https://github.com/shenxianpeng/gitoxide
27
+ Project-URL: Repository, https://github.com/shenxianpeng/gitoxide
28
+ Project-URL: gitoxide (Rust), https://github.com/GitoxideLabs/gitoxide
29
+
30
+ # gitoxide-python
31
+
32
+ [![CI](https://github.com/shenxianpeng/gitoxide/actions/workflows/CI.yml/badge.svg)](https://github.com/shenxianpeng/gitoxide/actions/workflows/CI.yml)
33
+
34
+ **Fast, safe, pure-Rust Git for Python — bindings to the [gitoxide](https://github.com/GitoxideLabs/gitoxide) engine, and a modern alternative to GitPython.**
35
+
36
+ `gitoxide` (the `gix` crate) is a next-generation, pure-Rust implementation of
37
+ Git.
38
+
39
+ This project exposes that engine to Python through [PyO3](https://pyo3.rs) and
40
+ ships as pre-built wheels via [maturin](https://www.maturin.rs), so you get:
41
+
42
+ | | GitPython | pygit2 | **gitoxide-python** |
43
+ |---|---|---|---|
44
+ | Backend | shells out to the `git` CLI | C `libgit2` | pure-Rust `gix` |
45
+ | Speed | slow (spawns a subprocess per call) | fast | fast (in-process, no subprocess) |
46
+ | Install | needs `git` on `PATH` | needs a C toolchain / system `libgit2` | `pip install`, self-contained wheels |
47
+ | Memory safety | n/a (subprocess) | C | Rust |
48
+
49
+ > **Status: alpha.** The binding surface is small but real and growing. It
50
+ > currently covers read-oriented workflows (open/discover, HEAD, history walk,
51
+ > refs, branches, tags, blob reads) — the operations DevOps tooling reaches for
52
+ > most. See [Roadmap](#roadmap).
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install gitoxide
58
+ ```
59
+
60
+ Pre-built wheels are published for Linux (manylinux, x86_64 + aarch64), macOS
61
+ (x86_64 + Apple Silicon), and Windows — no Rust toolchain or system `libgit2`
62
+ required.
63
+
64
+ ### From source
65
+
66
+ Building from a checkout (or from the sdist on an unsupported platform) requires
67
+ a [Rust toolchain](https://rustup.rs):
68
+
69
+ ```bash
70
+ pip install maturin
71
+ maturin develop # build + install into the active virtualenv
72
+ # or build a wheel:
73
+ maturin build --release
74
+ ```
75
+
76
+ ## Quick start
77
+
78
+ ```python
79
+ import gitoxide
80
+
81
+ repo = gitoxide.open(".") # or gitoxide.discover(".")
82
+
83
+ print(repo.git_dir) # .../my-project/.git
84
+ print(repo.workdir) # .../my-project (None if bare)
85
+ print(repo.is_bare) # False
86
+ print(repo.head_name) # 'main' (None if detached)
87
+
88
+ # The commit at HEAD
89
+ head = repo.head_commit()
90
+ print(head.short_id, head.summary)
91
+ print(head.author.name, head.author.email, head.author.time)
92
+
93
+ # Walk history (reverse-chronological), like `git log`
94
+ for commit in repo.commits(max_count=10):
95
+ print(commit.short_id, commit.author.name, commit.summary)
96
+
97
+ # Resolve a revspec to an object id
98
+ print(repo.rev_parse("HEAD~2"))
99
+ print(repo.rev_parse("main"))
100
+
101
+ # Branches, tags, and all references
102
+ print(repo.branches()) # ['main', 'dev', ...]
103
+ print(repo.tags()) # ['v1.0.0', ...]
104
+ for ref in repo.references():
105
+ print(ref.name, "->", ref.target)
106
+
107
+ # Read a file's content at a revision
108
+ readme = repo.read_blob("HEAD:README.md")
109
+ print(readme.decode())
110
+ ```
111
+
112
+ ## Migrating from GitPython
113
+
114
+ Common operations, side by side:
115
+
116
+ | GitPython | gitoxide-python |
117
+ |---|---|
118
+ | `from git import Repo` | `import gitoxide` |
119
+ | `repo = Repo(path)` | `repo = gitoxide.open(path)` |
120
+ | `Repo(path, search_parent_directories=True)` | `gitoxide.discover(path)` |
121
+ | `repo.head.commit` | `repo.head_commit()` |
122
+ | `repo.active_branch.name` | `repo.head_name` |
123
+ | `repo.iter_commits("main", max_count=10)` | `repo.commits("main", max_count=10)` |
124
+ | `repo.commit("HEAD~2")` | `repo.commit("HEAD~2")` |
125
+ | `repo.rev_parse("main").hexsha` | `repo.rev_parse("main")` |
126
+ | `[b.name for b in repo.branches]` | `repo.branches()` |
127
+ | `[t.name for t in repo.tags]` | `repo.tags()` |
128
+ | `c.hexsha`, `c.summary`, `c.author.name` | `c.id`, `c.summary`, `c.author.name` |
129
+
130
+ The key difference is what happens underneath: GitPython's `iter_commits` spawns
131
+ a `git rev-list` subprocess; gitoxide-python walks the object database
132
+ in-process in Rust.
133
+
134
+ ## API
135
+
136
+ ### Module functions
137
+
138
+ - `gitoxide.open(path) -> Repository`
139
+ - `gitoxide.discover(path) -> Repository` — search `path` and its parents
140
+ - `gitoxide.init(path, bare=False) -> Repository`
141
+ - `gitoxide.gix_version() -> str`
142
+
143
+ ### `Repository`
144
+
145
+ Properties: `git_dir`, `workdir`, `is_bare`, `is_shallow`, `head_id`,
146
+ `head_name`, `head_is_detached`.
147
+
148
+ > **Note:** `head_name` and `head_is_detached` access the `HEAD` reference
149
+ > and may raise `GitoxideError` if it is inaccessible (e.g., corrupted
150
+ > repository). Other properties never raise.
151
+
152
+ Methods: `head_commit()`, `rev_parse(spec)`, `commit(rev)`,
153
+ `commits(rev=None, max_count=None)`, `references()`, `branches()`, `tags()`,
154
+ `read_blob(rev)`.
155
+
156
+ ### `Commit`
157
+
158
+ `id`, `short_id`, `tree_id`, `message`, `summary`, `author`, `committer`,
159
+ `parents`.
160
+
161
+ ### `Signature`
162
+
163
+ `name`, `email`, `time` (Unix seconds), `offset` (UTC offset seconds).
164
+
165
+ ### `Reference`
166
+
167
+ `name`, `shorthand`, `target`.
168
+
169
+ All errors (from any function or method) are raised as
170
+ `gitoxide.GitoxideError`.
171
+
172
+ ## Roadmap
173
+
174
+ - Diffing and status
175
+ - Tree traversal / listing entries
176
+ - Writing commits, staging (index), tag/branch creation
177
+ - Blame
178
+ - Cloning and remote operations (fetch/push)
179
+ - Lazy commit iterators instead of eager lists for very large histories
180
+
181
+ Contributions welcome — the binding layer lives in a single [`src/lib.rs`](src/lib.rs)
182
+ and maps cleanly onto the `gix` API.
183
+
184
+ ## Development
185
+
186
+ ```bash
187
+ python -m venv .venv && source .venv/bin/activate
188
+ pip install maturin pytest
189
+
190
+ maturin develop # build the extension into the venv
191
+ pytest -q # run the test suite
192
+
193
+ cargo fmt --all # format Rust
194
+ cargo clippy --all-targets -- -D warnings
195
+ ```
196
+
197
+ The tests generate a throwaway git repository on the fly (see
198
+ [`tests/conftest.py`](tests/conftest.py)), so they need `git` on `PATH` but
199
+ touch nothing outside a temp directory.
200
+
201
+ ## License
202
+
203
+ Licensed under either of Apache License 2.0 or MIT license at your option, to
204
+ match the upstream gitoxide project.
205
+
@@ -0,0 +1,10 @@
1
+ gitoxide/__init__.py,sha256=pLUc5wDLV7O_DoPvqTtf82UJvxglHkDrP6R4haHCtk4,1229
2
+ gitoxide/_gitoxide.pyd,sha256=M7y2pyqEYPjnrCLqz5ydzKg0FWeFEbO2u-7gvTmQADw,3540480
3
+ gitoxide/_gitoxide.pyi,sha256=cGfk0YvdnJU6twiGZAlSC7EWMywb14SCrAKtizLEaiE,2117
4
+ gitoxide/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ gitoxide-0.1.0.dist-info/METADATA,sha256=ZyETjeglrS_PUhM_ml0nZTY_3xJegOw6xl0CMKcsSFw,7308
6
+ gitoxide-0.1.0.dist-info/WHEEL,sha256=_rgZdQc9sLFEqt2IemX7qyxsGt5fFRnBDATxGzerdmg,95
7
+ gitoxide-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
8
+ gitoxide-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=x2Vs-GAj2EXAfmCUt9zlEtuHdNzEBfN3oEjaWLR7Vqg,1090
9
+ gitoxide-0.1.0.dist-info/sboms/gitoxide-python.cyclonedx.json,sha256=8N5auZ5UbOdwHdSZvNEkJ6iuKDVzo_xolc5CmftpkDI,164459
10
+ gitoxide-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.14.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-abi3-win_amd64
@@ -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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shenxianpeng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.