Ryzenth 1.9.0__py3-none-any.whl → 1.9.2__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.
Ryzenth/__version__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.9.0"
1
+ __version__ = "1.9.2"
2
2
  __author__ = "TeamKillerX"
3
3
  __title__ = "Ryzenth"
4
4
  __description__ = "Ryzenth Python API Wrapper"
Ryzenth/_errors.py CHANGED
@@ -1,10 +1,44 @@
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 json
21
+
22
+
1
23
  class WhatFuckError(Exception):
2
24
  pass
3
25
 
4
- class ErrorParamsRequired(ValueError):
26
+ class ParamsRequiredError(ValueError):
27
+ pass
28
+
29
+ class InvalidVersionError(ValueError):
30
+ pass
31
+
32
+ class InvalidJSONDecodeError(json.decoder.JSONDecodeError):
33
+ pass
34
+
35
+ class InvalidEmptyError(ValueError):
5
36
  pass
6
37
 
7
38
  __all__ = [
8
39
  "WhatFuckError",
9
- "ErrorParamsRequired"
40
+ "ParamsRequiredError",
41
+ "InvalidVersionError",
42
+ "InvalidJSONDecodeError",
43
+ "InvalidEmptyError"
10
44
  ]
Ryzenth/helper/_fonts.py CHANGED
@@ -23,7 +23,7 @@ from datetime import datetime as dt
23
23
 
24
24
  import httpx
25
25
 
26
- from Ryzenth._errors import ErrorParamsRequired, WhatFuckError
26
+ from Ryzenth._errors import ParamsRequiredError, WhatFuckError
27
27
 
28
28
  LOGS = logging.getLogger("[Ryzenth]")
29
29
 
@@ -33,17 +33,19 @@ class FontsAsync:
33
33
 
34
34
  async def scanning(
35
35
  self,
36
- text: str = None,
36
+ text: str = "𝖍𝖊𝖑𝖑𝖔 𝖘𝖎𝖒𝖇𝖔𝖑",
37
+ use_parent_params_dict=False,
37
38
  dot_access=False
38
39
  ):
39
40
  url = f"{self.parent.base_url}/v1/fonts-stylish/detected"
40
41
  if not text:
41
- raise ErrorParamsRequired("Invalid Params Text")
42
+ raise ParamsRequiredError("Invalid Params Text")
43
+ _params = self.parent.params if use_parent_params_dict else {"query": text}
42
44
  async with httpx.AsyncClient() as client:
43
45
  try:
44
46
  response = await client.get(
45
47
  url,
46
- params={"query": text},
48
+ params=_params,
47
49
  headers=self.parent.headers,
48
50
  timeout=self.parent.timeout
49
51
  )
@@ -59,16 +61,18 @@ class FontsSync:
59
61
 
60
62
  def scanning(
61
63
  self,
62
- text: str = None,
64
+ text: str = "𝖍𝖊𝖑𝖑𝖔 𝖘𝖎𝖒𝖇𝖔𝖑",
65
+ use_parent_params_dict=False,
63
66
  dot_access=False
64
67
  ):
65
68
  url = f"{self.parent.base_url}/v1/fonts-stylish/detected"
66
69
  if not text:
67
- raise ErrorParamsRequired("Invalid Params Text")
70
+ raise ParamsRequiredError("Invalid Params Text")
71
+ _params = self.parent.params if use_parent_params_dict else {"query": text}
68
72
  try:
69
73
  response = httpx.get(
70
74
  url,
71
- params={"query": text},
75
+ params=_params,
72
76
  headers=self.parent.headers,
73
77
  timeout=self.parent.timeout
74
78
  )
@@ -23,7 +23,7 @@ from datetime import datetime as dt
23
23
 
24
24
  import httpx
25
25
 
26
- from Ryzenth._errors import WhatFuckError
26
+ from Ryzenth._errors import InvalidEmptyError, InvalidVersionError, WhatFuckError
27
27
 
28
28
  LOGS = logging.getLogger("[Ryzenth]")
29
29
 
@@ -31,12 +31,41 @@ class ModeratorAsync:
31
31
  def __init__(self, parent):
32
32
  self.parent = parent
33
33
 
