humanizedtext 0.1.0__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.
- humanizedtext-0.1.0/PKG-INFO +45 -0
- humanizedtext-0.1.0/README.md +35 -0
- humanizedtext-0.1.0/humanizedtext/__init__.py +3 -0
- humanizedtext-0.1.0/humanizedtext.egg-info/PKG-INFO +45 -0
- humanizedtext-0.1.0/humanizedtext.egg-info/SOURCES.txt +15 -0
- humanizedtext-0.1.0/humanizedtext.egg-info/dependency_links.txt +1 -0
- humanizedtext-0.1.0/humanizedtext.egg-info/requires.txt +1 -0
- humanizedtext-0.1.0/humanizedtext.egg-info/top_level.txt +2 -0
- humanizedtext-0.1.0/humanizedtext_sdk/__init__.py +4 -0
- humanizedtext-0.1.0/humanizedtext_sdk/client.py +68 -0
- humanizedtext-0.1.0/humanizedtext_sdk/exceptions.py +6 -0
- humanizedtext-0.1.0/pyproject.toml +24 -0
- humanizedtext-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: humanizedtext
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Python SDK for HumanizedText API
|
|
5
|
+
Author: HumanizedText
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: requests>=2.31.0
|
|
10
|
+
|
|
11
|
+
# humanizedtext (Python)
|
|
12
|
+
|
|
13
|
+
Official Python SDK for HumanizedText API.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install humanizedtext
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from humanizedtext import HumanizedTextClient
|
|
25
|
+
|
|
26
|
+
client = HumanizedTextClient(
|
|
27
|
+
api_key="YOUR_API_KEY",
|
|
28
|
+
base_url="https://api.humanizedtext.pro/api/v1",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
result = client.humanize(
|
|
32
|
+
text="This is a sample text.",
|
|
33
|
+
tone="professional",
|
|
34
|
+
ultra_humanize=True,
|
|
35
|
+
keywords=["SEO", "AI writing"],
|
|
36
|
+
)
|
|
37
|
+
print(result)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Methods
|
|
41
|
+
|
|
42
|
+
- `humanize(text, tone=None, ultra_humanize=False, keywords=None)`
|
|
43
|
+
- `grammar_fixer(text)`
|
|
44
|
+
- `content_rewriter(text)`
|
|
45
|
+
- `seo_blog_writer(topic)`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# humanizedtext (Python)
|
|
2
|
+
|
|
3
|
+
Official Python SDK for HumanizedText API.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install humanizedtext
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from humanizedtext import HumanizedTextClient
|
|
15
|
+
|
|
16
|
+
client = HumanizedTextClient(
|
|
17
|
+
api_key="YOUR_API_KEY",
|
|
18
|
+
base_url="https://api.humanizedtext.pro/api/v1",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
result = client.humanize(
|
|
22
|
+
text="This is a sample text.",
|
|
23
|
+
tone="professional",
|
|
24
|
+
ultra_humanize=True,
|
|
25
|
+
keywords=["SEO", "AI writing"],
|
|
26
|
+
)
|
|
27
|
+
print(result)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Methods
|
|
31
|
+
|
|
32
|
+
- `humanize(text, tone=None, ultra_humanize=False, keywords=None)`
|
|
33
|
+
- `grammar_fixer(text)`
|
|
34
|
+
- `content_rewriter(text)`
|
|
35
|
+
- `seo_blog_writer(topic)`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: humanizedtext
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official Python SDK for HumanizedText API
|
|
5
|
+
Author: HumanizedText
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: requests>=2.31.0
|
|
10
|
+
|
|
11
|
+
# humanizedtext (Python)
|
|
12
|
+
|
|
13
|
+
Official Python SDK for HumanizedText API.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install humanizedtext
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from humanizedtext import HumanizedTextClient
|
|
25
|
+
|
|
26
|
+
client = HumanizedTextClient(
|
|
27
|
+
api_key="YOUR_API_KEY",
|
|
28
|
+
base_url="https://api.humanizedtext.pro/api/v1",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
result = client.humanize(
|
|
32
|
+
text="This is a sample text.",
|
|
33
|
+
tone="professional",
|
|
34
|
+
ultra_humanize=True,
|
|
35
|
+
keywords=["SEO", "AI writing"],
|
|
36
|
+
)
|
|
37
|
+
print(result)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Methods
|
|
41
|
+
|
|
42
|
+
- `humanize(text, tone=None, ultra_humanize=False, keywords=None)`
|
|
43
|
+
- `grammar_fixer(text)`
|
|
44
|
+
- `content_rewriter(text)`
|
|
45
|
+
- `seo_blog_writer(topic)`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
./humanizedtext/__init__.py
|
|
4
|
+
./humanizedtext_sdk/__init__.py
|
|
5
|
+
./humanizedtext_sdk/client.py
|
|
6
|
+
./humanizedtext_sdk/exceptions.py
|
|
7
|
+
humanizedtext/__init__.py
|
|
8
|
+
humanizedtext.egg-info/PKG-INFO
|
|
9
|
+
humanizedtext.egg-info/SOURCES.txt
|
|
10
|
+
humanizedtext.egg-info/dependency_links.txt
|
|
11
|
+
humanizedtext.egg-info/requires.txt
|
|
12
|
+
humanizedtext.egg-info/top_level.txt
|
|
13
|
+
humanizedtext_sdk/__init__.py
|
|
14
|
+
humanizedtext_sdk/client.py
|
|
15
|
+
humanizedtext_sdk/exceptions.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.31.0
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
from .exceptions import HumanizedTextAPIError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class HumanizedTextClient:
|
|
11
|
+
def __init__(self, api_key: str, base_url: str = "https://api.humanizedtext.pro/api/v1", timeout: int = 60):
|
|
12
|
+
if not api_key:
|
|
13
|
+
raise ValueError("api_key is required")
|
|
14
|
+
self.api_key = api_key
|
|
15
|
+
self.base_url = base_url.rstrip("/")
|
|
16
|
+
self.timeout = timeout
|
|
17
|
+
|
|
18
|
+
def _request(self, method: str, path: str, json_body: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
|
19
|
+
url = f"{self.base_url}{path}"
|
|
20
|
+
headers = {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
"X-API-Key": self.api_key,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
response = requests.request(
|
|
26
|
+
method=method,
|
|
27
|
+
url=url,
|
|
28
|
+
json=json_body,
|
|
29
|
+
headers=headers,
|
|
30
|
+
timeout=self.timeout,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
payload = response.json()
|
|
35
|
+
except Exception:
|
|
36
|
+
payload = {"detail": response.text}
|
|
37
|
+
|
|
38
|
+
if response.status_code >= 400:
|
|
39
|
+
message = payload.get("detail", "Request failed") if isinstance(payload, dict) else "Request failed"
|
|
40
|
+
raise HumanizedTextAPIError(str(message), status_code=response.status_code, payload=payload)
|
|
41
|
+
|
|
42
|
+
return payload
|
|
43
|
+
|
|
44
|
+
def humanize(
|
|
45
|
+
self,
|
|
46
|
+
text: str,
|
|
47
|
+
tone: Optional[str] = None,
|
|
48
|
+
ultra_humanize: bool = False,
|
|
49
|
+
keywords: Optional[List[str]] = None,
|
|
50
|
+
) -> Dict[str, Any]:
|
|
51
|
+
body: Dict[str, Any] = {
|
|
52
|
+
"text": text,
|
|
53
|
+
"ultra_humanize": ultra_humanize,
|
|
54
|
+
}
|
|
55
|
+
if tone is not None:
|
|
56
|
+
body["tone"] = tone
|
|
57
|
+
if keywords is not None:
|
|
58
|
+
body["keywords"] = keywords
|
|
59
|
+
return self._request("POST", "/sdk/humanize", json_body=body)
|
|
60
|
+
|
|
61
|
+
def grammar_fixer(self, text: str) -> Dict[str, Any]:
|
|
62
|
+
return self._request("POST", "/sdk/grammar-fixer", json_body={"text": text})
|
|
63
|
+
|
|
64
|
+
def content_rewriter(self, text: str) -> Dict[str, Any]:
|
|
65
|
+
return self._request("POST", "/sdk/content-rewriter", json_body={"text": text})
|
|
66
|
+
|
|
67
|
+
def seo_blog_writer(self, topic: str) -> Dict[str, Any]:
|
|
68
|
+
return self._request("POST", "/sdk/seo-blog-writer", json_body={"topic": topic})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "humanizedtext"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Official Python SDK for HumanizedText API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"requests>=2.31.0"
|
|
13
|
+
]
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "HumanizedText" }
|
|
16
|
+
]
|
|
17
|
+
license = { text = "MIT" }
|
|
18
|
+
|
|
19
|
+
[tool.setuptools]
|
|
20
|
+
package-dir = {"" = "."}
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["."]
|
|
24
|
+
include = ["humanizedtext*", "humanizedtext_sdk*"]
|