Skip to main content

Portable EN<->PT-BR translation library with baked-in models and PT-BR postprocessing

Project description

fast-translate

Biblioteca Python portátil para tradução offline:

  • en -> pt-BR
  • pt -> en

Inclui:

  • Modelos baked-in no pacote (en-pt-tiny e pt-en-tiny)
  • Pós-processamento focado em pt-BR (corrige traços pt-PT)
  • Runtime nativo com translateLocally via Native Messaging (-p)
  • Fallback cross-platform: binário empacotado, PATH ou auto-download do GitHub Releases

Instalação

pip install fast-translate

Uso rápido

from fast_translate import Translator

tr = Translator()
print(tr.translate("How are you today?", direction="en-pt"))
print(tr.translate("Como você está hoje?", direction="pt-en"))
tr.close()

Variáveis de ambiente

  • TLPTBR_BINARY: caminho explícito do executável translateLocally
  • TLPTBR_CACHE_SIZE: tamanho do cache LRU (default 64)
  • TLPTBR_CACHE_MAX_ENTRY_CHARS: tamanho máximo por item de cache (default 512)
  • TLPTBR_TRIM_EVERY_N_CALLS: frequência de malloc_trim (default 8)
  • TLPTBR_KEEP_WARM_INTERVAL_S: intervalo de warmup (default 300)
  • TLPTBR_AUTO_DOWNLOAD: 1/0 para auto-download de binário (default 1)
  • TLPTBR_VERBOSE: 1 para logs detalhados de resolução/download/bootstrap (default 0)
  • TLPTBR_FORCE_CLI: 1 para forçar fallback CLI (útil para ambientes macOS com instabilidade em -p)

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

fast_translate-0.1.14.tar.gz (43.7 MB view details)

Uploaded Source

Built Distribution

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

fast_translate-0.1.14-py3-none-any.whl (44.0 MB view details)

Uploaded Python 3

File details

Details for the file fast_translate-0.1.14.tar.gz.

File metadata

  • Download URL: fast_translate-0.1.14.tar.gz
  • Upload date:
  • Size: 43.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fast_translate-0.1.14.tar.gz
Algorithm Hash digest
SHA256 28fab14776b0f619fee061b926b8974f8790b050d5ae72848363897f69ac8ae1
MD5 a569c7ebaa28bf317b9d79b98568eca4
BLAKE2b-256 d07680c4c112aa49eb831c137f684720168d127000958cc06dc6b068b9fa5be0

See more details on using hashes here.

File details

Details for the file fast_translate-0.1.14-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_translate-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 43cfdec1de0a0217d3bdc9ba8c1eca5e82a3b5ec3166b8a7e4159af130d0659c
MD5 d6d0cf52defa6c9f6b8a0a84e270df2e
BLAKE2b-256 2bcf02c8a0dfebb75123ada7a7f6aa3cd5d93bdcee5484eed36fc8d461c2f498

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