PyLeo - Unofficial Lingualeo API python library
Installation
pip install pyleo
Example usage
CLI tool for upload dictionary (ororo.tv_dict*.csv) from Ororo.tv to LinguaLeo
pyleo upload -f ororo.tv_dict.csv -u your@email.mail -p Your_password
Where:
-f- Ororo.tv dictionary filename-u- LinguaLeo username-p- LinguaLeo password
Import as Python module
import json
from pyleo.api import LeoApi
api_instance = LeoApi('your@ema.il', 'password')
if api_instance.need_auth:
api_instance.auth() # Authorize user
# add word to LinguaLeo user dictionary
api_instance.add_word('placebo', 'Имитация лекарства')
# get word translation from LinguaLeo
translation = json.loads(api_instance.get_translations('fake').decode('utf-8'))
print(json.dumps(translation, indent=4, sort_keys=True, ensure_ascii=False))
sample API response
{
"_hash": "0000.0",
"error_msg": "",
"experienceSkills": null,
"meatballs": 55,
"notify_count": 2,
"questData": {
"leoClothing": 0,
"meatballs": 55,
"task_actions_finished": [
[
1,
1
]
],
"task_num": 1,
"task_num_prev": 0,
"task_state": 2
},
"userdict3": {
"is_user": false,
"lang": {
"current": "ru",
"target": "en"
},
"lemmas": [
{
"lemma_id": 15421,
"lemma_value": "FAKE",
"speech_part": {
"code": "Noun",
"name": "существительное",
"short_name": "сущ."
},
"speech_part_id": 7
},
{
"lemma_id": 15421,
"lemma_value": "FAKE",
"speech_part": {
"code": "Verb",
"name": "глагол",
"short_name": "глаг."
},
"speech_part_id": 12
}
],
"sound_url": "https://audiocdn.lingualeo.com/v2/1/15421-631152008.mp3",
"transcription": "feɪk",
"translations": [
{
"is_blame": 0,
"is_owner": false,
"is_user": 0,
"rating": 1,
"rating_avg": 0.206543,
"rating_user_vote": 0,
"source": "",
"speech_part_id": 0,
"star": 1,
"translate_id": 29600,
"translate_value": "подделка",
"translate_votes": 56991
},
{
"is_blame": 0,
"is_owner": false,
"is_user": 0,
"rating": 0,
"rating_avg": 0.2,
"rating_user_vote": 0,
"source": "",
"speech_part_id": 0,
"star": 3,
"translate_id": 29604,
"translate_value": "прикидываться",
"translate_votes": 14627
},
{
"is_blame": 0,
"is_owner": false,
"is_user": 0,
"rating": 0,
"rating_avg": 0.2,
"rating_user_vote": 0,
"source": "",
"speech_part_id": 0,
"star": 3,
"translate_id": 2630670,
"translate_value": "мошенничать",
"translate_votes": 9581
},
{
"is_blame": 0,
"is_owner": false,
"is_user": 0,
"rating": 0,
"rating_avg": 0.2,
"rating_user_vote": 0,
"source": "",
"speech_part_id": 0,
"star": 3,
"translate_id": 135960,
"translate_value": "фальшивый",
"translate_votes": 4921
},
{
"is_blame": 0,
"is_owner": false,
"is_user": 0,
"rating": 0,
"rating_avg": 0.2,
"rating_user_vote": 0,
"source": "",
"speech_part_id": 7,
"star": 3,
"translate_id": 4021671,
"translate_value": "подделка",
"translate_votes": 3951
}
],
"word_count": 44926,
"word_id": 15421,
"word_speech_parts": {
"12": {
"code": "Verb",
"name": "глагол",
"short_name": "глаг."
},
"7": {
"code": "Noun",
"name": "существительное",
"short_name": "сущ."
}
},
"word_top": 3,
"word_type": 1,
"word_value": "fake"
},
"utcServerTime": 1551600000
}
Metadata
Release files for pyleo 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyleo-0.0.13.tar.gz | 8.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyleo-0.0.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / pyleo-0.0.13.tar.gz
| Download URL | pyleo-0.0.13.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c90f4a570367ae64ef54e5d001e409f176a2fac154de97a02e8a6de8ba63a0b
|
|
BLAKE2b-256 checksum How to use checksums |
a03a5f91245e3d0463448c62583fdb25a73616ce08de471e75af2729dcde67ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
|
Release files / pyleo-0.0.13-py3-none-any.whl
| Download URL | pyleo-0.0.13-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ad91a3d1264521dfb33395d1748ae8e51026b35d3bcf5be31a0da5989124f69
|
|
BLAKE2b-256 checksum How to use checksums |
62d2b9db4841eb17dab191344016ac4e2af6a23e69eda2a985b055654905e04f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
|
Security for pyleo 0.0.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.