dpixels
A(nother) wrapper for the Python Discord Pixel API.
Features
- Proper ratelimite handeling.
- Saves ratelimits in a json file, so restarting scripts won't trigger cooldowns.
- Supports all Pixel API endpoints.
- Supports autodrawing of images.
Examples
Get the canvas:
client = dpixels.Client(token="your token")
canvas = await client.get_canvas()
# this also caches the canvas, so later you can do:
canvas = client.canvas
Get a specific pixel:
pixel = canvas[0, 0] # get the pixel at 0,0
pixel = await client.get_pixel(0, 0) # fetch the pixel at 0, 0
pixel.hex # the hex value
pixel.int # the int value
pixel.rgb # the rgb value
Setting a pixel:
await client.set_pixel(0, 0, dpixels.Color(255, 255, 255)) # set the pixel at 0,0 to white
Autodrawing an image:
from PIL import Image
im = Image.open("path_to_image.ext")
source = dpixels.Source.from_image((0, 0), im)
await client.draw_sources([source]) # draw the source
Credits
This library is heavily based on Artemis21/dpypx
Metadata
Release files for dpixels 0.3.1
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 | Actions |
|---|---|---|---|---|
| dpixels-0.3.1.tar.gz | 6.9 kB | Without provenance | Details for dpixels-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dpixels-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for dpixels-0.3.1-py3-none-any.whl |
Total release size: 15.5 kB
Release files / dpixels-0.3.1.tar.gz
| Download URL | dpixels-0.3.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e5c52f55736a3ce4ae1e518f4933a8daa24c4f88ae2541cdac62b37fb5b2c00
|
|
BLAKE2b-256 checksum How to use checksums |
ec37a780f4768f94ddbedd9f51b2a6ce097bf34b8ae1ee4fea2dd93397ba7046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
|
Release files / dpixels-0.3.1-py3-none-any.whl
| Download URL | dpixels-0.3.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31c78f44fb58afa47cffddc88d36b4b910410565ea2d848d70ac9168c5e2b22c
|
|
BLAKE2b-256 checksum How to use checksums |
a215564f71e7b593acc0ceec05f8bad5a54226f574237b53cb4d594fc2f2c549
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
|
Security for dpixels 0.3.1
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.