GTdownloader
GTdownloader is a geographical tweets downloading tool that leverages the Twitter API
to retrieve tweets with geographical information and store them in easy access
formats like .csv and .shp.
Installation
pip
Use the package manager pip to install gtdownloader.
pip install gtdownloader
conda
Alternatively, install gtdownloader from the conda-forge channel by running the following command:
conda install -c conda-forge gtdownloader
Twitter keys
To set up your twitter keys file you need to have a developer account with access to the full-archive
search. If you plan to use this as part of academic research, you can apply for researcher
access to the API at Twitter Academic Research access.
After loging into your developer account, copy the consumer key, the consumer secret and the bearer token into a .yaml
file in the following way:
search_tweets_v2:
endpoint: https://api.twitter.com/2/tweets/search/all
consumer_key: YOUR_CONSUMER_KEY
consumer_secret: YOUR_CONSUMER_SECRET
bearer_token: YOUR_BEARER_TOKEN
Get started
from gtdownloader import TweetDownloader
# create downloader using Twitter API credentials
gtd = TweetDownloader(credentials='twitter_keys.yaml')
# get a batch of 400 tweets in english containing the word "tornado"
# between the dates 07/23/2022 and 07/29/2022
gtd.get_tweets('tornado',
lang='en',
max_tweets=400,
start_time='07/23/2022',
end_time='07/29/2022'
)
# accessing tweets data frame
gtd.tweets_df.head()
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Metadata
Release files for gtdownloader 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gtdownloader-1.0.1.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gtdownloader-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / gtdownloader-1.0.1.tar.gz
| Download URL | gtdownloader-1.0.1.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cc354e1a8ab5b30d057bbe9db57372d8d43b00976cc0c5214dec64abcadd5a0
|
|
BLAKE2b-256 checksum How to use checksums |
281796b07474aa0addebe54da1130e163f755d969a4b8842ff3ad672636dff73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / gtdownloader-1.0.1-py3-none-any.whl
| Download URL | gtdownloader-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
928663d826d2579f411c7d123b980a559e9777911bf43ed8be8c325b1e75daa0
|
|
BLAKE2b-256 checksum How to use checksums |
05d679fe2eb611709d824e70bf3f950b33104e1496d1e4808f2a49745be44857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|