Tools for interacting with Twitter archive/takeout files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Tim Weber c7cd325983
Implement basic `twakeout render` command
2 months ago
example_templates Implement basic `twakeout render` command 2 months ago
twakeout Implement basic `twakeout render` command 2 months ago
.gitignore
LICENSE.txt
README.md Implement basic `twakeout render` command 2 months ago
poetry.lock Implement basic `twakeout render` command 2 months ago
pyproject.toml Implement basic `twakeout render` command 2 months ago

README.md

Twakeout

Tools for interacting with Twitter archive/takeout files.

Goal

For now:

  • Be able to create a web page that contains links to all of the tweets in the archive. The idea is to then point Save Page Now to that page and have it archive everything. Not sure whether thats gonna work at all for large datasets.

Status

Work in progress. Not yet ready for general use, you need to be somewhat tech-savvy. It helps to be a Python programmer.

That being said, currently it can:

  • access tweets inside the ZIP file, i.e. without unpacking first (in fact it doesnt work with extracted data)
  • gather really basic statistics
  • print the permalinks to the tweets in the archive
  • render arbitrary Jinja templates with your Tweets as input
  • sort by creation date
  • group by year/month/date
  • work with large archives that contain tweets-partN.js files

Installation

  • Clone this repo.
  • Run poetry install. (You need Poetry, of course.)
  • Done.

If you dont want to install Poetry and know what youre doing, you might get away with installing the dependencies listed in pyproject.toml manually.

Running

# Get an overview of the available commands.
poetry run python -m twakeout --help

# Get help on a subcommand.
poetry run python -m twakeout render --help

# Create one HTML file per year, containing links to all of your tweets from that year.
poetry run python -m twakeout render --jinja example_templates/tweet_links.html --for-each year --output '{username}-{year}.tweets.html' --archive twitter-archive.zip

Bugs

  • The CLI interface isnt well documented.
  • In fact, this whole project isnt well documented. Im sorry, Im in a bit of a hurry.
  • We should probably provide an entrypoint script instead of relying on python -m.
  • Sorting/grouping currently doesnt work with large archives (i.e. those having tweets-partN.js files). This will be fixed ASAP.

Contact