Skip to main content

Official Python SDK for the Langbly translation API

Project description

langbly-python

Official Python SDK for the Langbly translation API — a drop-in replacement for Google Translate v2.

Installation

pip install langbly

Quick Start

from langbly import Langbly

client = Langbly(api_key="your-api-key")

# Translate text
result = client.translate("Hello world", target="nl")
print(result.text)  # "Hallo wereld"

# Batch translate
results = client.translate(["Hello", "Goodbye"], target="nl")
for r in results:
    print(r.text)

# Detect language
detection = client.detect("Bonjour le monde")
print(detection.language)  # "fr"

Google Translate Migration

If you're using google-cloud-translate, switching is simple:

# Before (Google)
from google.cloud import translate_v2 as translate
client = translate.Client()
result = client.translate("Hello", target_language="nl")

# After (Langbly)
from langbly import Langbly
client = Langbly(api_key="your-key")
result = client.translate("Hello", target="nl")

API Reference

Langbly(api_key, base_url=None)

Create a client instance.

  • api_key (str): Your Langbly API key
  • base_url (str, optional): Override the API URL (default: https://api.langbly.com)

client.translate(text, target, source=None, format=None)

Translate text.

  • text (str | list[str]): Text(s) to translate
  • target (str): Target language code (e.g., "nl", "de", "fr")
  • source (str, optional): Source language code (auto-detected if omitted)
  • format (str, optional): "text" or "html"

client.detect(text)

Detect the language of text.

  • text (str): Text to analyze

client.languages(target=None)

List supported languages.

  • target (str, optional): Language code to return names in

License

MIT

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

langbly-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

langbly-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file langbly-0.1.0.tar.gz.

File metadata

  • Download URL: langbly-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langbly-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6fcdfa3ff2abc265207470e9a76398af4f71fdcf6dc6be19434951b5c82dc99
MD5 348f49cc926f9b8e09dacefbeeca7233
BLAKE2b-256 eded0f8253fe71ac95b7f88100574eb5f99ff1befa1f6f845cd4e8935fd35d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for langbly-0.1.0.tar.gz:

Publisher: publish.yml on Langbly/langbly-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langbly-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: langbly-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langbly-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 922a887a161ac6367d7d4934e3e2f908d40829b2301a308ab8def493f7129b5e
MD5 5eaaa5e21d59af09758d21d4947a2921
BLAKE2b-256 200381eeedca162a69d012b257f9ed25a2dff446f9cd481d94a3d5194ab18ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for langbly-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Langbly/langbly-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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