Skip to main content

Sapling Python Client

Python SDK wrapper for the Sapling.ai API.

Try our grammar check demo. Compare against leading grammar checking tools and APIs like Grammarly (Grammerly), LanguageTool, ProWritingAid and Ginger.

Overview

Sapling is a toolkit for helping developers build language model-powered applications. The API provides spelling and grammar checking, autocomplete, tone detection, rephrasing, AI detection, zero-shot text classification, structured data extraction, translation, PII detection and redaction, content safety scoring, plain-language simplification, SEO analysis, and more.

Key Features:

  • 60% More Corrections: Outperforms competing solutions at similar accuracy levels using state-of-the-art generative AI models.
  • Real-Time Performance: Experience the same low-latency corrections as Sapling's native integrations.
  • Comprehensive Error Detection: Identifies over 20 error types including prepositions, noun forms, verb tense, with both high-level and fine-grained error information.
  • Domain-Specific Models: Get corrections optimized for your content type, from academic writing, to doctors notes, to user-generated reviews.
  • Enterprise-Grade Security: Features include no data retention policies, self-hosted/on-premises deployment options, and enterprise-grade security policies and procedures.
  • Rich Text Editor Integration: Supports TinyMCE, CKEditor, QuillJS, Trix, ProseMirror, WordPress, Draft.js, Froala, Lexical and more. For web-based editors, consider using our JavaScript SDK for display UI components.

Installation

Install the sapling-py package from PyPI with pip:

python -m pip install sapling-py

Or add it to a uv project:

uv add sapling-py

Documentation

Documentation for the client is available at Read the Docs and documentation for the HTTP API is available at Sapling.ai.

Quickstart

  • Register for an account at Sapling.ai.
  • After registering and signing in, generate a development API key in your dashboard.
  • Install the Python client by following the installation steps above.
from sapling import SaplingClient

API_KEY = '<YOUR_API_KEY>'
client = SaplingClient(api_key=API_KEY)
edits = client.edits('Lets get started!', session_id='test_session')

The result should be an array of edits of this form:

[{
  "id": "aa5ee291-a073-5146-8ebc-c9c899d01278",
  "sentence": "Lets get started!",
  "sentence_start": 0,
  "start": 0,
  "end": 4,
  "replacement": "Let's",
  "error_type": "R:OTHER",
  "general_error_type": "Other",
}]

Get a production key by following this documentation.

Here's some more information on request options and response structure.

Batch requests

The analysis endpoints — classify, extract, safety, langdetect, translate, summarize, quality and aidetect — also accept a list of 1-10 texts in place of a single string. The batch is sent as one request (the same options apply to every item) and returns {'results': [...]} with one single-response-shaped dict per input, in order:

scores = client.quality(['First draft.', 'Second draft.'], sentence_scores=True)
langs = client.langdetect(['Bonjour le monde', 'Hello world'])

License

Copyright 2024--present Sapling Intelligence, Inc.

Licensed under the Apache License, Version 2.0.

Metadata

Release files for sapling-py 4.11.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 sapling-py 4.11.0
File Size Uploaded Provenance
sapling_py-4.11.0.tar.gz 30.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sapling-py 4.11.0
File Interpreter ABI Platform
sapling_py-4.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.7 kB

Release files / sapling_py-4.11.0.tar.gz

Download URL sapling_py-4.11.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
35e41c4176a6b3e64380325e8cc2e11a429171610e524e3813ea3d7836d69d16
BLAKE2b-256 checksum
How to use checksums
0d47ac12190abe1965ee7a94991ceba0a973c7d936a6ef4659c6b4b3a2a927be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / sapling_py-4.11.0-py3-none-any.whl

Download URL sapling_py-4.11.0-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bebfbbce3501cfff5958c72fb9b1d40cb0ec7d7da36d25154d241beacde9697
BLAKE2b-256 checksum
How to use checksums
fd282df6371cf0f26e7bc2577f43c4877edfa17a40843b1bef4bc71dfc4a7da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for sapling-py 4.11.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sapling_py-4.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

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.

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