Skip to main content

Sapling Python Client

Project description

Sapling Python Client

Python wrapper for the Sapling.ai API.

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

Functionality

Sapling is an AI messaging assistant. The API currently offers spelling and grammar checking endpoints.

Benefits include:

  • 60% more grammar corrections: compared to other systems at similar accuracy using state-of-the-art machine learning systems for natural language processing.
  • Low Latency: Achieve the same real-time performance that users of Sapling's own interface experience.
  • Over 20 error types: Error categories such as preposition, noun form, and verb tense, including both high-level and fine-grained error information.
  • Custom Models: Get corrections and edits tuned to the domain of your text—for example academic writing vs. subtitles.
  • Enterprise Security: Ask us about our no data retention policies, self-hosted/on-premises deployment options, and other cybersecurity policies and procedures.
  • Rich Text Editor Support: TinyMCE, CKEditor, QuillJS, Trix, ProseMirror, WordPress, Draft.js, Froala, Lexical and others. Consider using Sapling's JavaScript SDK for displaying the API's outputs on webpage editors.

Installation

Install the sapling-py package with pip

python -m pip install 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.

License

Copyright 2022 Sapling Intelligence, Inc.

Licensed under the Apache License, Version 2.0.

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

sapling_py-4.0.2.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file sapling_py-4.0.2.tar.gz.

File metadata

  • Download URL: sapling_py-4.0.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for sapling_py-4.0.2.tar.gz
Algorithm Hash digest
SHA256 04c52699f1bd9340da801a67b02bc5b02ac4752f3fc12a8a6d86a193a7771102
MD5 854357e21120f78d3bef02c158798762
BLAKE2b-256 e243b30257f535bb7c9401d35433f8ffcb8a68254a030ea53960fa1d63fbd2ae

See more details on using hashes here.

Supported by

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