Skip to main content

Official Python SDK for HumanizedText API

Project description

humanizedtext (Python)

Official Python SDK for the HumanizedText API.

This SDK provides a simple interface over HumanizedText authenticated SDK endpoints:

  • Humanize text with optional tone/keywords/ultra mode
  • Fix grammar
  • Rewrite content
  • Generate SEO blog drafts

Contents

  1. Requirements
  2. Installation
  3. Authentication
  4. Client Configuration
  5. API Methods
  6. Response Examples
  7. Error Handling
  8. Edge Cases and Limits
  9. Production Recommendations

Requirements

  • Python >=3.9
  • A valid HumanizedText API key

Installation

pip install humanizedtext

Authentication

The client sends your API key in X-API-Key header on each request.

import os
from humanizedtext import HumanizedTextClient

client = HumanizedTextClient(api_key=os.environ["HUMANIZEDTEXT_API_KEY"])

Client Configuration

from humanizedtext import HumanizedTextClient

client = HumanizedTextClient(
    api_key="YOUR_API_KEY",
    base_url="https://api.humanizedtext.pro/api/v1",
    timeout=60,
)
Argument Type Required Default Description
api_key str Yes - HumanizedText API key
base_url str No https://api.humanizedtext.pro/api/v1 API base URL
timeout int No 60 Request timeout in seconds

API Methods

1) humanize(text, tone=None, ultra_humanize=False, keywords=None)

Humanizes text with optional tone and keyword assistance.

response = client.humanize(
    text="Your AI-like draft",
    tone="professional",
    ultra_humanize=False,
    keywords=["SaaS", "conversion"],
)
Parameter Type Required Default Notes
text str Yes - Must be 1..6000 chars
tone Optional[str] No None Example: professional, casual, friendly, default
ultra_humanize bool No False Consumes ultra quota when True
keywords Optional[List[str]] No None Plan-limited keyword count per request

2) grammar_fixer(text)

Fixes grammar while preserving message.

response = client.grammar_fixer("this are a sentence.")
Parameter Type Required Notes
text str Yes Must be 1..6000 chars

3) content_rewriter(text)

Rewrites content to improve readability/originality.

response = client.content_rewriter("Original paragraph here")
Parameter Type Required Notes
text str Yes Must be 1..6000 chars

4) seo_blog_writer(topic)

Generates SEO-focused article content from a topic.

response = client.seo_blog_writer("Best CRM tools for startups")
Parameter Type Required Notes
topic str Yes Must be 1..500 chars

Response Examples

The SDK returns parsed JSON (dict) from API.

Humanize response

{
    "original_text": "Your original text",
    "humanized_text": "Humanized output text",
    "tone_applied": "professional",
    "ultra_humanize_used": False,
    "keywords_used": ["SaaS", "conversion"],
    "created_at": "2026-04-12T15:20:11.891000+00:00"
}

Grammar fixer response

{
    "original_text": "this are a sentence.",
    "corrected_text": "This is a sentence.",
    "created_at": "2026-04-12T15:21:17.003000+00:00"
}

Content rewriter response

{
    "original_text": "Old copy here",
    "rewritten_text": "Rewritten copy here",
    "created_at": "2026-04-12T15:22:40.221000+00:00"
}

SEO blog writer response

{
    "topic": "Best CRM tools for startups",
    "blog_content": "# Best CRM tools for startups\n...",
    "created_at": "2026-04-12T15:23:35.552000+00:00"
}

Error Handling

HTTP failures raise HumanizedTextAPIError.

from humanizedtext import HumanizedTextClient
from humanizedtext_sdk.exceptions import HumanizedTextAPIError

client = HumanizedTextClient(api_key="YOUR_API_KEY")

try:
    client.humanize(text="")
except HumanizedTextAPIError as exc:
    print("status:", exc.status_code)
    print("payload:", exc.payload)
    print("message:", str(exc))

HumanizedTextAPIError fields:

Field Type Description
status_code int | None HTTP status code
payload Any Parsed response body or fallback text payload
message str Human-readable error detail

Edge Cases and Limits

Validation failures (400)

  • Empty text/topic
  • text over 6000 chars
  • topic over 500 chars
  • Too many keywords for your plan

Possible keyword-limit error shape:

{
    "message": "Keyword limit exceeded",
    "max_keywords_allowed": 1,
    "keywords_provided": 3,
    "upgrade_required": True
}

Auth failures (401)

  • Missing/invalid API key

Character limit exceeded (402)

Possible error detail object:

{
    "message": "SDK character limit exceeded for current period",
    "plan": "free",
    "characters_needed": 1200,
    "remaining_characters": 0,
    "period_resets_at": "2026-04-30T00:00:00+00:00"
}

Rate/ultra limits (429)

  • Too many requests
  • Ultra humanize quota exceeded for current period

Processing errors (500)

  • Upstream generation failure
  • Temporary backend processing issue

Production Recommendations

  • Keep API keys in environment variables.
  • Add retry/backoff for transient 5xx and network errors.
  • Log status_code and payload from exceptions for diagnostics.
  • Validate payload size before request to prevent avoidable 400 errors.

Legacy Import Compatibility

Primary import:

from humanizedtext import HumanizedTextClient

Backward-compatible module also exists:

from humanizedtext_sdk import HumanizedTextClient

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

humanizedtext-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

humanizedtext-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file humanizedtext-0.1.1.tar.gz.

File metadata

  • Download URL: humanizedtext-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for humanizedtext-0.1.1.tar.gz
Algorithm Hash digest
SHA256 82b3d233816e909b938fc271a6119dcf881a7ffc173f7d5fa9d677a7117fd13c
MD5 b707a307b6df6e7d0d53e0c9dd5561c9
BLAKE2b-256 d7becb871d31d14c51f37c544b05acbee86a542c34563d73679c2d3aa5470fdc

See more details on using hashes here.

File details

Details for the file humanizedtext-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: humanizedtext-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for humanizedtext-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b85118ea141cadf61a55131448e15c7c447f6a6b1645b89a32fc702ccd930aa3
MD5 aeedb5f6e79827302c4a898393cef781
BLAKE2b-256 732f6b8fdcf89c26824f544e408022212c21b03ed7cee68506349f0d44c32373

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page