A Python client to interact with powdertoy.co.uk
Project description
This package interacts with The Powder Toy’s API.
Usage:
import tptapi
client = tptapi.Client()
Login
Most actions need a session token you can obtain from Login: client.login(user, passwd); returns a boolean.
Check Login
To verify that your session is still valid you can run checkLogin: client.checkLogin() which will return a boolean.
Vote [LOGIN NEEDED]
To cast a vote, you need to do client.vote(id, type) where type is a negative or positive number that defines if it’s a upvote or downvote. Returns a boolean.
Add Tag [LOGIN NEEDED]
To add a tag, you need to do client.addTag(id, name). Returns a boolean.
Delete Tag [LOGIN NEEDED]
To remove a tag, you need to do client.delTag(id, name). Returns a boolean.
Delete Save [LOGIN NEEDED]
To remove a save, you need to do client.delSave(id). Returns a boolean.
Unpublish Save [LOGIN NEEDED]
To unpublish a save, you need to do client.unpublishTag(id). Returns a boolean.
Publish Save [LOGIN NEEDED]
To publish a save, you need to do client.publishSave(id). Returns a boolean.
Update Profile [LOGIN NEEDED]
To update your profile, you need to do client.setProfile(data). Returns a boolean.
Browse [LOGIN ENHACES OUTPUT]
To browse, you need to do client.browse(query, count, offset). Returns results.
Favourite a Save [LOGIN NEEDED]
To add a save to favutrites, you need to do client.fav(id). Returns a boolean.
UnFavourite a Save [LOGIN NEEDED]
To remove a save from favutrites, you need to do client.remFav(id). Returns a boolean.
Save [LOGIN NEEDED]
Saves a CPS file. Data has to be OPS1-encoded save. client.save(name, description, data). Returns save id.
Update Save [LOGIN NEEDED]
Updates a save with new description and content. Data has to be OPS1-encoded save. client.updateSave(id, description, data). Returns a boolean.
Startup Data [LOGIN ENHACES OUTPUT]
Returns Startup.json data. client.startup()
Save’s Comments
Returns a save’s comments. client.comments(id, count, offset)
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
Built Distribution
Hashes for tptapi-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dde9787447b6be6b79a9409771c4c21a0a3a138281e8f763751eeb412d484e47 |
|
MD5 | bd60bd4367c74deb33b80efd2d933a16 |
|
BLAKE2b-256 | 3b69d58e7775bf864fe46cc6c2e605b70f3adf81f53affe1d969724e300ce295 |
Comment [LOGIN NEEDED]
To add a comment, you need to do client.comment(id, text). Returns a boolean.