Skip to main content

Patched CLI Meme Generator/Caption Maker to automatically add whitespace and text to top and bottom

Project description

dankcli-lib

PyPI version Python Version Downloads

dankcli-lib is a CLI Image Captioning Tool, Meme Generator and Library which automatically adds white space and text to the top of your image.

Installation

$ pip install dankcli-lib

Usage

$ python -m dankcli_lib "path/to/image" "Meme text you want to add" [-f "final_image_name_without_extension"]

Python:

from dankcli_lib.caption import Caption

caption = Caption("/path/to/image", "Text here", bottom_text="Bottom text here", bottom_font_color="#000000", bottom_text_box=False, separator_line=True, separator_line_color="#000000", top_font_color="#ffffff", top_background_color="#000000", bottom_background_color="#000000", italic=False, bold=False)
caption.save('file.jpg')
from dankcli_lib.caption import Caption

with Caption("image.jpg", "Your text") as caption:
    buffer, ext = caption.to_buffer()
    await ctx.send(file=discord.File(buffer, f"image.{ext}"))
from dankcli_lib.caption import Caption
import discord

caption = Caption("https://example.com/image.jpg", "Your text")
buffer, ext = caption.to_buffer()
await ctx.send(file=discord.File(buffer, f"image.{ext}"))
caption.close()

The text gets automatically wrapped according to width of image but you can also have intentional \n in your text. The image is saved in the current folder with the name as the current date and time, the name can be changed with the optional -f or --filename argument, specifying a file name without the file extension.

Example

Example 1 (showing \n functionality)

$ python -m dankcli_lib "templates/yesbutno.jpg" "Mom at 2am: Are you awake?\n\nMe:"

turns this

to this

Example 2 (showing auto textwrap)

$ python -m dankcli_lib "mymemes/helpmeme.jpg" "When you make a meme generator but now you can't stop making memes"

turns this

to this

Updates

0.6.5

Added the discord and discord.py tags

0.6.6

Patched URL/Link support caused parsed was undefinied

0.6.7

Added GIF SUPPORT!

0.6.8

Increased the Font Size

0.6.9

Added Compression cause discord's a jerk

0.7.0

Added Italic, Bold, Had to Remove all TTF files though. Bold seems a bit broken rn

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

dankcli_lib-0.7.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

dankcli_lib-0.7.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file dankcli_lib-0.7.0.tar.gz.

File metadata

  • Download URL: dankcli_lib-0.7.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dankcli_lib-0.7.0.tar.gz
Algorithm Hash digest
SHA256 81792b9ed1b304b239fde1aeb799384701376d90687d4c577f2187d1485ec121
MD5 c9a91ce48719b971937d7cb82df79bf0
BLAKE2b-256 3209376804744b43ab9f1e09f14838623966c7f6f0a9d9f52b0d8d4f7c2f11ba

See more details on using hashes here.

File details

Details for the file dankcli_lib-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: dankcli_lib-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dankcli_lib-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d85512f1137266a357e4af86b1d50c0a12fa20d3c07f6d1a551fd6158625081
MD5 95c172c8b9676b49db80802afcae45de
BLAKE2b-256 bf2cc0572fbc07d06921cdb1cc7b24322f3747a86c01cbb4c0d51484492a6b74

See more details on using hashes here.

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