Skip to main content

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)

Source distribution for dpixels 0.3.1
File Size Uploaded
dpixels-0.3.1.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dpixels 0.3.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page