Skip to main content

leo.org command line tool

Project description

leo-cli

leo-cli is a command line tool which can be used to translate words or phrases from several languages to german. It uses the open dictionary dict.leo.org. I wrote this because visiting their website, choosing the language, typing the word and clicking the submit button required several too many steps. I am a lazy person.

Installation

This tool requires beatiful soup, the wonderful requests library and the tabulate library.

Install leo-cli

pip install leo-cli

Update

There has been a layout change on leo.org so you might have to pip install leo-cli --upgrade

Usage:

leo -h
usage: leo [-h] [-l {en,pt,fr,de,es,ru}] [-i] [-s] [-p {all,n,v,adj}] [-d] [-v]
           words [words ...]
Retrieve word information via the Leo website
positional arguments:
  words                 the words to look up on the LEO website
optional arguments:
  -h, --help            show this help message and exit
  -l {en,pt,fr,de,es,ru}, --lang {en,pt,fr,de,es,ru}
                        source language, 2 chars (e.g. 'en')
  -i, --inflect         print inflection tables for all homonyms
  -s, --similar         show similar words
  -p {all,n,v,adj}, --pos {all,n,v,adj}
                        Part of speech of words to translate/inflect.
  -d, --define          print dictionary definitions. True by default if -i is
                        not specified.
  -v, --verbose         Print debug messages

Examples

leo example
leo another example
leo "hang out"
leo -l fr bonne gout
leo -l ru книга
leo -l pt ação
leo -i reden
leo ii -p n reden

TODO

  • print non-German plurals
  • allow specifying target and source languages separately
  • (maybe) don't print conjugation labels in translation header for conjugations
  • alternative conjugations with labels for usage (hängen)
  • label haupt/nebensätzlich sections for verbs

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

leo-cli-0.4.0.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

leo_cli-0.4.0-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page