Generates GIFs based on Tom Scott's Banhammer
Project description
Tom Scott Banhammer Generator
Generates GIFs based on Tom Scott's Banhammer
Want to use this in any project using Docker? Get the Docker container here: https://gitlab.com/nerd3-servers/banhammer-generator
Installing
Python 3.5+ is required
To install the library, simply run the following command:
pip install banhammer
If you would like to use a pillow
drop-in replacement, such as pillow-simd
, then install that prior to installing the banhammer. All requirements should automatically install.
Usage
banhammer.Generator()
is the main generator object. To generate an image, use Generator().image_gen(str)
where str
is your string of choice. This will return an io.BytesIO()
object, which you can then manually write to a file or upload somewhere.
Example
The following example generates a GIF and saves it to a file called output.gif
:
from banhammer import Generator
# Setup the generator
g = Generator()
# Generate the GIF (returns a BytesIO object)
im = g.image_gen('Example')
# Write the image to a file called output.gif
f = open('output.gif', 'wb')
f.write(im.read())
f.close()
The resulting GIF looks something like this:
Font Licensing
The font file included is a modified version of the Bungee Regular font. The font has been modified to include missing unicode characters and emoji provided by other fonts. The licensing and source information can be found below.
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
Built Distribution
File details
Details for the file banhammer-0.1.3.tar.gz
.
File metadata
- Download URL: banhammer-0.1.3.tar.gz
- Upload date:
- Size: 14.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eda3fce3a28fc09d28c1c452222091969d5d0cbe0f5f641cac462028ac387ad8 |
|
MD5 | 02243b81c5a8ae8243caa03735fad05c |
|
BLAKE2b-256 | c4fb2ababc6c5e6576981145f4d790737aad23877d70d7474c304c75cc01a472 |
File details
Details for the file banhammer-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: banhammer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c31a52f874e7e86bd293cbcd8640550275e44a68eaca36d430579321c0796ba |
|
MD5 | e3d4d2b116e333e051ad72936978f836 |
|
BLAKE2b-256 | 89890cd1b009e9a95cc45415d3c81149d3102d123a15e36e56376df0d1391c92 |