Skip to main content

A simple translator package for multiple languages.

Project description

Nlator

Nlator is a simple Python package for translating text between multiple languages and detecting the language of a given text. It uses the Google Translate API for its functionality.

Installation

You can install the package using pip:

pip install nlator

Usage

Here are some examples of how to use the Nlator package:

Importing The Package

import nlator

Translating Text

To translate text from one language to another, you can use the translate method. For example, to translate "Hello" from English to Spanish:

translator = nlator.Nlator()
hello_es = translator.translate("Hello", from_lang="en", to_lang="es")
print(hello_es)  # Output: Hola

Detecting Language

You can also detect the language of a given text using the findlanguage method. For example, to detect the language of the word "ciao":

language = translator.findlanguage("ciao")
print(language)  # Output: it (Italian)

Supported Languages

The package supports a wide range of languages. You can find the list of supported languages in the https://cloud.google.com/translate/docs/languages

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

nlator-1.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

nlator-1.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file nlator-1.0.tar.gz.

File metadata

  • Download URL: nlator-1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.10

File hashes

Hashes for nlator-1.0.tar.gz
Algorithm Hash digest
SHA256 8b4510c3660987d4dda95b43bda10dfb378228efe1d088ebdb7933a383f62bd6
MD5 bb53f18d6eed4c16e36db8416e06aa49
BLAKE2b-256 66dc5224b19fa85438edf9223820b3c70c54d835fb7bba31a02e31ccf7e0fcd7

See more details on using hashes here.

File details

Details for the file nlator-1.0-py3-none-any.whl.

File metadata

  • Download URL: nlator-1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.10

File hashes

Hashes for nlator-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a00145302b813c4aa6892c6fd394869ab438662933a7e2a03757441968bb993
MD5 fe5215e6c0b61ddec6021e76da240b4d
BLAKE2b-256 ca6a4114a9a81944e2c6096607029632248d1b3d4d4155cba80eb89eb0e47432

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