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"):
- go to "edit profile"
- click "<> Development"
- 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.
- click "Submit" and open the link to the created Application
- 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
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
Built Distribution
File details
Details for the file tootroll-0.1.2.tar.gz
.
File metadata
- Download URL: tootroll-0.1.2.tar.gz
- Upload date:
- Size: 9.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3c0ad8628e4a2aefed090815d96c1259500e9874a7f90438e240de3862206d |
|
MD5 | 6da838276e0361d0490ee8fe93197514 |
|
BLAKE2b-256 | 2a0e39ac684edfbc28a2a9165550b63fd42c5bdaa154764a2334f24b0ac21543 |
File details
Details for the file tootroll-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: tootroll-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba6dd595d45d9347fc20e520edbe803cb62ce928111a1b176e2f07cc8a5ba76c |
|
MD5 | 66a2854a383e750d20a08e41774e139a |
|
BLAKE2b-256 | 84ae0b1ef1f639658d94aebd30c7b14e350194a42e09c04f184b1d516f5708d6 |