Skip to main content

Generates GIFs based on Tom Scott's Banhammer

Project description

Tom Scott Banhammer Generator

Generates GIFs based on Tom Scott's Banhammer

For the full video and additional context, please watch [https://youtu.be/nyD7FMwhwxc]("We Made a Banhammer (feat. NerdCubed)") by Tom Scott.

Installing

Python 3.10+ 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.

Font Designers Licenses
Bungee Regular David Jonathan Ross SIL Open Font License
Twitter Color Emoji SVGinOT Font Brad Erickson, Joe Loughry, Terence Eden, Twitter, Inc and collaborators Massachusetts Institute of Technology License
Creative Commons Attribution 4.0 International
DejaVu Sans Mono Štěpán Roh and authors, Bitstream, Inc, Tavmjung Bah Massachusetts Institute of Technology License
Tetsubin Gothic フォントな自由 Apache License 2.0

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

banhammer-1.0.0.tar.gz (14.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

banhammer-1.0.0-py3-none-any.whl (14.2 MB view details)

Uploaded Python 3

File details

Details for the file banhammer-1.0.0.tar.gz.

File metadata

  • Download URL: banhammer-1.0.0.tar.gz
  • Upload date:
  • Size: 14.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for banhammer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4b5b56c2913cff24d6ec0d72f59537ce5cb4d7f4772b46750583d5e55848fecc
MD5 420fd1013e8148934daaae8aba456b0a
BLAKE2b-256 591c4db531905f52a863d3b1924114760bd4f34ac448757e0e110fef8e666cc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for banhammer-1.0.0.tar.gz:

Publisher: publish.yml on DerpyChap/banhammer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file banhammer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: banhammer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for banhammer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f94546624d6f58fc8cf3dfa5c52929378a36399846b9c3bcc02ddf44c518b74
MD5 77334ff9c86eff9df275b99d5d530aca
BLAKE2b-256 31ca424bf505b43e28a000b40a1c89bd4237e22d94b0a36dd49e5440d6f14be5

See more details on using hashes here.

Provenance

The following attestation bundles were made for banhammer-1.0.0-py3-none-any.whl:

Publisher: publish.yml on DerpyChap/banhammer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page