Skip to main content

Archive tweets from the command line

Project description

twarc

Note: twarc is no longer actively supported after changes to Twitter's API quotas made it unusable.


DOI

twarc is a command line tool and Python library for collecting and archiving Twitter JSON data via the Twitter API. It has separate commands (twarc and twarc2) for working with the older v1.1 API and the newer v2 API and Academic Access (respectively).

twarc has been developed with generous support from the Mellon Foundation.

Contributing

New features are welcome and encouraged for twarc. However, to keep the core twarc library and command line tool sustainable we will look at new functionality with the following principles in mind:

  1. Purpose: twarc is for collection and archiving of Twitter data via the Twitter API.
  2. Sustainability: keeping the surface area of twarc and it's dependencies small enough to ensure high quality.
  3. Utility: what is exposed by twarc should be applicable to different people, projects and domains, and not specific use cases.
  4. API consistency: as much as sensible we aim to make twarc consistent with the Twitter API, and also aim to make twarc consistent with itself - so commands in core twarc should work similarly to each other, and twarc functionality should align towards the Twitter API.

For features and approaches that fall outside of this, twarc enables external packages to hook into the twarc2 command line tool via click-plugins. This means that if you want to propose new functionality, you can create your own package without coordinating with core twarc.

Documentation

The documentation is managed at ReadTheDocs. If you would like to improve the documentation you can edit the Markdown files in docs or add new ones. Then send a pull request and we can add it.

To view your documentation locally you should be able to:

pip install -r requirements-mkdocs.txt
pip install -e .
mkdocs serve
open http://127.0.0.1:8000/

If you prefer you can create a page on the wiki to workshop the documentation, and then when/if you think it's ready to be merged with the documentation create an issue. Please feel free to create whatever documentation is useful in the wiki area.

Code

If you are interested in adding functionality to twarc or fixing something that's broken here are the steps to setting up your development environment:

git clone https://github.com/docnow/twarc
cd twarc

Create a .env file that included Twitter App keys to use during testing:

BEARER_TOKEN=CHANGEME
CONSUMER_KEY=CHANGEME
CONSUMER_SECRET=CHANGEME
ACCESS_TOKEN=CHANGEME
ACCESS_TOKEN_SECRET=CHANGEME

Now run the tests:

uv run pytest

Add your code and some new tests, and send a pull request!

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

twarc-2.14.1.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twarc-2.14.1-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

Details for the file twarc-2.14.1.tar.gz.

File metadata

  • Download URL: twarc-2.14.1.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for twarc-2.14.1.tar.gz
Algorithm Hash digest
SHA256 54537495c6575863769e82ba4a0db7d68538e7c5afa9b8fcc8856a0ae94d9fa0
MD5 51b567119957399cb55fb37e4dae2fbe
BLAKE2b-256 441eb124f63e6b220c0bd85abe062b77809a0cfd2e9e6d8aed25f9069687df5a

See more details on using hashes here.

File details

Details for the file twarc-2.14.1-py3-none-any.whl.

File metadata

  • Download URL: twarc-2.14.1-py3-none-any.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for twarc-2.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff49ae2a8fdb1be79653245bbf7ccd56b4a96a27bdba3b9f1daf8ea76f8cdbf2
MD5 a7047782be3821845bbc4b54fc97e65a
BLAKE2b-256 135e0c5232ffe8600713e9f10c44dea1813967715fe5998fd39978056dffd118

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page