skillfed

libretranslatepy

Python bindings for LibreTranslate API

libretranslatepy v2.1.4 414.4K downloads/30d#6,834 on PyPI131
Permissive license AGING released

What it is and what it does

LibreTranslate-py is a lightweight Python wrapper around the LibreTranslate API, a free and open-source translation service. It handles the HTTP communication with a LibreTranslate endpoint and exposes three main operations: translating text between language pairs, detecting the language of input text, and retrieving the list of supported languages. The package uses only Python standard library (urllib and json), so it has zero runtime dependencies and installs quickly.

You point it at a LibreTranslate endpoint—either a public mirror or a self-hosted instance—and call methods to translate, detect, or list languages. It's useful when you want programmatic access to LibreTranslate without building HTTP requests manually. The package is stable and permissively licensed, but has not been updated in over 850 days, so compatibility with the latest LibreTranslate API versions should be verified before relying on it in production.

Use it for:

  • Translate user-submitted text in a web application by calling a LibreTranslate mirror without managing HTTP requests directly.
  • Detect the language of incoming messages to route them to language-specific processing pipelines.
  • Query available languages from a LibreTranslate endpoint to populate UI dropdowns or validate language codes.
  • Build a simple CLI tool that wraps LibreTranslate for batch text translation tasks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python client library for the LibreTranslate API that provides text translation, language detection, and language listing across multiple translation backends.

Yes, if you are already using LibreTranslate and want a simple Python client. The package is permissively licensed, has no dependencies, and installs cleanly. However, verify that it works with your target LibreTranslate version before production use, given the 850-day gap since the last release. For new projects, consider whether calling the LibreTranslate API directly via requests or urllib is simpler than adding a dependency.

Install

libretranslatepy on PyPI

pip

pip install libretranslatepy

uv

uv add libretranslatepy

poetry

poetry add libretranslatepy

Installing libretranslatepy

Before you install

Low friction install with no runtime dependencies. Last release was in April 2024 and the repository remains active, though the package is aging—no updates in over 850 days.

License in practice

Licensed under MIT or Public Domain (permissive), so you can use it freely in commercial or private projects with minimal attribution requirements.

Quickstart

pip install libretranslatepy

from libretranslatepy import LibreTranslateAPI

lt = LibreTranslateAPI("https://libretranslate.com/")
print(lt.translate("Hello", "en", "es"))
print(lt.detect("Hello"))
print(lt.languages())

Requires a running LibreTranslate API endpoint (either self-hosted or a public mirror); the package itself is a client library and does not provide translation services.

Verify before relying

  • Whether the package works reliably with current LibreTranslate API versions given the 850-day gap since last release.
  • Support status for Python 2 (listed in classifiers but likely obsolete given modern Python ecosystem).

Package facts

License not declared (permissive)
Python support supports the current Python release (>=2.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 850 days since the last release
Last repo commit
First released
Downloads 414,381/month — #6,834 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: libretranslatepy-2.1.4-py3-none-any.whl

Keywords: translation, libretranslate

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator

Tags

libretranslate python clienttranslation api wrapperlanguage detection pythontext translation librarymultilingual translationlibretranslate bindings
translation-apilanguage-detection

More Interface Engine/Protocol Translator packages