Skip to main content

Create images that look like tweets

Project description

===========
tweetmagick
===========
Generate images with tweet-like appearance

Installation
------------
::

pip3 install tweetmagick

Examples
--------


.. code-block:: python

from tweetmagick import TweetGenerator

name = "harold"
longname = "stockmaster"
avatar = "harold.jpg"
text = "feeling pompous today, might delete later"
with TweetGenerator(name, longname, avatar, text) as tg:
tg.tweetgen(debug=True)

Code above will display the image and exit without saving it.

``tweetgen`` method returns BytesIO object with png binary blob.
Below is the code that will save your image to a file:

.. code-block:: python

from shutil import copyfileobj

with TweetGenerator(name, longname, avatar, text) as tg:
with open("haroldtweets.png", "wb") as tweet:
copyfileobj(tg.tweetgen(), tweet)

Results in :
.. image:: haroldtweets.png
:align: left


TODO
~~~~
Implement some streamlined method for embedding images in tweets.

Also some method for reply/quote images

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

tweetmagick-0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

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