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 | |
|---|---|---|---|
| dpixels-0.3.1.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dpixels-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
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
|