Skip to main content

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

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 (string)
player = Player(3641) # By id (integer)

Values that you can get:

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

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(records_type='basic') # levelType here is records category, if you want get ALL records do not write this value

All level types:

'all', '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' 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 level name

Values that you can get... For classic list level:

id, place, score, song, video, creator, holder, verifier, list_percent, length, history

For future list level:

status, record, category, video, verifier

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(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 us in telegram: @karelskiy127 / @xboctatuk6, or discord: karjalan / lisenok1042

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.9.0.tar.gz (7.9 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.9.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pydemonlistapi-0.9.0.tar.gz
Algorithm Hash digest
SHA256 d29bc8379a62d330122beddb0ce8c76532bd34a9c053637cbd2f4bad404afb22
MD5 4d6a049f27030eead3a3f9ecc6d98665
BLAKE2b-256 5225cf75ceef883b4e1659f5549039002dbc927d10153eaf2f65d7deac996c9c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pydemonlistapi-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6285b4e89d0fae60972d54f64a405a869cf0d4c8e89c5812679c2300bbb103de
MD5 a9e02bfdaf5903dce70e1acc8f4480d0
BLAKE2b-256 5c58bd05237922423032fec2c13b69a994fbeb1a5a03e0d87d7d656c7dbd99f6

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