Cute 3x3 images from snowflake IDs
Project description
Cute Snowflakes
Have you ever wanted cute 3x3 images from snowflake IDs? Great, because here they are!
Examples:
Installation
Requires Python 3.6+
pip install cutesnowflakes
Usage:
As a command line application:
cutesnowflakes.py --encode 118999881999119725 red
cutesnowflakes.py --decode folder/my_file.png
Available colors for encoding are:
grey
red
green
blue
purple
magenta
yellow
orange
As a library:
## CREATING A SNOWFLAKE
from cutesnowflakes import CuteSnowflakes
flake = CuteSnowflakes()
# Create the snowflake
image, meta = flake.encode("118999881999119725")
# Open it in the system photo viewer
image.show()
# Save the image with its metadata
image.save("my_image.png", pnginfo=meta)
## LOADING A SNOWFLAKE
from PIL.PngImagePlugin import PngImageFile
with PngImageFile("my_image.png") as fp:
print(flake.decode(fp))
## CHANGING SNOWFLAKE COLOR
flake.set_mode("magenta")
Changelog:
Legend:
+ : Added
- : Removed
*** : Fixed
\ : Changed
0.4.0 (In development):
(No changes yet)
0.3.0 (Current release):
+ __version__ to __init__.py
+ Error handling for set_mode()
+ Support for 19 and 20 digit snowflakes
+ Support for custom colors through command line --encode argument
\ Various minor code cleanups and improvements
\ Rename __usage() to print_usage()
\ Improved test suite
\ Improved type annotations
*** Possibility for integer overflows
0.2.1:
*** \ Various minor documentation and structure changes/fixes
0.2.0:
\ Move to a class instead of bare functions
\ Improved command line arguments
\ Moved version to setup.py
+ Multiple colors with set_mode() and format hint PngInfo
0.1.0:
+ Initial version
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cutesnowflakes-0.3.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for cutesnowflakes-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 297dc0baf453c53819fcaddb630e12c24bf6a658cd080cf6c7c2fba22c96a722 |
|
MD5 | cbbd3c44cfa329b7ba59c8d6535ca0bb |
|
BLAKE2b-256 | e0cb8cc7c1ec061183daab5602eb8f9a1318828087d3104f4109b2d15f51d798 |