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