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 keybase_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 translatetarget(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6fcdfa3ff2abc265207470e9a76398af4f71fdcf6dc6be19434951b5c82dc99
|
|
| MD5 |
348f49cc926f9b8e09dacefbeeca7233
|
|
| BLAKE2b-256 |
eded0f8253fe71ac95b7f88100574eb5f99ff1befa1f6f845cd4e8935fd35d4f
|
Provenance
The following attestation bundles were made for langbly-0.1.0.tar.gz:
Publisher:
publish.yml on Langbly/langbly-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langbly-0.1.0.tar.gz -
Subject digest:
e6fcdfa3ff2abc265207470e9a76398af4f71fdcf6dc6be19434951b5c82dc99 - Sigstore transparency entry: 941687043
- Sigstore integration time:
-
Permalink:
Langbly/langbly-python@4b3c58ecdd586899b711eb0c50989fc1060fff8c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Langbly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b3c58ecdd586899b711eb0c50989fc1060fff8c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
922a887a161ac6367d7d4934e3e2f908d40829b2301a308ab8def493f7129b5e
|
|
| MD5 |
5eaaa5e21d59af09758d21d4947a2921
|
|
| BLAKE2b-256 |
200381eeedca162a69d012b257f9ed25a2dff446f9cd481d94a3d5194ab18ce2
|
Provenance
The following attestation bundles were made for langbly-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Langbly/langbly-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langbly-0.1.0-py3-none-any.whl -
Subject digest:
922a887a161ac6367d7d4934e3e2f908d40829b2301a308ab8def493f7129b5e - Sigstore transparency entry: 941687078
- Sigstore integration time:
-
Permalink:
Langbly/langbly-python@4b3c58ecdd586899b711eb0c50989fc1060fff8c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Langbly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b3c58ecdd586899b711eb0c50989fc1060fff8c -
Trigger Event:
release
-
Statement type: