TPTAPI
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, password) returns a boolean.
Check Login
To verify that your session is still valid you can run checkLogin: client.check_login() 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.
Comment [LOGIN NEEDED]
To add a comment, you need to do client.comment(id, text). Returns a boolean.
Add Tag [LOGIN NEEDED]
To add a tag, you need to do client.add_tag(id, name). Returns a boolean.
Delete Tag [LOGIN NEEDED]
To remove a tag, you need to do client.delete_tag(id, name). Returns a boolean.
Delete Save [LOGIN NEEDED]
To remove a save, you need to do client.delete_save(id). Returns a boolean.
Unpublish Save [LOGIN NEEDED]
To unpublish a save, you need to do client.unpublish_tag(id). Returns a boolean.
Publish Save [LOGIN NEEDED]
To publish a save, you need to do client.publish_save(id). Returns a boolean.
Update Profile [LOGIN NEEDED]
To update your profile, you need to do client.set_profile(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.add_fav(id). Returns a boolean.
UnFavourite a Save [LOGIN NEEDED]
To remove a save from favutrites, you need to do client.remove_fav(id). Returns a boolean.
Save [LOGIN NEEDED]
Saves a CPS file. Data has to be OPS1-encoded save.
data = open("save.cps", "br").read()
client.save(name, description, data)
Returns the save id.
Update Save [LOGIN NEEDED]
Updates a save with new description and content. Data has to be OPS1-encoded save.
data = open("save.cps", "br").read()
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)
Metadata
Release files for tptapi 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tptapi-1.1.0.tar.gz | 6.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tptapi-1.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 14.3 kB
Release files / tptapi-1.1.0.tar.gz
| Download URL | tptapi-1.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19c3753de75b104fb658fb68d6c225e075ae05ed02e6f800b48a62298e5f0cd6
|
|
BLAKE2b-256 checksum How to use checksums |
789d831a48a6c5ea45302c13147fc76868b38bcfb327ca1d62e5497fbaa1b56d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tptapi-1.1.0-py2.py3-none-any.whl
| Download URL | tptapi-1.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
81731cd55030d83ba5555dbe4f56abe8204da7e7847ad895c063e8a8ffcee83a
|
|
BLAKE2b-256 checksum How to use checksums |
441e09c62bc30c6c7c10cbda46bb0d3c2712ddbac594f569a9d9564d62f409fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tptapi 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.