Skip to main content

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.

GitHub

License

MIT

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)

Source distribution for gtdownloader 1.0.1
File Size Uploaded
gtdownloader-1.0.1.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gtdownloader 1.0.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

1 release file

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page