34
+ async def aigen_image_check(
35
+ self,
36
+ text: str,
37
+ version: str = "v2",
38
+ is_loads: bool = False,
39
+ dot_access: bool = False
40
+ ):
41
+ version_params = {
42
+ "v1": "v1",
43
+ "v2": "v2"
44
+ }
45
+ _version = version_params.get(version)
46
+ if not _version:
47
+ raise InvalidVersionError("Invalid Version V1 or V2")
48
+
49
+ url = f"{self.parent.base_url}/v1/ai/akenox/aigen-{_version}"
50
+ async with httpx.AsyncClient() as client:
51
+ try:
52
+ response = await client.get(
53
+ url,
54
+ params={"query": text, "isJson": is_loads},
55
+ headers=self.parent.headers,
56
+ timeout=self.parent.timeout
57
+ )
58
+ response.raise_for_status()
59
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
60
+ except httpx.HTTPError as e:
61
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
62
+ raise WhatFuckError("[ASYNC] Error fetching") from e
63
+
34
64
  async def antievalai(
35
65
  self,
36
- query: str,
37
- version: str,
38
- to_dict_by_loads=False,
39
- dot_access=False
66
+ text: str,
67
+ version: str = "v2",
68
+ dot_access: bool = False
40
69
  ):
41
70
  version_params = {
42
71
  "v1": "v1",
@@ -44,33 +73,18 @@ class ModeratorAsync:
44
73
  }
45
74
  _version = version_params.get(version)
46
75
  if not _version:
47
- raise ValueError("Invalid Version Name")
76
+ raise InvalidVersionError("Invalid Version V1 or V2")
48
77
 
49
78
  url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
50
79
  async with httpx.AsyncClient() as client:
51
80
  try:
52
81
  response = await client.get(
53
82
  url,
54
- params={"query": query},
83
+ params={"query": text},
55
84
  headers=self.parent.headers,
56
85
  timeout=self.parent.timeout
57
86
  )
58
87
  response.raise_for_status()
59
- if to_dict_by_loads:
60
- try:
61
- return {
62
- "author": "TeamKillerX",
63
- f"timestamps": dt.now(),
64
- f"is_detect": json.loads(response.json()["results"])["is_detect"],
65
- "source": "Powered by Ryzenth API"
66
- }
67
- except json.decoder.JSONDecodeError:
68
- return {
69
- "author": "TeamKillerX",
70
- f"timestamps": dt.now(),
71
- f"is_detect": False,
72
- "source": "Powered by Ryzenth API"
73
- }
74
88
  return self.parent.obj(response.json() or {}) if dot_access else response.json()
75
89
  except httpx.HTTPError as e:
76
90
  LOGS.error(f"[ASYNC] Error: {str(e)}")
@@ -80,12 +94,40 @@ class ModeratorSync:
80
94
  def __init__(self, parent):
81
95
  self.parent = parent
82
96
 
97
+ def aigen_image_check(
98
+ self,
99
+ text: str,
100
+ version: str = "v2",
101
+ is_loads: bool = False,
102
+ dot_access: bool = False
103
+ ):
104
+ version_params = {
105
+ "v1": "v1",
106
+ "v2": "v2"
107
+ }
108
+ _version = version_params.get(version)
109
+ if not _version:
110
+ raise InvalidVersionError("Invalid Version V1 or V2")
111
+
112
+ url = f"{self.parent.base_url}/v1/ai/akenox/aigen-{_version}"
113
+ try:
114
+ response = httpx.get(
115
+ url,
116
+ params={"query": text, "isJson": is_loads},
117
+ headers=self.parent.headers,
118
+ timeout=self.parent.timeout
119
+ )
120
+ response.raise_for_status()
121
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
122
+ except httpx.HTTPError as e:
123
+ LOGS.error(f"[SYNC] Error fetching from aigen_image_check {e}")
124
+ raise WhatFuckError("[SYNC] Error fetching from aigen_image_check") from e
125
+
83
126
  def antievalai(
84
127
  self,
85
- query: str,
86
- version: str,
87
- to_dict_by_loads=False,
88
- dot_access=False
128
+ text: str,
129
+ version: str = "v2",
130
+ dot_access: bool = False
89
131
  ):
90
132
  version_params = {
91
133
  "v1": "v1",
@@ -93,32 +135,17 @@ class ModeratorSync:
93
135
  }
94
136
  _version = version_params.get(version)
95
137
  if not _version:
96
- raise ValueError("Invalid Version Name")
138
+ raise InvalidVersionError("Invalid Version V1 or V2")
97
139
 
98
140
  url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
99
141
  try:
100
142
  response = httpx.get(
101
143
  url,
102
- params={"query": query},
144
+ params={"query": text},
103
145
  headers=self.parent.headers,
104
146
  timeout=self.parent.timeout
105
147
  )
106
148
  response.raise_for_status()
