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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leo-cli-0.4.0.tar.gz.
File metadata
- Download URL: leo-cli-0.4.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2aba865d8ae739353559e8b1bd6e6feff88f0d3f6cf60dd7747bb21831e10ff
|
|
| MD5 |
b7d522f7bcb1cd8f37d46dbc2546cb92
|
|
| BLAKE2b-256 |
bb0265e3a2bad4bf00a41f11ed3d4a2a8ff831cab9c39d3a7a8f15489e46a3b4
|
File details
Details for the file leo_cli-0.4.0-py3-none-any.whl.
File metadata
- Download URL: leo_cli-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63f7e396653e28ab236445f456c632be3836519f3537b10f3e0879dec2b7cf24
|
|
| MD5 |
3402385bf76967ee255aa0649084af4c
|
|
| BLAKE2b-256 |
02d1979bcf14e0e8aaf61cdae1692f0f544f981e635d6a286bf528fd6d5202e5
|