Skip to main content

inksong (Python SDK)

Official Inksong SDK for Python. Talks to the Inksong REST API at api.inksong.app.

Status: Source ships with each Inksong release. The first PyPI publish is a maintainer task — until then, install from the repo (pip install <path/to/sdks/inksong-python>).

Install

# Once published to PyPI:
pip install inksong

# Today, from the repo:
pip install ./sdks/inksong-python

Requires Python 3.10+.

Usage

from inksong import InksongClient

with InksongClient(api_key="ink_...") as client:
    out = client.humanize_text(
        "Your AI-generated draft here",
        tone="balanced",
        humanness_level=50,
    )
    print(out["humanized_text"])

    for doc in client.list_documents(limit=10):
        print(doc["job_id"], doc["status"])

InksongClient is a context manager — __exit__ closes the underlying httpx.Client. You can also call client.close() explicitly.

Webhook signature verification

If you subscribe to webhooks at /dashboard/webhooks, every delivery is signed with HMAC-SHA256. Verify with:

from inksong import verify_signature

raw_body = request.body  # bytes or str — both work
header = request.headers["Webhook-Signature"]

if not verify_signature(WEBHOOK_SECRET, raw_body, header):
    return Response(status_code=400)

verify_signature rejects timestamps older than 5 minutes by default; pass max_age_seconds to change that.

Errors

The client raises InksongError on non-2xx responses. err.status_code is the HTTP status; err.body is the response text.

from inksong import InksongError

try:
    client.humanize_text("...")
except InksongError as err:
    if err.status_code == 429:
        # back off
        ...
    raise

Publish (maintainer)

# 1. Bump version in pyproject.toml
# 2. Build
python -m pip install build twine
python -m build
# 3. Verify
twine check dist/*
# 4. Upload
twine upload dist/*

License

MIT

Metadata

Release files for inksong 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inksong 0.1.0
File Size Uploaded Provenance Actions
inksong-0.1.0.tar.gz 4.5 kB Without provenance Details for inksong-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inksong 0.1.0
File Interpreter ABI Platform Actions
inksong-0.1.0-py3-none-any.whl Python 3 none any Details for inksong-0.1.0-py3-none-any.whl

Total release size: 9.1 kB

Release files / inksong-0.1.0.tar.gz

Download URL inksong-0.1.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
16e5287ce535cb8dfef06b8169e6b19c01254d66894aa8db618fa2f3c4541634
BLAKE2b-256 checksum
How to use checksums
d1a9f7d7c0bd7cbad21377bd79fd5cdc9c92a6a088fbbd6e015c94ddfd8e3a07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / inksong-0.1.0-py3-none-any.whl

Download URL inksong-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77242ecca9ec2bcb73339bb200040dba5edc83ab06f6738b1333e9ed576ea8e1
BLAKE2b-256 checksum
How to use checksums
23fdbbd39b4f1b8d43783246cf2c71828d330af76852488015085b6c10080750
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for inksong 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page