107
- if to_dict_by_loads:
108
- try:
109
- return {
110
- "author": "TeamKillerX",
111
- f"timestamps": dt.now(),
112
- f"is_detect": json.loads(response.json()["results"])["is_detect"],
113
- "source": "Powered by Ryzenth API"
114
- }
115
- except json.decoder.JSONDecodeError:
116
- return {
117
- "author": "TeamKillerX",
118
- f"timestamps": dt.now(),
119
- f"is_detect": False,
120
- "source": "Powered by Ryzenth API"
121
- }
122
149
  return self.parent.obj(response.json() or {}) if dot_access else response.json()
123
150
  except httpx.HTTPError as e:
124
151
  LOGS.error(f"[SYNC] Error fetching from antievalai {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 1.9.0
3
+ Version: 1.9.2
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -1,19 +1,19 @@
1
1
  Ryzenth/__init__.py,sha256=CKayGQJ_ZUZF6OHyL9kCdTah05BUikXKWKXL_raAgo8,937
2
- Ryzenth/__version__.py,sha256=twdc5C08GfAEZJ_2vw8Vu9ivAX2v2en0u5F_RcOWe_w,118
2
+ Ryzenth/__version__.py,sha256=ffg5vyeznzjRb1MfQJLgPpJbOmE5CcUnTlYpJvKivpM,118
3
3
  Ryzenth/_asynchisded.py,sha256=ZNLp1rOJ_4SYcyMeB02ybsSmU38GO0TpHsQHRiR2w6c,4909
4
4
  Ryzenth/_client.py,sha256=Y-I1ug8Hf2eF74oDY4eICOTP_nuLXdsDSkyZhpdqZy4,1475
5
- Ryzenth/_errors.py,sha256=_ViAlLpyKIEM5b2NQHNw8ftAvm80g7Rrv1QHWNAQ5LI,152
5
+ Ryzenth/_errors.py,sha256=PYHmA3xZPZnH8T1Yo0Al6ln2FP8KC9Jk3eN631ve2S4,1236
6
6
  Ryzenth/_synchisded.py,sha256=KFO3Smy3qKhOPW9cVQ6uutspDZjiZz79hiLaXFgGRfA,4702
7
7
  Ryzenth/helper/__init__.py,sha256=ANx8vCXJ9ReLXIDWUwyhrIbw7jIyUXMdP11qotrWWIE,1308
8
8
  Ryzenth/helper/_federation.py,sha256=VM1mkuPj4SvlO-VcazIV0T5Ga56RdcpDo7qybXwFCow,13946
9
- Ryzenth/helper/_fonts.py,sha256=jrZ_wTZiXuN8AbqrT8bqc09naEkEJqQ8AdA16e_rqlk,2767
9
+ Ryzenth/helper/_fonts.py,sha256=vQik0pGeKQGvUYhOfMO0W7MFM6Ig1oi-e_nBW_b6TuA,3081
10
10
  Ryzenth/helper/_images.py,sha256=AfNQoxae-yI76PDUa-jx7tWBlJa4tRZQFDjeqBLKwVM,2309
11
- Ryzenth/helper/_moderator.py,sha256=BCZ97DntbMaPmKKWZOPf0W9GjcxzwM2y1N9PqgRPT2w,4518
11
+ Ryzenth/helper/_moderator.py,sha256=GTHTM8klfNrclhQM_gC0FHPLVmLj3n7NviOIX9Tr9bs,5270
12
12
  Ryzenth/helper/_openai.py,sha256=hUhmwxuKV-AAeEbDFm4RnkasHNJjFROLdw1q2j2t_Mc,2574
13
13
  Ryzenth/helper/_thinking.py,sha256=BKHvQe16KPOGh7_vev-_Ed8jl6_77_8Ys-g0SDtvlSU,2557
14
14
  Ryzenth/types/__init__.py,sha256=3eEOjoRcEPoE5J5oIhXEPH6vbYG7TLasTHFcbWGS-mU,1095
15
- ryzenth-1.9.0.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
16
- ryzenth-1.9.0.dist-info/METADATA,sha256=01OPOveR6quHQidtFmdMvKCX-V2Ii0vFOM-Z8MvpZWU,4181
17
- ryzenth-1.9.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
18
- ryzenth-1.9.0.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
19
- ryzenth-1.9.0.dist-info/RECORD,,
15
+ ryzenth-1.9.2.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
16
+ ryzenth-1.9.2.dist-info/METADATA,sha256=SH8DKw3TLkG_J1R4a533-vsBshXpGAEq8AxYqqt4thY,4181
17
+ ryzenth-1.9.2.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
18
+ ryzenth-1.9.2.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
19
+ ryzenth-1.9.2.dist-info/RECORD,,