Skip to main content

ppfun

ppfun allows you to use the PixelPlanet.Fun's (hence the name) API in your Python code. I personally didn't come up with any use case besides auto-drawing bots. But you may. Please e-mail me if you come up with any idea, I will truly be interested.

Example code:

# import the library
import ppfun

# create an API object
pp = ppfun.PPFun_api()
# print the list of available canvases
print('---------')
print('Canvases:')
for c in pp.list_canv():
    print(c['title'] + '\t\t' +
          c['description'] + '\t\t' +
          str(c['size']) + 'x' + str(c['size']) + '\t\t' +
          '(' + c['identifier'] + ')')
print('---------')
# get the main canvas (Earth)
canv = pp.get_canv('d')
# print the approximation of the lime color for this canvas
print('Lime color ID: ' + str(canv.approx_color((0, 255, 0))))
# set a pixel at (-1532, -550) and print the cooldown time
canv.set_pixel((-1532, -550), canv.approx_color((0, 255, 0)))
print('Cooldown after setting the pixel: ' + str(canv.remaining_cooldown()))

installation

pip install ppfun

documentation

PPFun_api class

This is where the journey starts. You create a client by creating an instance of this class. The library then fetches some data from the server. It is available through these functions:

  • list_canv() - returns a list of canvas descriptors. Each descriptor is a dictionary that contains the title, description, size and identifier keys
  • get_canv(ident) - returns a canvas object of the canvas with a specific identifier

PPFun_canv class

This class contains all the functions you need to create your masterpiece. Here they are:

  • approx_color(rgb_tuple) - returns a color index that approximates the given color the most
  • set_pixel(pos_tuple, color_index) - places a pixel on the map. Throws an exception on error, returns True on success
  • remaining_cooldown() - returns the remaining cooldown in seconds

Metadata

Release files for ppfun 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ppfun 1.0.5
File Size Uploaded Provenance Actions
ppfun-1.0.5.tar.gz 3.6 kB Without provenance Details for ppfun-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ppfun 1.0.5
File Interpreter ABI Platform Actions
ppfun-1.0.5-py3-none-any.whl Python 3 none any Details for ppfun-1.0.5-py3-none-any.whl

Total release size: 7.6 kB

Release files / ppfun-1.0.5.tar.gz

Download URL ppfun-1.0.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9fd1f9928ee3be3226d95dffbc6a06bfbc83bcdf8d85f3eba6fb2537e7a2e15a
BLAKE2b-256 checksum
How to use checksums
9a8a9c4c7bbf85060543526c3203f67b398df863fb229aec8a44a094e54117cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release files / ppfun-1.0.5-py3-none-any.whl

Download URL ppfun-1.0.5-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d8d757fd1e89db101d69bf212783ae450a85fe05d57e00509d4199900c27376
BLAKE2b-256 checksum
How to use checksums
d8528b3e96ecb6ecf03dacf18c3374e16eb5b831da582e096312e771e3d1ff96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for ppfun 1.0.5

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.

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