A free,simple and easy-to-use package to add leaderboard system to your games/apps.
Project description
PYDREAMLO
Simple,free and easy-to-use Leader Board system using https://dreamlo.com.
Install
-
Use pip to install
$ pip install pydreamlo
or
$ pip3 install pydreamlo
or
$ python -m pip install pydreamlo
-
or Build from source
-
or Copy the
src/pydreamlo
folder to your project directory and import it.
Usage:
-
Create a dreamlo url by going to https://dreamlo.com For using this LeaderBoard you need 2
url
s (private dreamlo url
andpublic dreamplo url
)- Creating the
url
s-
private url
: copy theprivate-key
given by dreamlo and join it with the url.(the protocol may be different)pr_key = "http://dreamlo.com/{your_private_key}"
-
private url
: copy thepublic-key
given by dreamlo and join it with the url.(the protocol may be different)pu_key = "http://dreamlo.com/{your_public_key}"
-
- Creating the
-
Use
dreamlopy
to work with your leader board.from pydreamlo import LeaderBoard pr_key = "http://dreamlo.com/{your_private_key}" pu_key = "http://dreamlo.com/{your_public_key}" cool_leader_board = LeaderBoard(pr_key,pu_key)
The module
dreamlopy
is initialized,now you use the methods in the module to perform the operations.-
.add(username,score,time,text)
add()
is used to add a new user to the leader board.username
andscore
are necessary parameters.Thetime
is the time taken to finish.(Sorting based on time is available)cool_leader_board.add("some-user",100,10,"user is cool")
returns a string "OK" if sucessful
-
.delete(username)
delete()
is used to delete a specific user from the leaderboard.username
is the only parameter(Note:only one user can have a specific username)cool_leader_board.delete("some-user")
-
.clear()
clear()
is used to clear the entire leaderboard.cool_leader_board.clear()
-
.get(index:int = 0,upto:int = 0,rtype:str = 'json',sort:str='')
used to get the leaderboard data.
index
defines the index from where should the results start showing.(default is 0)upto
defines the number of users to return after the index.(default is 0,so it will return the entire leaderboard)rtype
defines the return type of theget
method.rtype = "json"
rtype = "xml"
rtype = "pipe"
rtype = "quote"
sort
is an additional command return the sorted leaderboard based ontime
taken by the usersort='a'
for ascending(less time first)sort='d'
for descending(greter time first)
""" This will return all the leaderboard data starting from index 0 to (index 0 + next 50 spaces) and will return as a "json" and arranges the leaderboard based on time(the user with less time shows at first). """ cool_leader_board.get(0,50,"json",'a')
-
.get_new_sorted(index:int = 0,upto:int = 0,rtype:str = 'json',sort:str='')
used to retrieve the leaderboard with respect to time score's was added.(same parameter as
.get()
) -
.get_user(username,rtype)
used to get deatils of a specific user.
-
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file pydreamlo-0.0.2.tar.gz
.
File metadata
- Download URL: pydreamlo-0.0.2.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 202985179d9f71643ad0623b449131c077d8b7f38a20c348fca61d2f6b12a70a |
|
MD5 | ebb35f25d28f6521eed9d282a9910e78 |
|
BLAKE2b-256 | 9e7f5b48699ec6e535856d8ed87d5bd161ea58ba8d7a6ed918d83c3d6a4c1025 |
File details
Details for the file pydreamlo-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pydreamlo-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8edfac1d74499feae64148b48daaf500a9661a7f35e8d96ddff82ac39f9b5adc |
|
MD5 | c9bb1988f6e9ae02916c3aac656f9d1d |
|
BLAKE2b-256 | fa4c0dd7e08daf603ac124bf6e105d9df2e265d386489ace02470955f661f837 |