Skip to content

A Python tool for formatting a text file into a set of tweets

License

Notifications You must be signed in to change notification settings

eroberson/py_tweet_format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Tweet Formatter

Python tool for formatting a text file into a set of tweets.

Installation

Use of virtual environments recommended.

pip install py_tweet_format

Or local user install:

pip install --user py_tweet_format

Or install from GitHub clone:

git clone https://github.com/eroberson/py_tweet_format.git
cd py_tweet_format
pip install .

Usage

Take a text file input and parse into a set of tweets with default values for size of tweet and length of automatically shortened URLs. This will keep a tweet no larger than 280 characters, shorten URLs to 23 characters, remove extra spaces, remove newlines, and number the tweets.

py_tweet_format input_file.txt output_file.txt

Use a shorter limit of 140 instead of the default 280 character limit.

py_tweet_format --max_chunk_length 140 input_file.txt output_file.txt

Keep extra spaces and newlines from the origin text.

py_tweet_format --keep_extra_spaces --keep_newlines input_file.txt output_file.txt

Don't number tweets and use a different shortened URL length.

py_tweet_format --no_numbers --shortened_url_length 25 input_file.txt output_file.txt

About

A Python tool for formatting a text file into a set of tweets

Resources

License

Stars

Watchers

Forks

Packages

No packages published