Skip to main content

Unofficial Duolingo API package

Project description

Lingus

PyPI

Lingus is an unofficial Duolingo API that can allow users to view data that isn't necesairly accesible from the profile page.
It consists of two types of functions: owner dependent and owner independent . Owner depented functions show data that can only be viewed if the inspected user is the one that has signed in, while the other ones show data accesible to everyone, regardless of authorization.

Function overwiew

Creating a user

#import Lingus
user = Lingus("SampleUsername", "SampleEmail@email.com", "samplepassword123")

The first value ("SampleUsername") specifies what account will be inspected. It does not have to be the account that belongs to the signed-in user, but that will only allow you to use owner independent functions.

Owner dependent functions:

return_user

Returns a dictionary containing various information on the user

# Example use
lingus  = duolingo.Duolingo('samplename', '...')
print(lingo.get_user_info())
# Sample Response
{
            'owner': True
            'premium': False
            'username': "Anonero"
            'name': "Anon"
            'league': "Diamond"
            'active': "Russian"
            'a_crowns': 25
            'a_mastered': 6
            'a_code' : Ru
            'a_level': 18
            'level_progress': 75.00 
            'lessons_c': 300
            'lessons_u': 13
            'streak': 56
            'XP_total': 13454
            'XP_active': 12354
            'XP_recent': 4325
            'lessons_2w': 95
            'lesson_last': "21:39:28, 01/17/2022" 
            'lesson_up_name': "Genitive Case - 1"
            'lesson_up_level': 1
            'lingots': 346
            'crystals': 2634
}

get_tracking_properties

Returns a Pandas DataFrame with a bunch of data about the user, such as some of the data in return_user.

get_premium

Returns a boolean of whether the user owns Duolingo Plus or not.

get_league

Returns a string with the name of the League the user is currently in.

get_lingots

Returns an int with the amount of lingots the user owns.

get_gems

Returns an int with the amount of gems the user owns.

get_num_sessions_completed

Returns an int with the amount of lessons the user has completed

Owner independent functions

session_login

Returns an unformatted dictonary containing all of the data avaliable about the user.

get_readable

Returns json formatted into a readable string with all of the data on the user.

get_fullname

Returns a string with the users account name (not to be confused with username).

get_data

Returns a Pandas DataFrame with a bunch of owner-independent data about the user, such as some of the data in return_user.

get_active_lessons_unlocked

Returns an int with the amount of lessons the user has unlocked in his active language

get_upcoming_lesson_name

Returns a string with the name of the lessons that is considered the users 'next' by Duolingo

get_upcoming_lesson_skill_level

Returns an int with the level of the lesson hinted in get_upcoming_lesson_name

get_skills

Returns a Pandas DataFrame with a bunch of owner-independent data about the users skills, such as some of the data in return_user.

get_current_crowns

Returns an int with the amount of crowns the user has unlocked.

get_current_mastered

Returns an int with the amount of legendary crowns the user has unlocked.

_get_languages

Returns a Pandas DataFrame with data about all languages avaliable on the platform, regardless of whether the user is studying them or not.

get_active_languages

Returns a Pandas DataFrame like _get_languages only with data about languages the user is studying.

get_langauge_string

Returns a string of the language that the user has set as "active".

get_active_level

Returns an int with the level of the language the user has set as active.

get_level_progress

Returns a float with the percentage towards the next level.

get_active_lessoncode

Returns a 2-letter string containing the lessoncode of the language the user has set as active.

get_total_xp

Returns an int with the total amount of xp sumed up from all of the languages the user has studied.

get_active_xp

Returns an int with the amount of XP in users active language.

get_calendar

Returns a Pandas DataFrame with a bunch of data about the users lessons from tha past two weeks.

get_recent_xp

Returns an int with the XP the user has gained over the past two weeks.

get_last_lesson

Returns a string with the date and time of users last lesson but only if it was within the last two weeks.

get_lessons_last_two_weeks

Returns an int with the amount of lessons the user has completed in the last two weeks.

get_streak

Returns an int with the users current streak.

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

Lingus-0.0.2.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.

Lingus-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file Lingus-0.0.2.tar.gz.

File metadata

  • Download URL: Lingus-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for Lingus-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d306b69dbdd5b4ebb15709be7cbff01c14f987d51f552782dee7828e6740c9f9
MD5 8f20e02496e63067dea5f4a2b691fa5d
BLAKE2b-256 9af3c4180fcd2328cb3222410a3a92a0a3cfdf157e75a885566b85eec3498e34

See more details on using hashes here.

File details

Details for the file Lingus-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: Lingus-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for Lingus-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b1ca9d74fc0ad4d2c02082c47a8b11cd4db2d38aa9394a69f610ffc507c461
MD5 3a16220b52b489981e1f443bf0de1dc0
BLAKE2b-256 c0eaccb9d140810985d5b5f20a902328eda28eeaf9b7e3313242ff7b77c99723

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