Skip to main content

Package for generating randomized tweets of a user on twitter.

Project description

Tweet Generator

The tweet generator uses a Markov chain finite state model to take a particular user id from twitter and generate tweets based off of that person’s previous tweets. The tweets are stored in a JSON document which allows for random walks of the tweets to occur.


  • Simplify creating a basic Markov Chain Twitter Bot.

  • Easy to read and provide an introduction to a simple way to create something intelligent!


  • Option to remove urls.

  • Option for proper capitalization

  • Output of the generated tree into a pretty JSON Format that you can review.

  • Scraping of the Twitter API using the Tweepy Library


To install, use pip

pip install tweet-generator


See the following example:

from tweet_generator import tweet_generator
TPCK = '<public_consumer_key>'
TSCK = '<secret_consumer_key>'
TPAK = '<public_access_key>'
TSAK = '<secret_access_key>'
twitter_bot = tweet_generator.PersonTweeter('25073877',TPCK,TSCK,TPAK,TSAK)
random_tweet = twitter_bot.generate_random_tweet()

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

tweet-generator-0.0.31.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

tweet_generator-0.0.31-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded py2 py3

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