Skip to main content

Google translate api

Project description

A google translate api. To install it: pip install mygoogletrans

To use it:

import gtrans
t=gtrans.GoogleTrans()
t.translate("Hello everyone","fr")
#>'Bonjour à tous'

Other useful actions

t.translations("Hello","fr")

#> {'Bonjour!': ['Hello!',
#   'Hi!',
#   'Good morning!',
#   'Good afternoon!',
#   'How do you do?',
#   'Hallo!'],
#  'Salut!': ['Hi!', 'Hello!', 'Salute!', 'All the best!', 'Hallo!', 'Hullo!'],
#  'Tiens!': ['Hallo!', 'Hello!', 'Hullo!', 'Why!'],
#  'Allô!': ['Hello!', 'Hullo!', 'Hallo!']}

t.definitions("Hello")

#> {'Word': 'maison',
#  'Definitions': [{'gram_class': 'Substantiv',
#    'definitions': [{'definition': "Bâtiment d'habitation (immeuble, logement, résidence) ; spécialement bâtiment conçu pour un seul ou un petit nombre de foyers (pavillon, villa).",
#      'examples': ('Une maison pauvre, délabrée.',
#       "La façade, les murs, le toit d'une maison.")},
#     {'definition': "Habitation, logement (qu'il s'agisse ou non d'un bâtiment entier).",
#      'synonyms': {'': ['demeure',
#        'domicile',
#        'foyer',
#        'logis',
#        'appartement']},
#      'examples': ('Les clés de la maison.',)},
#     {'definition': "Travail, place (d'un domestique)."},
#     {'labels': ['(+ adjectif ; + de et nom)'],
#      'definition': 'Bâtiment, édifice destiné à un usage spécial.'},
#     {'definition': 'Entreprise commerciale.',
#      'synonyms': {'': ['établissement', 'firme']},
#      'examples': ('La maison mère et ses succursales.',)},
#     {'labels': ['vieux', 'au figuré'],
#      'definition': 'Famille.',
#      'examples': ('Une maison princière.',)},
#     {'labels': ['au figuré', 'Histoire'],
#      'definition': 'Ensemble des personnes employées au service des grands personnages.',
#      'examples': ('La maison du roi.',)},
#     {'labels': ['au figuré'],
# ...
#      'examples': ('Une engueulade maison.',)},
#     {'labels': ['en apposition (invariable)'],
#      'definition': 'Particulier à une entreprise.',
#      'examples': ("L'esprit maison.",)}]},
#   {'definitions': [{'examples': ('Les traditions de la maison.',)}]}]}

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

mygoogletrans-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

mygoogletrans-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file mygoogletrans-1.0.0.tar.gz.

File metadata

  • Download URL: mygoogletrans-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/21.6.0

File hashes

Hashes for mygoogletrans-1.0.0.tar.gz
Algorithm Hash digest
SHA256 46f2bc937f3e2dc21dd3a206a56c994d3da3543ed9ede2d771a0953e369950c2
MD5 40bcbb55acf63275d44291c5326dbdbc
BLAKE2b-256 a23a6c911f9a90755d175d67a1e36eb6775a8692d635987899bac5632b4a37c9

See more details on using hashes here.

File details

Details for the file mygoogletrans-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mygoogletrans-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/21.6.0

File hashes

Hashes for mygoogletrans-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a35494ce0c5c68488ac03650d493d22f6df8522bcb86fb738d58c896fc729ec
MD5 3a7b78b8cd35bf3d9cdb88b37d8e4416
BLAKE2b-256 2ea8a85cba5d17a0781428784a69ee00554df1a417ec48b958d52b7c176adb8c

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