Skip to main content

Tootroll is a Python package to read timelines from the Mastodon network.

Project description

Tootroll

Tootroll is a Python package to read timelines from the Mastodon network.

Prerequisites

Python

Python 3.7 or higher is required to run this package.

Mastodon account (optional)

To read public timelines an account is not needed.

A Mastodon account is required to read the Home timeline. To setup a Mastodon account, visit: joinmastodon.org.

To acquire a (private) API key ("access token"):

  1. go to "edit profile"
  2. click "<> Development"
  3. click "New application" Application name can be anything. Leave the Redirect URI unchanged. Because we only want to read timelines, we recommend to only check "read" for Scopes. Write and follow is not needed.
  4. click "Submit" and open the link to the created Application
  5. Copy the "access token" (Client key and secret are not needed)

Install

The package can be installed from PyPI:

python -m pip install tootroll

Quick setup

Configure public (default) profile

When installed for the first time, API keys must be configured.
To allow easy switching between servers, public/ private APIs the package allows to define multiple named profiles.

To setup the default profile, run the following command and follow instructions. Pick a server from the list or set your own (hostname of Mastodon server). For the default profile, we recommend to say (N)o when asked for private API key.

python -m tootroll --configure

Test if it works by getting timeline data for 1 toot.

python -m tootroll --pub --limit 1

Pipe through a JSON parser

python -m tootroll --pub --limit 5 |python -m json.tool

Configure private profile

python -m tootroll --configure --profile myProfile

When asked to use private API, type (Y)es.
Copy the access token from your Mastodon account.

All configuration files are stored under ~/.tootroll.

python -m tootroll --home --profile myProfile --limit 5 |python -m json.tool

Usage

python -m tootroll --help
usage: tootroll [-h] [--pub | --home | --tags TAGS | --configure | --show [profiles]] [--profile PROFILE] [-l LIMIT]

options:
  -h, --help            show this help message and exit
  --pub                 Show public timeline of server
  --home                Show home timeline
  --tags TAGS           Tag(s). Use comma-separated string to pass a list
  --configure           Create or update a profile
  --show [profiles]     Show configuration (e.g. list of profiles)
  --profile PROFILE     Select a profile to use. If left empty, lists configured profiles
  -l LIMIT, --limit LIMIT
                        Limit number of toots. Defaults to 10

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tootroll-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

tootroll-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file tootroll-0.1.1.tar.gz.

File metadata

  • Download URL: tootroll-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.15.0-53-generic

File hashes

Hashes for tootroll-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7c20fe8174987d0ddfe5a05822272eac0210ed1fdf94e3f8ad181f9f9d6abe80
MD5 37d4b2647738ba93e7af39d45482aecd
BLAKE2b-256 caf03883f1181936f70ae9418276d749d335aa27c5f9494f2bc393bf1355e943

See more details on using hashes here.

File details

Details for the file tootroll-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tootroll-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.15.0-53-generic

File hashes

Hashes for tootroll-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c7dc89ff3e0d6604b5ceae5fb9ea9326ada38f35e6efd507ae696feed9b831f
MD5 79c1d29ac0af1ec94c6f26d2bc471a8e
BLAKE2b-256 93d0743dab91132a7f58d01ab3f3e4bd95267bd0901bbc18091a5ed2559bb95f

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