yaylib 1.5.0.dev4__tar.gz → 1.5.2__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 (26) hide show
  1. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/PKG-INFO +86 -130
  2. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/README.md +85 -129
  3. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/__init__.py +8 -1
  4. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/auth.py +10 -8
  5. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/group.py +16 -10
  6. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/misc.py +4 -4
  7. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/post.py +68 -37
  8. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/user.py +27 -18
  9. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/client.py +54 -12
  10. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/config.py +3 -3
  11. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/device.py +10 -3
  12. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/models.py +68 -66
  13. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/responses.py +61 -90
  14. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/utils.py +1 -1
  15. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/LICENSE +0 -0
  16. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/pyproject.toml +0 -0
  17. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/__init__.py +0 -0
  18. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/call.py +0 -0
  19. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/chat.py +0 -0
  20. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/notification.py +0 -0
  21. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/review.py +0 -0
  22. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/api/thread.py +0 -0
  23. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/constants.py +0 -0
  24. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/errors.py +0 -0
  25. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/state.py +0 -0
  26. {yaylib-1.5.0.dev4 → yaylib-1.5.2}/yaylib/ws.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yaylib
3
- Version: 1.5.0.dev4
3
+ Version: 1.5.2
4
4
  Summary: 同世代と趣味の通話コミュニティ - Yay! (イェイ) で投稿やタイムラインの取得、リツイートやいいねの実行、フォローや投稿の検索など様々な機能をPythonプログラムから利用可能なAPIクライアントツールです。
5
5
  Home-page: https://github.com/ekkx/yaylib
6
6
  License: MIT
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  </div>
29
29
  <br />
30
30
  <p align="center">
31
- <a href="https://github.com/othneildrew/Best-README-Template">
31
+ <a href="https://ekkx.github.io/yaylib">
32
32
  <img src="https://github.com/ekkx/yaylib/assets/77382767/45c45b21-d812-4cad-8f27-315ffef53201" alt="Logo" height="300px">
33
33
  </a>
34
34
  <h3 align="center">yaylib</h3>
@@ -42,62 +42,30 @@ Description-Content-Type: text/markdown
42
42
  </a>
43
43
  <br />
44
44
  <br />
45
- <a href="https://github.com/ekkx/yaylib/issues">Report Bug</a>
45
+ <a href="https://ekkx.github.io/yaylib">ドキュメント</a>
46
46
  ·
47
- <a href="https://github.com/ekkx/yaylib/issues">Request Feature</a>
47
+ <a href="https://github.com/ekkx/yaylib/issues/new">バグを報告</a>
48
48
  ·
49
- <a href="https://discord.gg/MEuBfNtqRN">Join the discord</a>
49
+ <a href="https://discord.gg/MEuBfNtqRN">Discord に参加</a>
50
50
  </p>
51
51
  </p>
52
52
 
53
- <!-- TABLE OF CONTENTS -->
54
-
55
- <details>
56
- <summary>Table of Contents</summary>
57
- <ol>
58
- <li><a href="#buy-me-a-coffee">Buy me a coffee</a></li>
59
- <li><a href="#-installation">インストール</a></li>
60
- <li><a href="#-quick-example">使用例</a></li>
61
- <li><a href="#crown-yaylib-で誕生したロボットたち">yaylib で誕生したロボットたち</a></li>
62
- <li><a href="#handshake-共同開発について">共同開発について</a></li>
63
- <li><a href="#免責事項">免責事項</a></li>
64
- <li><a href="#利用許諾">利用許諾</a></li>
65
- </ol>
66
- </details>
67
-
68
- <!-- Buy me a coffee -->
69
-
70
- ## Buy me a coffee
71
-
72
- このライブラリが気に入っていただけたら、<a href="https://github.com/ekkx/yaylib/">**リポジトリにスターをお願いします</a>(⭐)**
73
- また、Buy Me a Coffee からご支援いただけますと幸いです。
74
-
75
- <a href="https://www.buymeacoffee.com/qvco" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
53
+ <br>
76
54
 
77
55
  <!-- インストール -->
78
56
 
79
57
  ## [<img src="https://github.com/ekkx/yaylib/assets/77382767/2f632349-0cbc-4c81-bc19-11d24c8c142b" width="30" height="30" />](https://github.com/ekkx) Installation
