zcord 2026.0.1.dev0__py3-none-any.whl

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.
zcord/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Zcord - Functional programming discord API wrapper"""
2
+
3
+ from .bot import Bot as Bot
4
+
5
+ __all__ = ["Bot"]
zcord/bot.py ADDED
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ from zcord.http import HTTPClient
4
+
5
+
6
+ class Bot:
7
+ def __init__(self, token: str) -> None:
8
+ self.http = HTTPClient(token)
zcord/http/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .client import HTTPClient as HTTPClient
2
+
3
+ __all__ = ["HTTPClient"]
zcord/http/client.py ADDED
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ import aiohttp
4
+ import orjson
5
+
6
+
7
+ class HTTPClient:
8
+ BASE_URL = "https://discord.com/api/v10"
9
+
10
+ def __init__(self, token: str) -> None:
11
+ self._token = token
12
+ self._session: aiohttp.ClientSession | None = None
13
+
14
+ async def __aenter__(self) -> HTTPClient:
15
+ self._session = aiohttp.ClientSession(
16
+ headers={"Authorization": f"Bot {self._token}"}
17
+ )
18
+ return self
19
+
20
+ async def __aexit__(self, *args) -> None:
21
+ if self._session:
22
+ await self._session.close()
23
+
24
+ async def request(
25
+ self, method: str, endpoint: str, *, json: dict | list | None = None
26
+ ) -> dict | list:
27
+ assert self._session, "Use 'async with client:' context manager"
28
+ async with self._session.request(
29
+ method, self.BASE_URL + endpoint, json=json
30
+ ) as resp:
31
+ return orjson.loads(await resp.read())
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: zcord
3
+ Version: 2026.0.1.dev0
4
+ Summary: Minimalistic Discord API wrapper
5
+ Author: ZyubyL
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/thqnhz/zcord
8
+ Project-URL: Issues, https://github.com/thqnhz/zcord/issues
9
+ Classifier: Development Status :: 1 - Planning
10
+ Classifier: Natural Language :: English
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.12
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: aiohttp>=3.13.5
17
+ Requires-Dist: orjson>=3.11.9
18
+ Provides-Extra: speed
19
+ Requires-Dist: uvloop>=0.22.1; extra == "speed"
20
+ Dynamic: license-file
21
+
22
+ # Zcord - Minimalistic Discord API wrapper
23
+
24
+ Fast, simple Discord API wrapper
@@ -0,0 +1,9 @@
1
+ zcord/__init__.py,sha256=-e2VmvSE__s1hz_qLEBHA-l7QpNV8s1Or8QXMi5yc2Y,105
2
+ zcord/bot.py,sha256=GMUDGJ7RPo2ltIyxBTndJtYgleBU2B4ploQNPHbpcoI,165
3
+ zcord/http/__init__.py,sha256=u5Kqs4NjRrCogOjvADt9RskCWCw3aPPHxiVG-z8WR30,71
4
+ zcord/http/client.py,sha256=e04yfUwGhPG4Xx0a_PN1d_WYe8g_-wLdP5hLY67eIhM,923
5
+ zcord-2026.0.1.dev0.dist-info/licenses/LICENSE,sha256=TLK0uYuzetDPK3B1uea7dJz2cIFPapSUgSVWJELdrgI,1080
6
+ zcord-2026.0.1.dev0.dist-info/METADATA,sha256=ID8dj51ehOoq_UTAgtXX9SfA5YLvj8Eapc053KHIHqc,752
7
+ zcord-2026.0.1.dev0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
8
+ zcord-2026.0.1.dev0.dist-info/top_level.txt,sha256=uchbb3La-JlnRw_FDkCG_1TqRlEhreA0kLOEfHoua3U,6
9
+ zcord-2026.0.1.dev0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present ZyubyL (ThqnhZ)
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 @@
1
+ zcord