MC-UUID-WMCL 0.3.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,18 @@
1
+ import hashlib
2
+ import uuid
3
+
4
+ __all__ = ["get_offline_uuid", "get_offline_uuid_no_hyphen"]
5
+
6
+ def get_offline_uuid(username: str) -> str:
7
+ """生成带连字符的离线 UUID"""
8
+ if not isinstance(username, str) or not username:
9
+ raise ValueError("玩家名必须是非空字符串")
10
+
11
+ string_to_hash = f"OfflinePlayer:{username}"
12
+ md5_bytes = hashlib.md5(string_to_hash.encode('utf-8')).digest()
13
+ offline_uuid = uuid.UUID(bytes=md5_bytes, version=3)
14
+ return str(offline_uuid)
15
+
16
+ def get_offline_uuid_no_hyphen(username: str) -> str:
17
+ """生成不带连字符的离线 UUID(启动参数专用)"""
18
+ return get_offline_uuid(username).replace("-", "")
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: MC_UUID_WMCL
3
+ Version: 0.3.0
4
+ Summary: Minecraft 离线 UUID 生成库
5
+ Home-page: https://github.com/s12af/MC_UUID
6
+ Author: s12af
7
+ Project-URL: Source Code, https://github.com/s12af/MC_UUID
8
+ Project-URL: Bug Tracker, https://github.com/s12af/MC_UUID/issues
9
+ Keywords: minecraft,uuid,offline,mc
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Games/Entertainment
13
+ Requires-Python: >=3.6
14
+ Description-Content-Type: text/markdown
15
+ Dynamic: author
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: keywords
21
+ Dynamic: project-url
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # MC-UUID
26
+
27
+ 一个用于 Python 的《我的世界》(Minecraft)离线 UUID 生成库。
28
+
29
+ 给定玩家用户名,即可生成对应的离线模式 UUID,支持标准格式(带横杠)与无横杠格式。
30
+
31
+ 仓库地址:https://github.com/s12af/MC_UUID
32
+
33
+ ## 安装
34
+
35
+ ```bash
36
+ pip install MC_UUID_WMCL
37
+ ```
38
+
39
+ ## 用法
40
+
41
+ ### 标准 UUID(带横杠)
42
+
43
+ ```python
44
+ import MC_UUID
45
+
46
+ name = "Steve"
47
+ uuid = MC_UUID.get_offline_uuid(name)
48
+ print("标准UUID:", uuid)
49
+ ```
50
+
51
+ 输出:
52
+
53
+ ```
54
+ 标准UUID: 5627dd98-e6be-3c21-b8a8-e92344183641
55
+ ```
56
+
57
+ ### 无横杠 UUID
58
+
59
+ ```python
60
+ import MC_UUID
61
+
62
+ name = "Steve"
63
+ uuid = MC_UUID.get_offline_uuid_no_hyphen(name)
64
+ print("无横杠UUID:", uuid)
65
+ ```
66
+
67
+ 输出:
68
+
69
+ ```
70
+ 无横杠UUID: 5627dd98e6be3c21b8a8e92344183641
71
+ ```
72
+
73
+ ## 说明
74
+
75
+ - 导入名使用大写 `MC_UUID`(`import MC_UUID`),这是发布包 `mc-uuid` 在代码中的实际导入名。
76
+ - 适用于 Minecraft 离线(非正版验证)模式下,根据玩家用户名推导 UUID 的场景。
77
+
78
+ ## 反馈
79
+
80
+ 遇到问题或建议,欢迎到仓库提 Issue:https://github.com/s12af/MC_UUID/issues
@@ -0,0 +1,7 @@
1
+ README.md
2
+ setup.py
3
+ MC_UUID/__init__.py
4
+ MC_UUID_WMCL.egg-info/PKG-INFO
5
+ MC_UUID_WMCL.egg-info/SOURCES.txt
6
+ MC_UUID_WMCL.egg-info/dependency_links.txt
7
+ MC_UUID_WMCL.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ MC_UUID
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: MC_UUID_WMCL
3
+ Version: 0.3.0
4
+ Summary: Minecraft 离线 UUID 生成库
5
+ Home-page: https://github.com/s12af/MC_UUID
6
+ Author: s12af
7
+ Project-URL: Source Code, https://github.com/s12af/MC_UUID
8
+ Project-URL: Bug Tracker, https://github.com/s12af/MC_UUID/issues
9
+ Keywords: minecraft,uuid,offline,mc
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Games/Entertainment
13
+ Requires-Python: >=3.6
14
+ Description-Content-Type: text/markdown
15
+ Dynamic: author
16
+ Dynamic: classifier
17
+ Dynamic: description
18
+ Dynamic: description-content-type
19
+ Dynamic: home-page
20
+ Dynamic: keywords
21
+ Dynamic: project-url
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # MC-UUID
26
+
27
+ 一个用于 Python 的《我的世界》(Minecraft)离线 UUID 生成库。
28
+
29
+ 给定玩家用户名,即可生成对应的离线模式 UUID,支持标准格式(带横杠)与无横杠格式。
30
+
31
+ 仓库地址:https://github.com/s12af/MC_UUID
32
+
33
+ ## 安装
34
+
35
+ ```bash
36
+ pip install MC_UUID_WMCL
37
+ ```
38
+
39
+ ## 用法
40
+
41
+ ### 标准 UUID(带横杠)
42
+
43
+ ```python
44
+ import MC_UUID
45
+
46
+ name = "Steve"
47
+ uuid = MC_UUID.get_offline_uuid(name)
48
+ print("标准UUID:", uuid)
49
+ ```
50
+
51
+ 输出:
52
+
53
+ ```
54
+ 标准UUID: 5627dd98-e6be-3c21-b8a8-e92344183641
55
+ ```
56
+
57
+ ### 无横杠 UUID
58
+
59
+ ```python
60
+ import MC_UUID
61
+
62
+ name = "Steve"
63
+ uuid = MC_UUID.get_offline_uuid_no_hyphen(name)
64
+ print("无横杠UUID:", uuid)
65
+ ```
66
+
67
+ 输出:
68
+
69
+ ```
70
+ 无横杠UUID: 5627dd98e6be3c21b8a8e92344183641
71
+ ```
72
+
73
+ ## 说明
74
+
75
+ - 导入名使用大写 `MC_UUID`(`import MC_UUID`),这是发布包 `mc-uuid` 在代码中的实际导入名。
76
+ - 适用于 Minecraft 离线(非正版验证)模式下,根据玩家用户名推导 UUID 的场景。
77
+
78
+ ## 反馈
79
+
80
+ 遇到问题或建议,欢迎到仓库提 Issue:https://github.com/s12af/MC_UUID/issues
@@ -0,0 +1,56 @@
1
+ # MC-UUID
2
+
3
+ 一个用于 Python 的《我的世界》(Minecraft)离线 UUID 生成库。
4
+
5
+ 给定玩家用户名,即可生成对应的离线模式 UUID,支持标准格式(带横杠)与无横杠格式。
6
+
7
+ 仓库地址:https://github.com/s12af/MC_UUID
8
+
9
+ ## 安装
10
+
11
+ ```bash
12
+ pip install MC_UUID_WMCL
13
+ ```
14
+
15
+ ## 用法
16
+
17
+ ### 标准 UUID(带横杠)
18
+
19
+ ```python
20
+ import MC_UUID
21
+
22
+ name = "Steve"
23
+ uuid = MC_UUID.get_offline_uuid(name)
24
+ print("标准UUID:", uuid)
25
+ ```
26
+
27
+ 输出:
28
+
29
+ ```
30
+ 标准UUID: 5627dd98-e6be-3c21-b8a8-e92344183641
31
+ ```
32
+
33
+ ### 无横杠 UUID
34
+
35
+ ```python
36
+ import MC_UUID
37
+
38
+ name = "Steve"
39
+ uuid = MC_UUID.get_offline_uuid_no_hyphen(name)
40
+ print("无横杠UUID:", uuid)
41
+ ```
42
+
43
+ 输出:
44
+
45
+ ```
46
+ 无横杠UUID: 5627dd98e6be3c21b8a8e92344183641
47
+ ```
48
+
49
+ ## 说明
50
+
51
+ - 导入名使用大写 `MC_UUID`(`import MC_UUID`),这是发布包 `mc-uuid` 在代码中的实际导入名。
52
+ - 适用于 Minecraft 离线(非正版验证)模式下,根据玩家用户名推导 UUID 的场景。
53
+
54
+ ## 反馈
55
+
56
+ 遇到问题或建议,欢迎到仓库提 Issue:https://github.com/s12af/MC_UUID/issues
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="MC_UUID_WMCL",
5
+ version="0.3.0",
6
+ author="s12af",
7
+ description="Minecraft 离线 UUID 生成库",
8
+ long_description=open('README.md', encoding='utf-8').read(),
9
+ long_description_content_type='text/markdown',
10
+ url="https://github.com/s12af/MC_UUID",
11
+ project_urls={
12
+ "Source Code": "https://github.com/s12af/MC_UUID",
13
+ "Bug Tracker": "https://github.com/s12af/MC_UUID/issues",
14
+ },
15
+ keywords=["minecraft", "uuid", "offline", "mc"],
16
+ classifiers=[
17
+ "Programming Language :: Python :: 3",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: Games/Entertainment",
20
+ ],
21
+ packages=find_packages(),
22
+ python_requires=">=3.6",
23
+ )