pyrobale 0.2.9.4__tar.gz → 0.3.5__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 (48) hide show
  1. pyrobale-0.3.5/LICENSE +21 -0
  2. pyrobale-0.3.5/PKG-INFO +176 -0
  3. {pyrobale-0.2.9.4 → pyrobale-0.3.5}/README.md +0 -0
  4. {pyrobale-0.2.9.4 → pyrobale-0.3.5}/pyproject.toml +5 -2
  5. pyrobale-0.3.5/pyrobale/__init__.py +3 -0
  6. pyrobale-0.3.5/pyrobale/client/__init__.py +574 -0
  7. pyrobale-0.3.5/pyrobale/exceptions/__init__.py +0 -0
  8. pyrobale-0.3.5/pyrobale/exceptions/common.py +10 -0
  9. pyrobale-0.3.5/pyrobale/objects/__init__.py +86 -0
  10. pyrobale-0.3.5/pyrobale/objects/animation.py +33 -0
  11. pyrobale-0.3.5/pyrobale/objects/audio.py +24 -0
  12. pyrobale-0.3.5/pyrobale/objects/callbackquery.py +42 -0
  13. pyrobale-0.3.5/pyrobale/objects/chat.py +463 -0
  14. pyrobale-0.3.5/pyrobale/objects/chatmember.py +162 -0
  15. pyrobale-0.3.5/pyrobale/objects/chatphoto.py +18 -0
  16. pyrobale-0.3.5/pyrobale/objects/contact.py +16 -0
  17. pyrobale-0.3.5/pyrobale/objects/copytextbutton.py +5 -0
  18. pyrobale-0.3.5/pyrobale/objects/document.py +26 -0
  19. pyrobale-0.3.5/pyrobale/objects/enums.py +28 -0
  20. pyrobale-0.3.5/pyrobale/objects/file.py +15 -0
  21. pyrobale-0.3.5/pyrobale/objects/inlinekeyboardbutton.py +24 -0
  22. pyrobale-0.3.5/pyrobale/objects/inlinekeyboardmarkup.py +84 -0
  23. pyrobale-0.3.5/pyrobale/objects/inputfile.py +17 -0
  24. pyrobale-0.3.5/pyrobale/objects/inputmedias.py +166 -0
  25. pyrobale-0.3.5/pyrobale/objects/invoice.py +14 -0
  26. pyrobale-0.3.5/pyrobale/objects/keyboardbutton.py +19 -0
  27. pyrobale-0.3.5/pyrobale/objects/labeledprice.py +8 -0
  28. pyrobale-0.3.5/pyrobale/objects/location.py +4 -0
  29. pyrobale-0.3.5/pyrobale/objects/message.py +368 -0
  30. pyrobale-0.3.5/pyrobale/objects/messageid.py +3 -0
  31. pyrobale-0.3.5/pyrobale/objects/photosize.py +9 -0
  32. pyrobale-0.3.5/pyrobale/objects/precheckoutquery.py +21 -0
  33. pyrobale-0.3.5/pyrobale/objects/replykeyboardmarkup.py +54 -0
  34. pyrobale-0.3.5/pyrobale/objects/sticker.py +16 -0
  35. pyrobale-0.3.5/pyrobale/objects/stickerset.py +12 -0
  36. pyrobale-0.3.5/pyrobale/objects/successfulpayment.py +15 -0
  37. pyrobale-0.3.5/pyrobale/objects/update.py +23 -0
  38. pyrobale-0.3.5/pyrobale/objects/user.py +20 -0
  39. pyrobale-0.3.5/pyrobale/objects/utils.py +28 -0
  40. pyrobale-0.3.5/pyrobale/objects/video.py +20 -0
  41. pyrobale-0.3.5/pyrobale/objects/voice.py +4 -0
  42. pyrobale-0.3.5/pyrobale/objects/webappdata.py +3 -0
  43. pyrobale-0.3.5/pyrobale/objects/webappinfo.py +3 -0
  44. {pyrobale-0.2.9.4 → pyrobale-0.3.5}/pyrobale.png +0 -0
  45. {pyrobale-0.2.9.4 → pyrobale-0.3.5}/pyrobaletext.png +0 -0
  46. pyrobale-0.2.9.4/LICENSE +0 -678
  47. pyrobale-0.2.9.4/PKG-INFO +0 -833
  48. pyrobale-0.2.9.4/pyrobale.py +0 -2545
