maxapi-python 0.1.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 noxzion
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.
@@ -0,0 +1,16 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ include MANIFEST.in
5
+
6
+ recursive-include src *.py
7
+ recursive-include examples *.py
8
+
9
+ global-exclude *.pyc
10
+ global-exclude *.pyo
11
+ global-exclude __pycache__
12
+ global-exclude .git*
13
+ global-exclude .DS_Store
14
+ global-exclude *.egg-info
15
+ global-exclude build
16
+ global-exclude dist
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.4
2
+ Name: maxapi-python
3
+ Version: 0.1.0
4
+ Summary: Python wrapper для API мессенджера Max
5
+ Author-email: noxzion <negroid2281488ilikrilex@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/noxzion/PyMax
8
+ Project-URL: Repository, https://github.com/noxzion/PyMax
9
+ Project-URL: Issues, https://github.com/noxzion/PyMax/issues
10
+ Keywords: max,messenger,api,wrapper,websocket
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: build>=1.3.0
17
+ Requires-Dist: pydocstring>=0.2.1
18
+ Requires-Dist: sqlmodel>=0.0.24
19
+ Requires-Dist: websockets>=11.0
20
+ Dynamic: license-file
21
+
22
+ ## MApi - Python api wrapper для Max'a
23
+
24
+ ## Установка
25
+
26
+ > [!IMPORTANT]
27
+ > Нужно иметь git для установки из репозитория
28
+
29
+ ```bash
30
+ pip install git+https://github.com/noxzion/PyMax
31
+ ```
32
+
33
+ Или (без git)
34
+ ```bash
35
+ pip install maxapi-python
36
+ ```
37
+
38
+ ## Пример использования:
39
+
40
+ ```python
41
+ import asyncio
42
+
43
+ from mapi import MaxClient, Message
44
+
45
+
46
+ phone = "+1234567890"
47
+ client = MaxClient(phone=phone, work_dir="cache")
48
+
49
+
50
+ async def main() -> None:
51
+ await client.start()
52
+
53
+ for chat in client.chats:
54
+ print(chat.title)
55
+
56
+ message = await client.send_message("Hello from MaxClient!", chat.id, notify=True)
57
+
58
+ await asyncio.sleep(5)
59
+ message = await client.edit_message(chat.id, message.id, "Hello from MaxClient! (edited)")
60
+ await asyncio.sleep(5)
61
+
62
+ await client.delete_message(chat.id, [message.id], for_me=False)
63
+
64
+ for dialog in client.dialogs:
65
+ print(dialog.last_message.text)
66
+
67
+ for channel in client.channels:
68
+ print(channel.title)
69
+
70
+ await client.close()
71
+
72
+
73
+ @client.on_message
74
+ async def handle_message(message: Message) -> None:
75
+ print(str(message.sender) + ": " + message.text)
76
+
77
+
78
+ @client.on_start
79
+ async def handle_start() -> None:
80
+ print("Client started successfully!")
81
+ history = await client.fetch_history(chat_id=0)
82
+ if history:
83
+ for message in history:
84
+ user_id = message.sender
85
+ user = await client.get_user(user_id)
86
+
87
+ if user:
88
+ print(f"{user.names[0].name}: {message.text}")
89
+
90
+
91
+ if __name__ == "__main__":
92
+ asyncio.run(client.start())
93
+ ```
94
+
95
+ ## Разработка
96
+
97
+ Сборка пакета:
98
+
99
+ ```bash
100
+ python scripts/build.py
101
+ ```
102
+
103
+ ## Лицензия
104
+
105
+ [MIT](LICENSE)
106
+
107
+ ## Авторы
108
+
109
+ - [noxzion](https://github.com/noxzion) - исходный код пакета
110
+ - [ink](https://github.com/ink-developer) - вскрытие API и документация
@@ -0,0 +1,89 @@
1
+ ## MApi - Python api wrapper для Max'a
2
+
3
+ ## Установка
4
+
5
+ > [!IMPORTANT]
6
+ > Нужно иметь git для установки из репозитория
7
+
8
+ ```bash
9
+ pip install git+https://github.com/noxzion/PyMax
10
+ ```
11
+
12
+ Или (без git)
13
+ ```bash
14
+ pip install maxapi-python
15
+ ```
16
+
17
+ ## Пример использования:
18
+
19
+ ```python
20
+ import asyncio
21
+
22
+ from mapi import MaxClient, Message
23
+
24
+
25
+ phone = "+1234567890"
26
+ client = MaxClient(phone=phone, work_dir="cache")
27
+
28
+
29
+ async def main() -> None:
30
+ await client.start()
31
+
32
+ for chat in client.chats:
33
+ print(chat.title)
34
+
35
+ message = await client.send_message("Hello from MaxClient!", chat.id, notify=True)
36
+
37
+ await asyncio.sleep(5)
38
+ message = await client.edit_message(chat.id, message.id, "Hello from MaxClient! (edited)")
39
+ await asyncio.sleep(5)
40
+
41
+ await client.delete_message(chat.id, [message.id], for_me=False)
42
+
43
+ for dialog in client.dialogs:
44
+ print(dialog.last_message.text)
45
+
46
+ for channel in client.channels:
47
+ print(channel.title)
48
+
49
+ await client.close()
50
+
51
+
52
+ @client.on_message
53
+ async def handle_message(message: Message) -> None:
54
+ print(str(message.sender) + ": " + message.text)
55
+
56
+
57
+ @client.on_start
58
+ async def handle_start() -> None:
59
+ print("Client started successfully!")
60
+ history = await client.fetch_history(chat_id=0)
61
+ if history:
62
+ for message in history:
63
+ user_id = message.sender
64
+ user = await client.get_user(user_id)
65
+
66
+ if user:
67
+ print(f"{user.names[0].name}: {message.text}")
68
+
69
+
70
+ if __name__ == "__main__":
71
+ asyncio.run(client.start())
72
+ ```
73
+
74
+ ## Разработка
75
+
76
+ Сборка пакета:
77
+
78
+ ```bash
79
+ python scripts/build.py
80
+ ```
81
+
82
+ ## Лицензия
83
+
84
+ [MIT](LICENSE)
85
+
86
+ ## Авторы
87
+
88
+ - [noxzion](https://github.com/noxzion) - исходный код пакета
89
+ - [ink](https://github.com/ink-developer) - вскрытие API и документация
@@ -0,0 +1,53 @@
1
+ import asyncio
2
+
3
+ from pymax import MaxClient, Message
4
+
5
+ phone = "+1234567890"
6
+
7
+
8
+ client = MaxClient(phone=phone, work_dir="cache")
9
+
10
+
11
+ async def main() -> None:
12
+ await client.start()
13
+
14
+ for chat in client.chats:
15
+ print(chat.title)
16
+
17
+ message = await client.send_message("Hello from MaxClient!", chat.id, notify=True)
18
+
19
+ await asyncio.sleep(5)
20
+ message = await client.edit_message(chat.id, message.id, "Hello from MaxClient! (edited)")
21
+ await asyncio.sleep(5)
22
+
23
+ await client.delete_message(chat.id, [message.id], for_me=False)
24
+
25
+ for dialog in client.dialogs:
26
+ print(dialog.last_message.text)
27
+
28
+ for channel in client.channels:
29
+ print(channel.title)
30
+
31
+ await client.close()
32
+
33
+
34
+ @client.on_message
35
+ async def handle_message(message: Message) -> None:
36
+ print(str(message.sender) + ": " + message.text)
37
+
38
+
39
+ @client.on_start
40
+ async def handle_start() -> None:
41
+ print("Client started successfully!")
42
+ history = await client.fetch_history(chat_id=0)
43
+ if history:
44
+ for message in history:
45
+ user_id = message.sender
46
+ user = await client.get_user(user_id)
47
+
48
+ if user:
49
+ print(f"{user.names[0].name}: {message.text}")
50
+
51
+
52
+ if __name__ == "__main__":
53
+ asyncio.run(client.start())
@@ -0,0 +1,37 @@
1
+ [project]
2
+ name = "maxapi-python"
3
+ version = "0.1.0"
4
+ description = "Python wrapper для API мессенджера Max"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ authors = [
8
+ { name = "noxzion", email = "negroid2281488ilikrilex@gmail.com" }
9
+ ]
10
+ license = "MIT"
11
+ keywords = ["max", "messenger", "api", "wrapper", "websocket"]
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+
15
+ "Operating System :: OS Independent"
16
+ ]
17
+ dependencies = [
18
+ "build>=1.3.0",
19
+ "pydocstring>=0.2.1",
20
+ "sqlmodel>=0.0.24",
21
+ "websockets>=11.0",
22
+ ]
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/noxzion/PyMax"
26
+ Repository = "https://github.com/noxzion/PyMax"
27
+ Issues = "https://github.com/noxzion/PyMax/issues"
28
+
29
+ [build-system]
30
+ requires = ["setuptools>=61.0", "wheel"]
31
+ build-backend = "setuptools.build_meta"
32
+
33
+ [tool.setuptools.packages.find]
34
+ where = ["src"]
35
+
36
+ [tool.setuptools.package-dir]
37
+ "" = "src"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.4
2
+ Name: maxapi-python
3
+ Version: 0.1.0
4
+ Summary: Python wrapper для API мессенджера Max
5
+ Author-email: noxzion <negroid2281488ilikrilex@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/noxzion/PyMax
8
+ Project-URL: Repository, https://github.com/noxzion/PyMax
9
+ Project-URL: Issues, https://github.com/noxzion/PyMax/issues
10
+ Keywords: max,messenger,api,wrapper,websocket
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: build>=1.3.0
17
+ Requires-Dist: pydocstring>=0.2.1
18
+ Requires-Dist: sqlmodel>=0.0.24
19
+ Requires-Dist: websockets>=11.0
20
+ Dynamic: license-file
21
+
22
+ ## MApi - Python api wrapper для Max'a
23
+
24
+ ## Установка
25
+
26
+ > [!IMPORTANT]
27
+ > Нужно иметь git для установки из репозитория
28
+
29
+ ```bash
30
+ pip install git+https://github.com/noxzion/PyMax
31
+ ```
32
+
33
+ Или (без git)
34
+ ```bash
35
+ pip install maxapi-python
36
+ ```
37
+
38
+ ## Пример использования:
39
+
40
+ ```python
41
+ import asyncio
42
+
43
+ from mapi import MaxClient, Message
44
+
45
+
46
+ phone = "+1234567890"
47
+ client = MaxClient(phone=phone, work_dir="cache")
48
+
49
+
50
+ async def main() -> None:
51
+ await client.start()
52
+
53
+ for chat in client.chats:
54
+ print(chat.title)
55
+
56
+ message = await client.send_message("Hello from MaxClient!", chat.id, notify=True)
57
+
58
+ await asyncio.sleep(5)
59
+ message = await client.edit_message(chat.id, message.id, "Hello from MaxClient! (edited)")
60
+ await asyncio.sleep(5)
61
+
62
+ await client.delete_message(chat.id, [message.id], for_me=False)
63
+
64
+ for dialog in client.dialogs:
65
+ print(dialog.last_message.text)
66
+
67
+ for channel in client.channels:
68
+ print(channel.title)
69
+
70
+ await client.close()
71
+
72
+
73
+ @client.on_message
74
+ async def handle_message(message: Message) -> None:
75
+ print(str(message.sender) + ": " + message.text)
76
+
77
+
78
+ @client.on_start
79
+ async def handle_start() -> None:
80
+ print("Client started successfully!")
81
+ history = await client.fetch_history(chat_id=0)
82
+ if history:
83
+ for message in history:
84
+ user_id = message.sender
85
+ user = await client.get_user(user_id)
86
+
87
+ if user:
88
+ print(f"{user.names[0].name}: {message.text}")
89
+
90
+
91
+ if __name__ == "__main__":
92
+ asyncio.run(client.start())
93
+ ```
94
+
95
+ ## Разработка
96
+
97
+ Сборка пакета:
98
+
99
+ ```bash
100
+ python scripts/build.py
101
+ ```
102
+
103
+ ## Лицензия
104
+
105
+ [MIT](LICENSE)
106
+
107
+ ## Авторы
108
+
109
+ - [noxzion](https://github.com/noxzion) - исходный код пакета
110
+ - [ink](https://github.com/ink-developer) - вскрытие API и документация
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ examples/example.py
6
+ src/maxapi_python.egg-info/PKG-INFO
7
+ src/maxapi_python.egg-info/SOURCES.txt
8
+ src/maxapi_python.egg-info/dependency_links.txt
9
+ src/maxapi_python.egg-info/requires.txt
10
+ src/maxapi_python.egg-info/top_level.txt
11
+ src/pymax/__init__.py
12
+ src/pymax/core.py
13
+ src/pymax/crud.py
14
+ src/pymax/exceptions.py
15
+ src/pymax/models.py
16
+ src/pymax/static.py
17
+ src/pymax/types.py
@@ -0,0 +1,4 @@
1
+ build>=1.3.0
2
+ pydocstring>=0.2.1
3
+ sqlmodel>=0.0.24
4
+ websockets>=11.0
@@ -0,0 +1,55 @@
1
+ """
2
+ Python wrapper для API мессенджера Max
3
+ """
4
+
5
+ from .core import (
6
+ InvalidPhoneError,
7
+ MaxClient,
8
+ WebSocketNotConnectedError,
9
+ )
10
+ from .static import (
11
+ AccessType,
12
+ AuthType,
13
+ ChatType,
14
+ Constants,
15
+ DeviceType,
16
+ ElementType,
17
+ MessageStatus,
18
+ MessageType,
19
+ Opcode,
20
+ )
21
+ from .types import (
22
+ Channel,
23
+ Chat,
24
+ Dialog,
25
+ Element,
26
+ Message,
27
+ User,
28
+ )
29
+
30
+ __author__ = "noxzion"
31
+
32
+ __all__ = [
33
+ # Перечисления и константы
34
+ "AccessType",
35
+ "AuthType",
36
+ # Типы данных
37
+ "Channel",
38
+ "Chat",
39
+ "ChatType",
40
+ "Constants",
41
+ "DeviceType",
42
+ "Dialog",
43
+ "Element",
44
+ "ElementType",
45
+ # Исключения
46
+ "InvalidPhoneError",
47
+ # Клиент
48
+ "MaxClient",
49
+ "Message",
50
+ "MessageStatus",
51
+ "MessageType",
52
+ "Opcode",
53
+ "User",
54
+ "WebSocketNotConnectedError",
55
+ ]