Send tweets with images from the command line
Project description
tweet-images
Send tweets with images from the command line
Installation
Install this tool using pip
:
pip install tweet-images
Usage
You'll need a consumer key, consumer secret, access token key and access token secret for a Twitter account that you wish to tweet from.
You can pass those as the --consumer-key
, --consumer-secret
, --access-token-key
, --access-token-secret
options to the command, or you can set them as environment variables like this:
export TWITTER_CONSUMER_KEY="..."
export TWITTER_CONSUMER_SECRET="..."
export TWITTER_ACCESS_TOKEN_KEY="..."
export TWITTER_ACCESS_TOKEN_SECRET=".."
You can then send a tweet like this:
tweet-images "This is my tweet"
Or attach between one and four images to that tweet by passing their file paths:
tweet-images "Three pictures attached" one.jpg two.jpg three.jpg
You can pass --alt "alt text"
one or more times to attach alt text to your images:
tweet-images "Three pictures attached" one.jpg two.jpg \
--alt "Alt text for one" --alt "Alt text for two"
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd tweet-images
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tweet-images-0.1.1.tar.gz
.
File metadata
- Download URL: tweet-images-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 119a1ac90a4b211cde73183a8cceaec62cebeeea6b7e089d6321794d54b12a86 |
|
MD5 | cda3c6d2773fbe777f41267ec9b12dc2 |
|
BLAKE2b-256 | 08f7e1795a4b7f1fe2972f747ef686c86408d3ca4e499dea469a31c673e19072 |
File details
Details for the file tweet_images-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: tweet_images-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c4dde2f448b523bd4c65d9b025d2b8edb3d7f1d561681ddf58eb8c0d457ebc |
|
MD5 | 6f902f1bf4a689138a4ab6637b309b12 |
|
BLAKE2b-256 | 46903e4ae03ed4785803b1006659fde331e99856ab6f14461155c26ee94f9f0a |