pyrobale-0.3.5/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ali Safamanesh
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,176 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyrobale
3
+ Version: 0.3.5
4
+ Summary: A python wrapper for bale api
5
+ Project-URL: github, https://github.com/pyrobale/pyrobale
6
+ Project-URL: website, https://pyrobale.github.io
7
+ Author-email: Ali Safamanesh <darg.q.a.a@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 Ali Safamanesh
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Operating System :: OS Independent
32
+ Classifier: Programming Language :: Python :: 3
33
+ Requires-Python: >=3.9
34
+ Description-Content-Type: text/markdown
35
+
36
+ ![pyrobaletext](https://raw.githubusercontent.com/pyrobale/pyrobale/refs/heads/main/pyrobaletext.png)
37
+
38
+ # Bale Bot API Python Library
39
+
40
+ A Python wrapper for the Bale Bot API that makes it easy to build Bale bots.
41
+
42
+ ## Features
43
+
44
+ - Full Bale Bot API support
45
+ - Object-oriented design
46
+ - Easy-to-use interface
47
+ - Support for:
48
+ - Messages
49
+ - Photos
50
+ - Documents
51
+ - Audio
52
+ - Video
53
+ - Voice messages
54
+ - Location
55
+ - Contact sharing
56
+ - Inline keyboards
57
+ - Menu keyboards
58
+ - Callback queries
59
+ - Chat administration
60
+ - Payment system
61
+ - Database integration
62
+
63
+ ## Installation
64
+
65
+ ``pip install pyrobale``
66
+
67
+ ## Quick Start
68
+
69
+ ```py
70
+ from bale import Client, MenuKeyboardMarkup, MenuKeyboardButton
71
+
72
+ # Initialize bot with token
73
+ bot = Client("YOUR_BOT_TOKEN")
74
+
75
+ # Handle incoming messages
76
+ @bot.on_message
77
+ def handle_message(message):
78
+ if message.text == "/start":
79
+ # Create keyboard
80
+ keyboard = MenuKeyboardMarkup()
81
+ keyboard.add(MenuKeyboardButton("Hello!"))
82
+
83
+ # Send welcome message
84
+ message.reply_message("Welcome!", reply_markup=keyboard)
85
+
86
+ # Start the bot
87
+ bot.run()
88
+ ```
89
+
90
+ ## Key Components
91
+
92
+ ### Client
93
+
94
+ The main class for interacting with Bale API. Handles all API requests and provides event decorators.
95
+
96
+ ### Message
97
+
98
+ Represents a message in Bale with methods for replying, editing, and deleting messages.
99
+
100
+ ### User
101
+
102
+ Represents a Bale user with their properties and methods.
103
+
104
+ ### Chat
105
+
106
+ Represents a chat conversation with methods for sending messages and managing chat settings.
107
+
108
+ ### Keyboards
109
+
110
+ - `MenuKeyboardMarkup`: For creating text keyboards
111
+ - `InlineKeyboardMarkup`: For creating inline keyboards
112
+
113
+ ### Database
114
+
115
+ Built-in SQLite database support for storing persistent data.
116
+
117
+ ## Event Handlers
118
+
119
+ # Message handler
120
+
121
+ ```python
122
+ @bot.on_message
123
+ def handle_message(message):
124
+ pass
125
+ ```
126
+
127
+ # Callback query handler
128
+
129
+ ```python
130
+ @bot.on_callback_query
131
+ def handle_callback(callback):
132
+ pass
133
+ ```
134
+
135
+ # Periodic task handler
136
+
137
+ ```python
138
+ @bot.on_tick(60) # Runs every 60 seconds
139
+ def handle_tick():
140
+ pass
141
+ ```
142
+
143
+ # Ready event handler
144
+
145
+ ```python
146
+ @bot.on_ready
147
+ def handle_ready():
148
+ pass
149
+ ```
150
+
151
+ # Member join handler
152
+
153
+ ```python
154
+ @bot.on_member_chat_join
155
+ def handle_join(message, chat, user):
156
+ pass
157
+ ```
158
+
159
+ # Member leave handler
160
+
161
+ ```python
162
+ @bot.on_member_chat_leave
163
+ def handle_leave(message, chat, user):
164
+ pass
165
+ ```
166
+
167
+ ## Database Usage
168
+
169
+ # Access database
170
+
171
+ ```py
172
+ with bot.database as db:
173
+ db.write_key("user_123", {"points": 100})
174
+
175
+ data = db.read_key("user_123")
176
+ ```
File without changes
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyrobale"
3
- version = "0.2.9.4"
3
+ version = "0.3.5"
4
4
  authors = [
5
5
  { name = "Ali Safamanesh", email = "darg.q.a.a@gmail.com" },
6
6
  ]
@@ -20,4 +20,7 @@ website = "https://pyrobale.github.io"
20
20
 
21
21
  [build-system]
22
22
  requires = ["hatchling"]
23
- build-backend = "hatchling.build"
23
+ build-backend = "hatchling.build"
24
+
25
+ [tool.hatch.build.targets.wheel]
26
+ packages = ["pyrobale"]
@@ -0,0 +1,3 @@
1
+ from .objects.utils import *
2
+ from .exceptions import *
3
+ from .objects import *