Skip to main content

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.

Goals

  • Simplify creating a basic Markov Chain Twitter Bot.

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

Features

  • 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

Installation

To install, use pip

pip install tweet-generator

Example

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()
print(random_tweet)

Release files for tweet-generator 0.0.31

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tweet-generator 0.0.31
File Size Uploaded
tweet-generator-0.0.31.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tweet-generator 0.0.31
File Interpreter ABI Platform
tweet_generator-0.0.31-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 10.7 kB

Release files / tweet-generator-0.0.31.tar.gz

Download URL tweet-generator-0.0.31.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
654c3a6de36a731b27014270b13f874d7b483f1be99be7e05eb89d5edcffa12c
BLAKE2b-256 checksum
How to use checksums
9b654aa51871497e21135aefe1bbc1c8b6eb5f461690dd8051e6454a4bd8d9b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / tweet_generator-0.0.31-py2.py3-none-any.whl

Download URL tweet_generator-0.0.31-py2.py3-none-any.whl
Size 5.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
42224fed317c9f815693aeb2c1b3b86448d4562ac71c13088f65c093e3657744
BLAKE2b-256 checksum
How to use checksums
f28923e5f2baace60830d26e68551fa580dc531eb1f2763dd5beaf42a2e8723e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.31 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page