Memes with Python's matplotlib
Project description
Memes with Python's matplotlib. Create image macro memes using matplotlib for rendering and the memegen API for template discovery.
Installation
pip install memeplotlib
# or
conda install -c conda-forge memeplotlib
For the Model Context Protocol server (use memes from Claude Desktop / Claude Code / any MCP client):
pip install "memeplotlib[mcp]"
Quick start
import memeplotlib as memes
fig, ax = memes.meme("buzz", "memes", "memes everywhere")
fig.savefig("buzz.png")
The function returns (Figure, Axes) — same convention as seaborn,
pandas.plot, and other matplotlib extensions. It does not call
plt.show() implicitly. Pass show=True if you want auto-display.
Features
Memegen IDs, file paths, or URLs as templates:
memes.meme("drake", "writing tests", "shipping to prod", color="yellow")
memes.meme("/path/to/image.jpg", "top text", "bottom text")
memes.meme("https://example.com/image.png", "from a URL")
Object-oriented Meme builder, chainable:
from memeplotlib import Meme
Meme("buzz").top("python").bottom("python everywhere").save("buzz.png")
Memify existing matplotlib figures:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 9])
memes.memify(fig, "stonks")
RcParams-style scoped configuration:
with memes.rc_context({"font": "comic", "color": "yellow"}):
memes.meme("buzz", "scoped style", "no leakage")
# defaults are auto-restored here
# Or set globally:
memes.config["fontsize"] = 96
Forward **kwargs to Axes.text:
memes.meme("buzz", "rotated", rotation=15, alpha=0.8)
Use from agents
pip install "memeplotlib[mcp]"
memeplotlib-mcp # boot the MCP server (stdio)
memeplotlib meme buzz "hello" "world" -o /tmp/ # CLI render
The MCP server exposes meme, search_templates, and list_templates
tools. The CLI is useful even without MCP — agent harnesses can shell
out, and CI scripts can render directly.
Documentation
Full docs including a tutorial, user guide, conventions reference, and API reference: brianckeegan.github.io/memeplotlib.
Build locally:
pip install -e ".[docs]"
sphinx-build -W docs docs/_build
How it works
- Templates are fetched from the memegen API (blank background images + metadata) and cached locally.
- Text is rendered with matplotlib's text system using
patheffects.Strokefor the classic outlined meme look. - The bundled Anton font (Impact-like, SIL OFL licensed) is used as a fallback for systems where Impact isn't installed.
Related projects
- matplotlib — the rendering engine.
- memegen — the template registry and blank-image source (api.memegen.link).
- seaborn — the API conventions for
ax=None,**kwargsforwarding, and(fig, ax)returns are modeled on seaborn.
Dependencies
matplotlib >= 3.8numpy,requests,Pillow,platformdirs
Requires Python 3.10+.
License
MIT. The bundled Anton font is licensed under the SIL Open Font License v1.1.
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 memeplotlib-0.2.0.tar.gz.
File metadata
- Download URL: memeplotlib-0.2.0.tar.gz
- Upload date:
- Size: 22.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187007f0c15b95d7bdd593afc9adbfa8780c4aaec245b083f36adca8529bccc0
|
|
| MD5 |
eca48521c422c62f0c769ddf1da91f23
|
|
| BLAKE2b-256 |
7fb02b32735355a22b7ed0249885e48136b33467fe4bb2d4f6f952320f91901e
|
Provenance
The following attestation bundles were made for memeplotlib-0.2.0.tar.gz:
Publisher:
publish_pypi.yml on brianckeegan/memeplotlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memeplotlib-0.2.0.tar.gz -
Subject digest:
187007f0c15b95d7bdd593afc9adbfa8780c4aaec245b083f36adca8529bccc0 - Sigstore transparency entry: 1397550273
- Sigstore integration time:
-
Permalink:
brianckeegan/memeplotlib@4c42762945a1fd9ac39558c1b1a7d17f8d3974f9 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/brianckeegan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@4c42762945a1fd9ac39558c1b1a7d17f8d3974f9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file memeplotlib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: memeplotlib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 109.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aadbf1ed98b748f1c18a32499b42ed5aa2668a0bdf5646f2f275116383f5dea6
|
|
| MD5 |
4c8a4c464f996dea0f70236967c4de6f
|
|
| BLAKE2b-256 |
07dcc70ef67c19f80b863732a68b94afb563c9622767bd503638c06ef80c84bf
|
Provenance
The following attestation bundles were made for memeplotlib-0.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on brianckeegan/memeplotlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memeplotlib-0.2.0-py3-none-any.whl -
Subject digest:
aadbf1ed98b748f1c18a32499b42ed5aa2668a0bdf5646f2f275116383f5dea6 - Sigstore transparency entry: 1397550309
- Sigstore integration time:
-
Permalink:
brianckeegan/memeplotlib@4c42762945a1fd9ac39558c1b1a7d17f8d3974f9 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/brianckeegan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@4c42762945a1fd9ac39558c1b1a7d17f8d3974f9 -
Trigger Event:
release
-
Statement type: