Reader API Command-Line Interface
This repository provides a command-line interface (CLI) for interacting with Readwise's Reader API. This tool allows you to interact with the API directly from your command line, making it easy to add and list documents from your Reader library.
Also, you can upload documents from your browser reading list, such as Chrome ReadingList.
Please note that future updates will include support for additional browsers.
Installation
Set up a virtual environment and then run:
pip install readwise-reader-cli
Usage
Before using the CLI, make sure to set the READER_API_TOKEN environment variable. You can obtain your API token here.
export READER_API_TOKEN={your_api_token}
The CLI provides the following commands:
Usage: python -m readercli [OPTIONS] COMMAND [ARGS]...
Interact with your Reader Library
Options:
--help Show this message and exit.
Commands:
add Add Document
lib Library breakdown
list List Documents
upload Upload Reading List File
validate Validate token
List Documents
Usage: python -m readercli list [OPTIONS]
List Documents
Options:
-l, --location [new|archive|later|feed]
Document(s) location
-c, --category [article|tweet|pdf|epub|email|note|video|highlight|rss]
Document(s) category
-a, --update-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
Updated after date in ISO format. Default:
last 24hrs.
-d, --date-range TEXT View documents updated after choosen time:
today, week, month.
-L, --layout [table|list] Display documents either as a list or table.
Default: table.
-n, --num-results INTEGER The number of documents to show.
-P, --pager Use to page output.
--help Show this message and exit.
Examples:
python -m readercli list --location archive
python -m readercli list --location archive --category article
python -m readercli list --location archive --category article --update-after 2023-01-01
python -m readercli list --location archive --category article --update-after 2023-01-01 --layout list
python -m readercli list --location archive --category article --date-range week
Layouts
Upload a Reading List (Google Chrome support only)
THINGS TO NOTE:
-
RATE LIMIT - Due to Reader's API rate limit of 20 requests per minute, a larger list will take a few minutes to upload.
-
LACK OF READING LIST APIs - There is no API to pull your ReadingList from Google, but it is being looked at here.
To upload your Chrome Reading List, you first need to download your data from your account, then follow these steps:
- Navigate to the Data & Privacy section.
- Find the "Download your data" option and click on it.
- A list of data to export will appear. Click "Deselect all" and then locate the Chrome section.
- Click "All Chrome data Included" and select ONLY "ReadingList".
- Save the downloaded
.htmlfile to your preferred directory and take note of the file path. - Run the
importcommand.
Usage: python -m readercli upload [OPTIONS] INPUT_FILE
Upload Reading List File
Options:
--file-type [html|csv]
--help Show this message and exit.
Examples:
python -m readercli upload /path/to/ReadingList.html
python -m readercli upload --file-type csv /path/to/ReadingList.csv
Add Document
Usage: python -m readercli add [OPTIONS] URL
Add Document
Options:
--help Show this message and exit.
Example:
python -m readercli add http://www.example.com
Library Overview
Usage: python -m readercli lib [OPTIONS]
Library breakdown
Options:
-V, --view [category|location|tags]
--help Show this message and exit.
python -m readercli lib
Category Breakdown
┏━━━━━━━━━━━━━┳━━━━━━━┓
┃ Name ┃ Count ┃
┡━━━━━━━━━━━━━╇━━━━━━━┩
│ 🖍️ highlight│ 724 │
│ 📡️ rss │ 391 │
│ ✉️ email │ 363 │
│ 📰️ article │ 264 │
│ 📝️ note │ 140 │
│ 📄️ pdf │ 83 │
│ 🐦️ tweet │ 25 │
│ 📹️ video │ 10 │
│ 📖️ epub │ 0 │
└─────────────┴───────┘
python -m readercli lib --view [location | tags]
Location Breakdown
┏━━━━━━━━━━━┳━━━━━━━┓
┃ Name ┃ Count ┃
┡━━━━━━━━━━━╇━━━━━━━┩
│ 🗄️ archive│ 1124 │
│ 🕑️ later │ 241 │
│ ⭐️ new │ 10 │
│ 📥️ feed │ 2 │
└───────────┴───────┘
python -m readercli lib --view tags
Tags Breakdown
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┓
┃ Name ┃ Count ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━┩
│ python │ 32 │
│ documentation │ 9 │
│ programming │ 7 │
│ github │ 7 │
│ git │ 6 │
│ packages │ 6 │
│ design-patterns │ 6 │
│ mac │ 1 │
└────────────────────────┴───────┘
Validate Token
Usage: python -m readercli validate [OPTIONS] TOKEN
Validate token
Options:
--help Show this message and exit.
Main Third-Party Libraries
Inspiration
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for readwise-reader-cli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| readwise_reader_cli-1.0.0.tar.gz | 15.6 kB | Without provenance | Details for readwise_reader_cli-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readwise_reader_cli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for readwise_reader_cli-1.0.0-py3-none-any.whl |
Total release size: 32.8 kB
Release files / readwise_reader_cli-1.0.0.tar.gz
| Download URL | readwise_reader_cli-1.0.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
141daa1c49202b30b993f0a0a9b4df1b2210405d745e18ee2cf13021d9c82f95
|
|
BLAKE2b-256 checksum How to use checksums |
8f338e3c08e54f4fb1493117f0b6f5fd19f2d2f8d9524d962355069ee769b0b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Release files / readwise_reader_cli-1.0.0-py3-none-any.whl
| Download URL | readwise_reader_cli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81fbfe430f9116d9dc1456fec1d0cbd43ee3aa742615d03f9e7c6c28a0aadcb8
|
|
BLAKE2b-256 checksum How to use checksums |
e27e8f16b7075cfc45b8c27240b24e551cc46a32690bcf5cbe02704925de2120
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.8
|
Security for readwise-reader-cli 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.