Skip to main content

A package that provides api.demonlist.org functions to python

Project description

pydemonlistapi

An python library that simply provides Global List API to your code

Developed by Karelskiy127 and AdderTeam

Requirements

You need requests, countryflag and logging libraries for correct lib work

And, of course you need good internet connection

Documentation

Player class

You can get any information about player in global by using this class:

from demonlist import Player

You can contact a specific user by their Global List nickname or by their id

player = Player('w3rty') # By nickname (only string)
player = Player(3641) # By id (only integer)

Values that you can get:

id, place, score, country, username, hardest, badge, flag

For example:

print(player.place)

For 'w3rty' it returns 16

Also, you can get all records of player, or records in specific category, use this:

print(player.records(levelType='basic') # levelType here is records category, if you want get ALL records do not write this value

All level types:

'main', 'basic', 'extended', 'beyond', 'verified', 'progress'

Country class

With this class you also can get some values, but for start you need to import it:

from demonlist import Country

And now you can get any information about country

country = Country('Venezuela') # ONLY string value
print(country.place)

You can get:

flag, place, score

Also you can get every player in country by

country.players(display_mode='default')

display_mode is a setting that displays what you will receive.

'default' (or just ()) returns an string with all players

'list' returns a list object with all players and infomation about them

Level class

You can get any level information using this class:

from demonlist import Level
level = Level('Acheron') # ONLY string value

Values that you can get:

place, video, verifier, score, list_percent, creator, id

For example

print(level.creator)

For Acheron it returns 'Riot, Ryamu and more'

Also, you can get all records on specific level, by using this:

print(level.records(amount=True)) # For the total count of all records
print(level.records()) # For the string of 50 records
print(level.records(display_mode='list)) # For list-object of 50 records

Warning: Global List limits do not allow to display all records at once, therefore to display something from a certain offset there is an offset value

For example:

count = level.records(amount=True)
if count > 50:
 print(level.records())
 print(level.records(offset=50))

This simple code returns 100 records (or less, but more than 50) on level. You can edit it how you need

And you can get level position history by using level.history() func:

print(level.history(display_mode='list')) # If you want get a list obj of all changes
print(level.history()) # Returns default string

Top functions (players and future/classics lists)

You can get top of players and levels lists by using this:

from demonlist import level_list, players_ranking

Let's start with level_list:

print(level_list(display_mode='list', offset=50)) # Returns a list obj of 51-100 levels in top.
# If you want string do not write display_mode value, if you want 50 levels from the beginning of the top do not write offset.
# You can change offset how you want (for example: offset=100 returns 101-150 levels)
print(level_list(as_names=True)) # Returns list obj with levels names. You can only specify offset along with this value.
print(level_list(type='future')) # Returns future list as a string. If you want list object, add display_mode='list'. THIS PARAMETER DO NOT SUPPORT OFFSET/AS_NAMES!!!

And now, players_ranking:

print(players_ranking(display_mode='list', offset=50)) # Returns a list obj with 51-100 players in top.
# If you want string do not write display_mode value, if you want 50 players from the beginning of the top do not write offset.

That's all!

At the moment these are all the functions present in the library. The library is still raw, but you can already use it. About bugs, write to me in telegram: @karelskiy127, or discord: karjalan

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

pydemonlistapi-0.1.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

pydemonlistapi-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pydemonlistapi-0.1.2.tar.gz.

File metadata

  • Download URL: pydemonlistapi-0.1.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pydemonlistapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ceb56f7e8432794126f9052f3e2680def2416ae86e6db15d840e6aa06edf0a09
MD5 696cf81517be28deafc427d9f18b4420
BLAKE2b-256 128e0fa1c976bea0ccff00ec5ceaa777334ab0a19e9b813e73d03dbf440f7afb

See more details on using hashes here.

File details

Details for the file pydemonlistapi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pydemonlistapi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pydemonlistapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 885ef3c461e7c01efc341025a2b675e3d421ceb39a60adcf5ea217ab65799a5c
MD5 729351b33dffca562068b8eefcf7d887
BLAKE2b-256 4bccbd62df3f218bc164461b94d57d176fa364eda245cb95e6756fbf42197861

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