parallel-python-twitter
A client that distributes Twitter API requests across multiple keys. Built for Python 3.6.
Getting Started
First, get your API credentials together and get a list of twitter.Api objects:
import parallel_twitter
TWITTER_API_CONSUMER_KEY = ...
TWITTER_API_CONSUMER_SECRET = ...
OAUTHS = [
{
'oauth_token': ...,
'oauth_token_secret': ...
},
{
'oauth_token': ...,
'oauth_token_secret': ...
},
...
]
apis = parallel_twitter.oauth_dicts_to_apis(
oauth_dicts=OAUTHS,
api_consumer_key=TWITTER_API_CONSUMER_KEY,
api_consumer_secret=TWITTER_API_CONSUMER_SECRET
)
Next, try out some of the examples:
user_ids = [
561808704, # @neeljsomani
813286, # @BarackObama
17919972 # @taylorswift13
]
# Get a list of posts that these users liked
parallel_twitter.examples.pull_users_likes(
users=user_ids,
apis=apis
)
# Get a list of these users' posts + number of likes
parallel_twitter.examples.pull_users_posts(
users=user_ids,
apis=apis
)
Comparison with Twint
Twint is a Python library for scraping data from Twitter.
- From Twint's documentation: "Twitter limits scrolls while browsing the user timeline. This means that with .Profile or with .Favorites you will be able to get ~3200 tweets." There are no such limits if you distribute your requests using
parallel-python-twitter. - Twitter will block your requests if you scrape enough (ex: https://github.com/twintproject/twint/issues/682). I've tested
parallel-python-twitterup to 100s of megabytes. - Technically,
twintviolates Twitter's Terms of Service, since scraping is not permitted in general.
Metadata
Release files for parallel-python-twitter 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 | Provenance | Actions |
|---|---|---|---|---|
| parallel-python-twitter-0.2.0.tar.gz | 10.1 kB | Without provenance | Details for parallel-python-twitter-0.2.0.tar.gz |
Release files / parallel-python-twitter-0.2.0.tar.gz
| Download URL | parallel-python-twitter-0.2.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
457c294305261086f2361258fe78cd6758b5d0fa25bcac2d00af100bdbeea145
|
|
BLAKE2b-256 checksum How to use checksums |
63b0680df2ee91880bed05865ff714584bfd07a460c7cbace37de25167d42b77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.6.0
|
Security for parallel-python-twitter 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.