Ryzenth 2.0.2__tar.gz → 2.0.4__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 (35) hide show
  1. {ryzenth-2.0.2 → ryzenth-2.0.4}/PKG-INFO +12 -1
  2. {ryzenth-2.0.2 → ryzenth-2.0.4}/README.md +11 -0
  3. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/__init__.py +7 -2
  4. ryzenth-2.0.4/Ryzenth/__version__.py +10 -0
  5. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/_asynchisded.py +6 -1
  6. ryzenth-2.0.4/Ryzenth/_client.py +160 -0
  7. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/_errors.py +15 -0
  8. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/_synchisded.py +6 -1
  9. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth.egg-info/PKG-INFO +12 -1
  10. ryzenth-2.0.2/Ryzenth/__version__.py +0 -4
  11. ryzenth-2.0.2/Ryzenth/_client.py +0 -61
  12. {ryzenth-2.0.2 → ryzenth-2.0.4}/LICENSE +0 -0
  13. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/_shared.py +0 -0
  14. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/__init__.py +0 -0
  15. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_decorators.py +0 -0
  16. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_federation.py +0 -0
  17. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_fonts.py +0 -0
  18. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_images.py +0 -0
  19. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_moderator.py +0 -0
  20. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_openai.py +0 -0
  21. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_ryzenth.py +0 -0
  22. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/helper/_thinking.py +0 -0
  23. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/pyoraddons/__init__.py +0 -0
  24. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/tests/__init__.py +0 -0
  25. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/tests/test_deepseek.py +0 -0
  26. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/tests/test_moderator.py +0 -0
  27. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/tests/test_send.py +0 -0
  28. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/tests/test_send_downloader.py +0 -0
  29. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth/types/__init__.py +0 -0
  30. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth.egg-info/SOURCES.txt +0 -0
  31. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth.egg-info/dependency_links.txt +0 -0
  32. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth.egg-info/requires.txt +0 -0
  33. {ryzenth-2.0.2 → ryzenth-2.0.4}/Ryzenth.egg-info/top_level.txt +0 -0
  34. {ryzenth-2.0.2 → ryzenth-2.0.4}/setup.cfg +0 -0
  35. {ryzenth-2.0.2 → ryzenth-2.0.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -122,11 +122,22 @@ You can skip passing the API key directly by setting it via environment:
122
122
  export RYZENTH_API_KEY=your-api-key
123
123
  ```
124
124
 
125
+ ## Web scrapers
126
+ * [`itzpire`](https://itzpire.com) - Team Developer
127
+
125
128
  ## Credits
126
129
 
127
130
  * Built with love by [xtdevs](https://t.me/xtdevs)
128
131
  * Inspired by early work on AkenoX API
129
132
  * Thanks to Google Dev tools for AI integration concepts
133
+ * All Web scraper original
134
+
135
+ ## Donation
136
+ * Your donation helps us continue our work!
137
+
138
+ To send payments via DANA, use the following Bank Jago account number:
139
+
140
+ Bank Jago: `100201327349`
130
141
 
131
142
  ## License
132
143
 
@@ -70,11 +70,22 @@ You can skip passing the API key directly by setting it via environment:
70
70
  export RYZENTH_API_KEY=your-api-key
71
71
  ```
72
72
 
73
+ ## Web scrapers
74
+ * [`itzpire`](https://itzpire.com) - Team Developer
75
+
73
76
  ## Credits
74
77
 
75
78
  * Built with love by [xtdevs](https://t.me/xtdevs)
76
79
  * Inspired by early work on AkenoX API
77
80
  * Thanks to Google Dev tools for AI integration concepts
81
+ * All Web scraper original
82
+
83
+ ## Donation
84
+ * Your donation helps us continue our work!
85
+
86
+ To send payments via DANA, use the following Bank Jago account number:
87
+
88
+ Bank Jago: `100201327349`
78
89
 
79
90
  ## License
80
91
 
@@ -19,6 +19,11 @@
19
19
 
20
20
  from . import *
21
21
  from .__version__ import __version__
22
- from ._client import ApiKeyFrom, SmallConvertDot, UrHellFrom
22
+ from ._client import ApiKeyFrom, RyzenthApiClient, SmallConvertDot, UrHellFrom
23
23
 
24
- __all__ = [ "ApiKeyFrom", "UrHellFrom", "SmallConvertDot"]
24
+ __all__ = [
25
+ "ApiKeyFrom",
26
+ "RyzenthApiClient",
27
+ "UrHellFrom",
28
+ "SmallConvertDot"
29
+ ]
@@ -0,0 +1,10 @@
1
+ import platform
2
+
3
+
4
+ def get_user_agent() -> str:
5
+ return f"Ryzenth/Python-{platform.python_version()}"
6
+
7
+ __version__ = "2.0.4"
8
+ __author__ = "TeamKillerX"
9
+ __title__ = "Ryzenth"
10
+ __description__ = "Ryzenth Python API Wrapper"
@@ -18,11 +18,13 @@
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
20
  import logging
21
+ import platform
21
22
  from typing import Union
22
23
 
23
24
  import httpx
24
25
  from box import Box
25
26
 
27
+ from .__version__ import get_user_agent
26
28
  from ._errors import InvalidModelError, WhatFuckError
27
29
  from ._shared import BASE_DICT_AI_RYZENTH, BASE_DICT_OFFICIAL, BASE_DICT_RENDER
28
30
  from .helper import (
@@ -41,7 +43,10 @@ class RyzenthXAsync:
41
43
  def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
42
44
  self.api_key = api_key
43
45
  self.base_url = base_url.rstrip("/")
44
- self.headers = {"x-api-key": self.api_key}
46
+ self.headers = {
47
+ "User-Agent": get_user_agent(),
48
+ "x-api-key": self.api_key
49
+ }
45
50
  self.timeout = 10
46
51
  self.params = {}
47
52
  self.images = ImagesAsync(self)
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import os
21
+ import platform
22
+ import typing as t
23
+
24
+ import aiohttp
25
+ from box import Box
26
+
27
+ from .__version__ import get_user_agent
28
+ from ._asynchisded import RyzenthXAsync
29
+ from ._errors import ForbiddenError, InternalError, ToolNotFoundError, WhatFuckError
30
+ from ._synchisded import RyzenthXSync
31
+ from .helper import Decorators
32
+
33
+
34
+ class ApiKeyFrom:
35
+ def __init__(self, api_key: str = None, is_ok=False):
36
+ if api_key is Ellipsis:
37
+ is_ok = True
38
+ api_key = None
39
+
40
+ if not api_key:
41
+ api_key = os.environ.get("RYZENTH_API_KEY")
42
+
43
+ if not api_key:
44
+ api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if is_ok else None
45
+
46
+ self.api_key = api_key
47
+ self.aio = RyzenthXAsync(api_key)
48
+ self._sync = RyzenthXSync(api_key)
49
+
50
+ def something(self):
51
+ pass
52
+
53
+ class UrHellFrom:
54
+ def __init__(self, name: str, only_author=False):
55
+ self.decorators = Decorators(ApiKeyFrom)
56
+ self.ai = self.decorators.send_ai(name=name, only_author=only_author)
57
+
58
+ def something(self):
59
+ pass
60
+
61
+ class SmallConvertDot:
62
+ def __init__(self, obj):
63
+ self.obj = obj
64
+
65
+ def to_dot(self):
66
+ return Box(self.obj if self.obj is not None else {})
67
+
68
+ TOOL_DOMAIN_MAP = {
69
+ "itzpire": "https://itzpire.com",
70
+ "ryzenth": "https://randydev-ryu-js.hf.space",
71
+ }
72
+
73
+ class RyzenthApiClient:
74
+ def __init__(
75
+ self,
76
+ *,
77
+ api_key: str,
78
+ tools_name: list[str],
79
+ use_default_headers: bool = False
80
+ ) -> None:
81
+ if not api_key:
82
+ raise WhatFuckError("API Key cannot be empty.")
83
+ if not tools_name:
84
+ raise WhatFuckError("A non-empty list of tool names must be provided for 'tools_name'.")
85
+
86
+ self._api_key: str = api_key
87
+ self._use_default_headers: bool = use_default_headers
88
+ self._session: aiohttp.ClientSession = aiohttp.ClientSession(
89
+ headers={
90
+ "User-Agent": get_user_agent(),
91
+ **({"x-api-key": self._api_key} if self._use_default_headers else {})
92
+ }
93
+ )
94
+ self._tools: dict[str, str] = {
95
+ name: TOOL_DOMAIN_MAP.get(name)
96
+ for name in tools_name
97
+ }
98
+
99
+ def get_base_url(self, tool: str) -> str:
100
+ check_ok = self._tools.get(tool, None)
101
+ if check_ok is None:
102
+ raise ToolNotFoundError(f"Base URL for tool '{tool}' not found.")
103
+ return check_ok
104
+
105
+ @classmethod
106
+ def from_env(cls) -> "RyzenthApiClient":
107
+ api_key: t.Optional[str] = os.environ.get("RYZENTH_API_KEY")
108
+ if not api_key:
109
+ raise WhatFuckError("API Key cannot be empty.")
110
+ return cls(api_key=api_key)
111
+
112
+ async def _status_resp_error(self, resp):
113
+ if resp.status == 403:
114
+ raise ForbiddenError("Access Forbidden: You may be blocked or banned.")
115
+ if resp.status == 500:
116
+ raise InternalError("Error requests status code 5000")
117
+
118
+ async def get(
119
+ self,
120
+ tool: str,
121
+ path: str,
122
+ params: t.Optional[dict] = None
123
+ ) -> dict:
124
+ base_url = self.get_base_url(tool)
125
+ url = f"{base_url}{path}"
126
+ try:
127
+ async with self._session.get(url, params=params) as resp:
128
+ await self._status_resp_error(resp)
129
+ resp.raise_for_status()
130
+ return await resp.json()
131
+ except ForbiddenError as e:
132
+ return {"error": str(e)}
133
+ except aiohttp.ClientResponseError as e:
134
+ return {"error": f"HTTP Error: {e.status} {e.message}"}
135
+ except Exception as e:
136
+ return {"error": str(e)}
137
+
138
+ async def post(
139
+ self,
140
+ tool: str,
141
+ path: str,
142
+ data: t.Optional[dict] = None,
143
+ json: t.Optional[dict] = None
144
+ ) -> dict:
145
+ base_url = self.get_base_url(tool)
146
+ url = f"{base_url}{path}"
147
+ try:
148
+ async with self._session.post(url, data=data, json=json) as resp:
149
+ await self._status_resp_error(resp)
150
+ resp.raise_for_status()
151
+ return await resp.json()
152
+ except ForbiddenError as e:
153
+ return {"error": str(e)}
154
+ except aiohttp.ClientResponseError as e:
155
+ return {"error": f"HTTP Error: {e.status} {e.message}"}
156
+ except Exception as e:
157
+ return {"error": str(e)}
158
+
159
+ async def close(self):
160
+ await self._session.close()
@@ -26,6 +26,18 @@ class WhatFuckError(Exception):
26
26
  class ParamsRequiredError(ValueError):
27
27
  pass
28
28
 
29
+ class ForbiddenError(Exception):
30
+ """Custom exception for 403 Forbidden"""
31
+ pass
32
+
33
+ class ToolNotFoundError(Exception):
34
+ """Raised when a base URL for a requested tool cannot be found."""
35
+ pass
36
+
37
+ class InternalError(Exception):
38
+ """Custom exception for 500 Error"""
39
+ pass
40
+
29
41
  class RequiredError(ValueError):
30
42
  pass
31
43
 
@@ -46,6 +58,9 @@ class InvalidEmptyError(ValueError):
46
58
 
47
59
  __all__ = [
48
60
  "WhatFuckError",
61
+ "ForbiddenError",
62
+ "InternalError",
63
+ "ToolNotFoundError",
49
64
  "ParamsRequiredError",
50
65
  "InvalidVersionError",
51
66
  "InvalidJSONDecodeError",
@@ -18,11 +18,13 @@
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
20
  import logging
21
+ import platform
21
22
  from typing import Union
22
23
 
23
24
  import httpx
24
25
  from box import Box
25
26
 
27
+ from .__version__ import get_user_agent
26
28
  from ._errors import InvalidModelError, WhatFuckError
27
29
  from ._shared import BASE_DICT_AI_RYZENTH, BASE_DICT_OFFICIAL, BASE_DICT_RENDER
28
30
  from .helper import (
@@ -41,7 +43,10 @@ class RyzenthXSync:
41
43
  def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
42
44
  self.api_key = api_key
43
45
  self.base_url = base_url.rstrip("/")
44
- self.headers = {"x-api-key": self.api_key}
46
+ self.headers = {
47
+ "User-Agent": get_user_agent(),
48
+ "x-api-key": self.api_key
49
+ }
45
50
  self.timeout = 10
46
51
  self.params = {}
47
52
  self.images = ImagesSync(self)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -122,11 +122,22 @@ You can skip passing the API key directly by setting it via environment:
122
122
  export RYZENTH_API_KEY=your-api-key
123
123
  ```
124
124
 
125
+ ## Web scrapers
126
+ * [`itzpire`](https://itzpire.com) - Team Developer
127
+
125
128
  ## Credits
126
129
 
127
130
  * Built with love by [xtdevs](https://t.me/xtdevs)
128
131
  * Inspired by early work on AkenoX API
129
132
  * Thanks to Google Dev tools for AI integration concepts
133
+ * All Web scraper original
134
+
135
+ ## Donation
136
+ * Your donation helps us continue our work!
137
+
138
+ To send payments via DANA, use the following Bank Jago account number:
139
+
140
+ Bank Jago: `100201327349`
130
141
 
131
142
  ## License
132
143
 
@@ -1,4 +0,0 @@
1
- __version__ = "2.0.2"
2
- __author__ = "TeamKillerX"
3
- __title__ = "Ryzenth"
4
- __description__ = "Ryzenth Python API Wrapper"
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
- # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
- #
5
- # from : https://github.com/TeamKillerX
6
- # Channel : @RendyProjects
7
- # This program is free software: you can redistribute it and/or modify
8
- # it under the terms of the GNU Affero General Public License as published by
9
- # the Free Software Foundation, either version 3 of the License, or
10
- # (at your option) any later version.
11
- #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Affero General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU Affero General Public License
18
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
-
20
- import os
21
-
22
- from box import Box
23
-
24
- from ._asynchisded import RyzenthXAsync
25
- from ._synchisded import RyzenthXSync
26
- from .helper import Decorators
27
-
28
-
29
- class ApiKeyFrom:
30
- def __init__(self, api_key: str = None, is_ok=False):
31
- if api_key is Ellipsis:
32
- is_ok = True
33
- api_key = None
34
-
35
- if not api_key:
36
- api_key = os.environ.get("RYZENTH_API_KEY")
37
-
38
- if not api_key:
39
- api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if is_ok else None
40
-
41
- self.api_key = api_key
42
- self.aio = RyzenthXAsync(api_key)
43
- self._sync = RyzenthXSync(api_key)
44
-
45
- def something(self):
46
- pass
47
-
48
- class UrHellFrom:
49
- def __init__(self, name: str, only_author=False):
50
- self.decorators = Decorators(ApiKeyFrom)
51
- self.ai = self.decorators.send_ai(name=name, only_author=only_author)
52
-
53
- def something(self):
54
- pass
55
-
56
- class SmallConvertDot:
57
- def __init__(self, obj):
58
- self.obj = obj
59
-
60
- def to_dot(self):
61
- return Box(self.obj if self.obj is not None else {})
File without changes
File without changes
File without changes
File without changes