Skip to main content

Formeler SDK for Python

Project description

Formeler SDK

First, please check the documentation (https://formeler.com/lang-id/doc/) page to familiarize yourself with the basics of the API.

Installation

Within the activated environment, use the following command to install Formeler SDK:

pip install formeler

To get started, create a new instance of Formeler and pass your API key as the first argument to the constructor. You can obtain a fresh API key from the website that includes 10M tokens of free credit. Once initialized, you can use the available Formeler methods. Currently, language detection via the LangID module is supported. Below are examples of how to use the LangID methods.

Example

from formeler import Formeler

def test_detect():
    api = Formeler("YOUR-API-KEY")
    result = api.lang_id.detect("Dies ist ein Test")
    print(result)

def main():
    test_detect()

if __name__ == "__main__":
    main()

If the API call is successful, the result variable will contain the following JSON response:

{
  "result": "success",
  "language": "de",
  "tokenCount": "4"
}

More Examples

You can find additional examples in the examples directory of this repository.

API Errors

The Formeler API may return an error in the response. You can identify these by checking the result field in the returned object. An error response will follow this structure:

{
  "result": "failed",
  "message": "unauthorized"
}

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

formeler-1.0.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

formeler-1.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file formeler-1.0.1.tar.gz.

File metadata

  • Download URL: formeler-1.0.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for formeler-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3c2c85ab04505f344bed1c17a2e8eb7e8c0e63123265250111d1ae759d77c2ae
MD5 43cc6f47e566660a2a3086b281ebce89
BLAKE2b-256 f2bbbadde8a6540fc8a781b8a3aac9083d2484cad8fff104ae6558e18ffe463f

See more details on using hashes here.

File details

Details for the file formeler-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: formeler-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for formeler-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2867c67eb43c9dfc3d353fea5b28970384a47a7ce8ca0103e847aa34012791c7
MD5 c304eade11bd611574b3fa30bb7bc9a2
BLAKE2b-256 e3a5cd19ddd9c0e52c1cec2231b180807c66a44fcf2a98bea609bdeef20c46ba

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