80
58
 
81
- **※ Python 3.10 以上のバージョンが必要です。**
82
-
83
- 「yaylib」をインストールするには、以下のコマンドをターミナル上で実行します:
59
+ **yaylib** `pip` コマンドからインストールします。
84
60
 
85
61
  ```shell
86
62
  pip install yaylib
87
63
  ```
88
64
 
89
- <br>
90
-
91
65
  > [!TIP]
92
- > 開発環境をインストールする場合は、以下の手順を実行します:
66
+ > 動作条件は `Python 3.10` 以上からです。
93
67
 
94
- ```shell
95
- git clone https://github.com/ekkx/yaylib.git
96
-
97
- cd yaylib
98
-
99
- make up
100
- ```
68
+ <br>
101
69
 
102
70
  <!-- 使用例 -->
103
71
 
@@ -108,21 +76,44 @@ make up
108
76
  ```python
109
77
  import yaylib
110
78
 
111
- client = yaylib.Client()
112
- client.login(email="your_email", password="your_password")
79
+ bot = yaylib.Client()
80
+ bot.login('your_email', 'your_password')
81
+
82
+ bot.create_post('Hello with yaylib!')
83
+ ```
84
+
85
+ #### ✨ タイムラインを取得する
86
+
87
+ ```python
88
+ import yaylib
89
+
90
+ bot = yaylib.Client()
91
+
92
+ timeline = bot.get_timeline(number=100)
113
93
 
114
- client.create_post("Hello with yaylib!")
94
+ for post in timeline.posts:
95
+ print(post.user.nickname) # 投稿者名
96
+ print(post.text) # 本文
97
+ print(post.likes_count) # いいね数
98
+ print(post.reposts_count) # (´∀`∩)↑age↑の数
99
+ print(post.in_reply_to_post_count) # 返信の数
115
100
  ```
116
101
 
117
- #### ✨ 埋め込みリンクの投稿を作成する
102
+ #### ✨ タイムラインをキーワードで検索して「いいね」する
118
103
 
119
104
  ```python
120
105
  import yaylib
121
106
 
122
- client = yaylib.Client()
123
- client.login(email="your_email", password="your_password")
107
+ bot = yaylib.Client()
108
+ bot.login('your_email', 'your_password')
109
+
110
+ timeline = bot.get_timeline_by_keyword(
111
+ keyword='プログラミング',
112
+ number=15
113
+ )
124
114
 
125
- client.create_post("Hello with yaylib!", shared_url="https://github.com/ekkx/yaylib")
115
+ for post in timeline.posts:
116
+ bot.like(post.id)
126
117
  ```
127
118
 
128
119
  #### ✨ 画像と一緒に投稿を作成する
@@ -130,122 +121,87 @@ client.create_post("Hello with yaylib!", shared_url="https://github.com/ekkx/yay
130
121
  ```python
131
122
  import yaylib
132
123
 
133
- client = yaylib.Client()
134
- client.login(email="your_email", password="your_password")
124
+ bot = yaylib.Client()
125
+ bot.login('your_email', 'your_password')
135
126
 
136
127
  # 画像のパスを指定
137
128
  image_paths = [
138
- "./test1.jpg",
139
- "./test2.jpg",
140
- "./test3.jpg",
129
+ './test1.jpg',
130
+ './test2.jpg',
131
+ './test3.jpg',
141
132
  ]
142
133
 
143
134
  # 画像の使い道を指定
144
- image_type = yaylib.ImageType.post
135
+ image_type = yaylib.ImageType.POST
145
136
 
146
137
  # サーバー上にアップロード
147
- attachments = client.upload_image(image_paths, image_type)
138
+ attachments = bot.upload_image(image_paths, image_type)
148
139
 
149
140
  # サーバー上のファイル名を指定する
150
141
  # attachmentsが一つ飛ばしなのはオリジナル品質の画像のみを指定するため
