pd-code-mirror 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ from .main import mirror_pd_code
2
+
3
+ __all__ = [
4
+ "mirror_pd_code"
5
+ ]
pd_code_mirror/main.py ADDED
@@ -0,0 +1,22 @@
1
+ import json
2
+ import pd_code_sanity
3
+
4
+ def mirror_pd_code(pd_code:list[list]) -> list[list]:
5
+
6
+ # 检查是不是合法的 pd_code
7
+ if not pd_code_sanity.sanity(pd_code):
8
+ raise TypeError()
9
+
10
+ pd_code = json.loads(json.dumps(pd_code))
11
+ new_pd_code = [
12
+ [crossing[0]] + crossing[3:0:-1]
13
+ for crossing in pd_code
14
+ ]
15
+
16
+ if not pd_code_sanity.sanity(new_pd_code):
17
+ raise AssertionError()
18
+
19
+ return new_pd_code
20
+
21
+ if __name__ == "__main__":
22
+ print(mirror_pd_code([[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]))
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: pd-code-mirror
3
+ Version: 0.0.1
4
+ Summary: # pd_code_mirror
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Author: mirror a link or knot with pd_code.
8
+ Requires-Python: >=3.10
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Dist: pd_code_sanity
17
+ Description-Content-Type: text/markdown
18
+
19
+ # pd_code_mirror
20
+ mirror a link or knot with pd_code.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ pip install pd-code-mirror
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ import pd_code_mirror
32
+
33
+ pd_code = [[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]
34
+ print(pd_code_mirror.mirror_pd_code(pd_code))
35
+ ```
36
+
@@ -0,0 +1,6 @@
1
+ pd_code_mirror/__init__.py,sha256=tt1he5bpVtxGrqrlR-je5gUPplAVulB6VfBheOi_pkI,74
2
+ pd_code_mirror/main.py,sha256=7dhu9qyRQ5L0ibDBHS7gaIHBdanUR1xKmGIDMo6v3Sw,575
3
+ pd_code_mirror-0.0.1.dist-info/licenses/LICENSE,sha256=gCKLErgKpA7XoLYEwL_UJkJQE_jTw7V4dD4dSns9fjI,1100
4
+ pd_code_mirror-0.0.1.dist-info/METADATA,sha256=geWhu0c78LZ_rFc1cBy1gCZtoc4xs-rMPWXczCbNyUs,865
5
+ pd_code_mirror-0.0.1.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
6
+ pd_code_mirror-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.3.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TopologicalKnotIndexer
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.