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.1.tar.gz (12.5 kB view hashes)

Uploaded Source

Supported by

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