151
- client.create_post(
152
- "Hello with yaylib!",
142
+ bot.create_post(
143
+ 'Hello with yaylib!',
153
144
  attachment_filename=attachments[0].filename,
154
145
  attachment_2_filename=attachments[2].filename,
155
146
  attachment_3_filename=attachments[4].filename,
156
147
  )
157
148
  ```
158
149
 
159
- #### ✨ タイムラインを 100 件取得する
160
-
161
- ```python
162
- import yaylib
163
-
164
- client = yaylib.Client()
165
-
166
- timeline = client.get_timeline(number=100)
167
-
168
- for post in timeline.posts:
169
- print(post.user.nickname) # 投稿者名
170
- print(post.text) # 本文
171
- print(post.likes_count) # いいね数
172
- print(post.reposts_count) # (´∀`∩)↑age↑の数
173
- print(post.in_reply_to_post_count) # 返信の数
174
- ```
175
-
176
- #### ✨ タイムラインをキーワードで検索して「いいね」する
177
-
178
- ```python
179
- import yaylib
180
-
181
- client = yaylib.Client()
182
- client.login(email="your_email", password="your_password")
183
-
184
- timeline = client.get_timeline_by_keyword(
185
- keyword="プログラミング",
186
- number=15
187
- )
188
-
189
- for post in timeline.posts:
190
- client.like(post.id)
191
- ```
192
-
193
150
  #### ✨ 新規ユーザーをフォローする
194
151
 
195
152
  ```python
196
153
  import yaylib
197
154
 
198
- client = yaylib.Client()
199
- client.login(email="your_email", password="your_password")
155
+ bot = yaylib.Client()
156
+ bot.login('your_email', 'your_password')
200
157
 
201
- new_users = client.search_users(recently_created=True)
158
+ new_users = bot.search_users(recently_created=True)
202
159
 
203
160
  for new_user in new_users.users:
204
- client.follow_user(new_user.id)
161
+ bot.follow_user(new_user.id)
205
162
  ```
206
163
 
207
164
  #### ✨ リアルタイムでチャットを取得する
208
165
 
209
166
  ```python
210
167
  import yaylib
211
- from yaylib import Message
212
168
 
213
- class MyBot(yaylib.Client):
214
- def on_ready(self):
215
- print("ボットがオンラインになりました!")
169
+ class ChatBot(yaylib.Client):
170
+ async def on_ready():
171
+ print('Botがオンラインになりました!')
216
172
 
217
- def on_chat_request(self, total_count):
218
- # チャットリクエストはすべて承認する
219
- chat_requests = self.get_chat_requests()
173
+ async def on_chat_request(self, total_count):
174
+ # チャットリクエストを承認し on_message() に送信する
175
+ chat_requests = await self.chat.get_chat_requests()
220
176
  for chat_room in chat_requests.chat_rooms:
221
- self.accept_chat_requests([chat_room.id])
222
-
223
- # 最新のメッセージをon_message_create関数に送信
224
- message = self.get_messages(chat_requests.chat_rooms[0].id)
225
- self.on_message_create(message[0])
177
+ await self.chat.accept_chat_requests(chat_room_ids=[chat_room.id])
178
+ message = await self.chat.get_messages(chat_requests.chat_rooms[0].id)
179
+ await self.on_message(message[0])
226
180
 
227
- def on_message_create(self, message: Message):
228
- # ping」というメッセージに対して「pong」と返信する
229
- if message.text == "ping":
230
- self.send_message(message.room_id, text="pong")
181
+ async def on_message(self, message: yaylib.Message):
182
+ if message.text == 'ping':
183
+ await self.chat.send_message(
184
+ message.room_id,
185
+ text='pong',
186
+ )
231
187
 
232
- def on_chat_room_delete(self, room_id):
233
- print(f"チャットルームが削除されました。ルームID: {room_id}")
188
+ async def on_chat_delete(self, room_id):
189
+ print(f'チャットルームが削除されました。{room_id}')
234
190
 
235
191
  intents = yaylib.Intents.none()
236
192
  intents.chat_message = True
237
193
 
238
- bot = MyBot(intents=intents)
239
- bot.run("your_email", "your_password")
194
+ bot = ChatBot(intents=intents)
195
+ bot.run('your_email', 'your_password')
240
196
  ```
241
197
 
242
- より詳しい使用例については、[こちら](https://github.com/ekkx/yaylib/blob/master/examples) を参照してください。
198
+ より詳しい使用例については、[ドキュメント](https://ekkx.github.io/yaylib/demo.html)を参照してください。
243
199
 
244
- <p align="right">(<a href="#readme-top">トップに戻る</a>)</p>
200
+ <br>
245
201
 
246
202
  <!-- yaylib で誕生したボットの一覧 -->
247
203
 
248
- ## :crown: yaylib で誕生したロボットたち
204
+ ## 👑 yaylib で誕生したロボットたち
249
205
 
250
206
  「yaylib」を用いて開発したロボットがある場合は、ぜひ教えてください!
251
207
 
@@ -253,7 +209,7 @@ bot.run("your_email", "your_password")
253
209
  <thead>
254
210
  <tr>
255
211
  <th><a href="https://yay.space/user/5855987">MindReader AI</a></th>
256
- <th><a href="https://yay.space/user/7874560">☀️気象くん☁️</a></th>
212
+ <th><a href="https://yay.space/user/8271084">めいく</a></th>
257
213
  <th><a href="https://yay.space/user/7406336">GIGAZINE</a></th>
258
214
  </tr>
259
215
  </thead>
@@ -265,9 +221,9 @@ bot.run("your_email", "your_password")
265
221
  <p>開発者: <a href="https://yay.space/user/35152">毛の可能性</a></p>
266
222
  </td>
267
223
  <td align="center">
268
- <img src="https://github.com/ekkx/yaylib/assets/77382767/4fd728a0-9b3a-427f-ac1f-70e6d6538564" width="200px">
224
+ <img src="https://github.com/user-attachments/assets/201cb490-29b7-4dd9-a10f-1b27d999787a" width="200px">
269
225
  <br />
270
- <p>開発者: <a href="https://yay.space/user/7520368">tori</a></p>
226
+ <p>開発者: <a href="https://yay.space/user/1173972">まぐ</a></p>
271
227
  </td>
272
228
  <td align="center">
273
229
  <img src="https://github.com/ekkx/yaylib/assets/77382767/65fcb885-4fbe-4170-9378-6f8d9af61ff8" width="200px">
@@ -278,27 +234,27 @@ bot.run("your_email", "your_password")
278
234
  </tbody>
279
235
  </table>
280
236
 
281
- <!-- 共同開発について -->
237
+ <br>
282
238
 
283
- ## :handshake: 共同開発について
239
+ <!-- 共同開発について -->
284
240
 
285
- 私たちと開発することに興味を持っていただけているなら、ぜひ参加して頂きたいです!
241
+ ## 🤝 共同開発について
286
242
 
287
- - [プルリクエストを送信する](https://github.com/ekkx/yaylib/pulls)
288
- - [Discord サーバーに参加する](https://discord.gg/MEuBfNtqRN)
289
- - [nikola.desuga@gmail.com](mailto:nikola.desuga@gmail.com) にメールを送信する
243
+ 詳しい **yaylib** の開発参加手順については、[こちら](https://github.com/ekkx/yaylib/blob/develop/CONTRIBUTING.md)を参照してください。
290
244
 
291
- のいずれかの方法で繋がりましょう。詳しくは[こちらから](https://github.com/ekkx/yaylib/blob/master/CONTRIBUTING.md)!
245
+ <br>
292
246
 
293
247
  <!-- 免責事項 -->
294
248
 
295
- ## 免責事項
249
+ ## 📜 免責事項
296
250
 
297
251
  yaylib は、API の公式なサポートやメンテナンスを提供するものではありません。このクライアントを使用する場合、**利用者はリスクや責任を自己負担できるもの**とします。このクライアントによって提供される情報やデータの正確性、信頼性、完全性、適時性について、いかなる保証も行いません。また、このクライアントの使用によって生じた損害や不利益について、一切の責任を負いかねます。利用者は自己の責任において、このクライアントを使用し、API にアクセスするものとします。なお、この免責事項は予告なく変更される場合があります。
298
252
 
253
+ <br>
254
+
299
255
  <!-- ライセンス -->
300
256
 
301
- ## ライセンス
257
+ ## ⚖️ ライセンス
302
258
 
303
259
  <p align="center">
304
260
  <a href="https://github.com/ekkx">