Sly Twitter for Python
🚧 This library is an early work in progress! Breaking changes may be frequent.
🐍 For Python 3.10+
No-boilerplate, async and typed Twitter access. 😋
pip install slytwitter
This library does not have full coverage. Premium version 1.1 is not supported. Currently, the following topics are supported:
- Posting and managing tweets, with media
- Reading followers
V2 may or may not work, due to changes in access policy to Twitter's API. If it is, the following topics are supported:
- Reading followers and following
- Getting users
You can directly grant user tokens using the command line, covering the whole OAuth 1.0 grant process.
Example usage:
import asyncio
from SlyTwitter import *
async def main():
auth = OAuth1('test/app.json', 'test/user.json')
twitter = Twitter(auth)
tweet = await twitter.tweet('Hello, world!')
follow = await twitter.check_follow('dunkyl_', 'TechConnectify')
print(tweet)
print(follow) # @dunkyl_ follows @TechConnectify
asyncio.run(main())
Example CLI usage for getting authorized:
py -m SlyTwitter v1 scaffold
# ...
py -m SlyTwitter v1 grant
Granting credentials requires a Twitter developer account and credentials from their website. Visit Twitter developers to get started.
Metadata
Release files for SlyTwitter 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| SlyTwitter-0.2.0.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| SlyTwitter-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / SlyTwitter-0.2.0.tar.gz
| Download URL | SlyTwitter-0.2.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fac634747492befc32188d3a4c634be9bba3b037f3a3e877d9b2aa8f77783b3
|
|
BLAKE2b-256 checksum How to use checksums |
9995327fc22d88878323704f2886d616a48b2c2871478eaf1ec96aa4d4edc2f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|
Release files / SlyTwitter-0.2.0-py3-none-any.whl
| Download URL | SlyTwitter-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4ddc0f964a8a1de8a7e9f39d36fb47e5335bb6286d5d4590f5f5a4354e0afbf
|
|
BLAKE2b-256 checksum How to use checksums |
28aec50362236297c9f054c49633d110f9443041e0934b47757976461ccc7985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|