Patched CLI Meme Generator/Caption Maker to automatically add whitespace and text to top and bottom
Project description
dankcli
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, font_path="arial.ttf", separator_line=True, separator_line_color="#000000", top_font_color="#ffffff", top_background_color="#000000", bottom_background_color="#000000")
caption.save('file.jpg')
from dankcli_lib.caption import Caption
with Caption("image.jpg", "Your text") as caption:
buffer = caption.to_buffer()
await ctx.send(file=discord.File(buffer, "image.jpg"))
from dankcli_lib.caption import Caption
import discord
caption = Caption("image.jpg", "Your text")
buffer = caption.to_buffer()
await ctx.send(file=discord.File(buffer, "image.jpg"))
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
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dankcli_lib-0.6.1.tar.gz.
File metadata
- Download URL: dankcli_lib-0.6.1.tar.gz
- Upload date:
- Size: 227.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f3ea560b8ba58abd4113a8e0fb8a231379ae5cd71f8758bed14e30b61007c32
|
|
| MD5 |
317a801cbd728069ba3aea4bf368199f
|
|
| BLAKE2b-256 |
b7bbc5ddaa174fb992915cb2041475428d6c97746485dd3eb35d8e90c216a1b0
|
File details
Details for the file dankcli_lib-0.6.1-py3-none-any.whl.
File metadata
- Download URL: dankcli_lib-0.6.1-py3-none-any.whl
- Upload date:
- Size: 230.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e129339b5904245c2d3312875db46841f1604d056f1ad1fe9bcf4f34b24ee1a5
|
|
| MD5 |
df80272e55843881f27886fa3628f294
|
|
| BLAKE2b-256 |
5041655eeeeee1afe3856c453a97c54b284ad8dfaf5ef9ef57735a3a7f627cc0
|