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://humanizedtext.pro/api/v1",
    timeout=60,
)
Argument Type Required Default Description
api_key str Yes - HumanizedText API key
base_url str No https://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.3.tar.gz (4.7 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.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: humanizedtext-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 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.3.tar.gz
Algorithm Hash digest
SHA256 4e95ce154b12bbc3ccc5400ec45922f22b1310aa1efc2667748a34925669295d
MD5 77516fd21865ac9f138ca6a16a7a160d
BLAKE2b-256 44f5b4fb75eb919cfcfbb0c403ec022b471f4fd9c8dc13ef39e654a94116c473

See more details on using hashes here.

File details

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

File metadata

  • Download URL: humanizedtext-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e542749a32118d154adc11278bc006f14bf067c3b45f4353fc7c1a850706fc0e
MD5 d7842efb3cd9b1b83da46f26be53a2e7
BLAKE2b-256 a3e522cbdafd3e70f0bf5e482644fee5787b3598e22dbd0d34f88be59adbb475

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