Skip to main content

Create memes using imgflip easily!

Project description

Installation

To install, do

# Linux/macOS
python3 -m pip install -U imgflip.py

# Windows
py -3 -m pip install -U imgflip.py

Example

Sync

import imgflip
import requests

imgflip_client = imgflip.Imgflip(username="username", password="password", session=requests.Session()) # create an Imgflip instance

templates = imgflip_client.popular_memes(limit=10) # get popular meme templates from imgflip

meme = imgflip_client.make_meme(
    template = templates["Drake Hotline Bling"],
    top_text = "interacting with raw imgflip api",
    bottom_text = "using imgflip.py"
) # create a meme

print(meme.url) # print the meme image url

Async

import imgflip
import aiohttp
import asyncio

async def main():
    async with aiohttp.ClientSession() as session:
        imgflip_client = imgflip.Imgflip(username="username", password="password", session=session) # create an Imgflip instance

        templates = await imgflip_client.popular_memes(limit=10) # get popular meme templates from imgflip

        meme = await imgflip_client.make_meme(
            template = templates["Drake Hotline Bling"],
            top_text = "interacting with raw imgflip api",
            bottom_text = "using imgflip.py"
        ) # create a meme

        print(meme.url) # print the meme image url

asyncio.run(main())

Result:

https://i.imgflip.com/5f7zzm.jpg
the meme that was generated

Documentation coming soon. For now you can explore the docstrings and source code.

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

imgflip.py-0.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

imgflip.py-0.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

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