Skip to main content

filum

filum is a command-line tool that saves discussion threads to your local machine.

It's like a bookmark manager that saves actual content rather than just the link pointing to it.

Like Pocket and Instapaper, it extracts text content for an uncluttered experience—specifically for discussion threads on Reddit, Hacker News, and Stack Exchange.

Fully supported on Linux and mostly works on Windows (use WSL for the ideal experience). Not tested on MacOS.

asciicast

A table rendered in the terminal

A Hacker News thread rendered in the terminal

Installation

  1. Create a virtual environment for filum (optional but recommended).

    Linux:

    $ python3 -m venv /path/to/new/venv

    Windows:

    $ c:\Python35\python -m venv c:\path\to\new\venv

    For more details click here.

  2. Install from PyPI.

    python3 -m pip install filum

  3. Activate the virtual environment.

    Linux:

    $ source /path/to/venv/bin/activate

    Windows:

    $ \path\to\venv\Scripts\Activate

    Now you can run the commands in the following section.

Usage

Save a new thread

$ filum add <url>

Example:

$ filum add https://www.reddit.com/r/Python/comments/v1rde4/whats_a_python_feature_that_is_very_powerful_but/ianzrfp/

You may supply a permalink to a child node of the thread to save only a specific section of the thread.

The following platforms are supported: Reddit, Hacker News, Stack Exchange.

View information about currently saved threads

$ filum show

The left-most column of the table contains values to be used as selectors (in place of <id>) for the subsequent commands.

Note that the values in the ID column are dynamic. Run $ filum show each time after you modify the database to see all updated changes.

View a specific thread

$ filum show <id>

Example:

$ filum show 2 for the thread in the table with '2' in the ID column.

The thread is piped through a terminal pager by default. To disable this, run $ filum config and edit pager = true to pager = false.

If you use a pager, you can navigate between nodes in the thread by searching for the ¬ symbol (yes very hacky).

Delete a thread

$ filum delete <id>

Example:

$ filum delete 2 for the thread in the table with '2' in the ID column.

Update a thread

$ filum update <id>

Example:

$ filum update 2 for the thread in the table with '2' in the ID column.

filum will offer to update a thread if you try to add a thread that's already saved in the database.

Add tags to a saved thread

$ filum tags <id> <tag 1>,<tag 2>,...

Example:

$ filum tags 2 python webdev to add the tags "python" and "webdev" to the thread in the table with '2' in the ID column.

Delete tags from a saved thread

$ filum tags <id> <tag 1>,<tag 2>, ... --delete

Example:

$ filum tags 2 webdev --delete to remove the tag "webdev" from the thread in the table with '2' in the ID column.

Show all current tags

$ filum tags

Search for a thread

Full-text search of saved threads is currently unavailable. However, you can filter the threads by tags or by source.

$ filum show --tags <tag>

$ filum show --source <source>

You can now select a thread based on the filtered table.

$ filum show --tags <tag> <id>

$ filum show --source <source> <id>

Save a thread to the Wayback Machine

$ filum archive <id>

Re-running this command on a thread you have already saved to the Wayback Machine will prompt you to confirm whether you want to save a new snapshot. Currently only the latest snapshot is saved.

This feature depends on the availability of the Wayback Machine's Save Page Now service, which is under incredibly high demand. Please be mindful when using this command.

Show the URL of a Wayback Machine snapshot: $ filum archive --url

Visit a Wayback Machine snapshot: $ filum archive --open

Interactive mode

Run $ filum -i to start an interpreter where you can use filum subcommands without specifying the filum keyword.

Configuration options

  • pager: Pipes thread output to your default pager. Defaults to true.

  • pager_colours: Enables coloured pager output. Note that you may need to tweak your environment variables for this to work. Defaults to true.

  • hyperlinks: Enables hyperlink rendering in Markdown. Not all terminals support this. Defaults to false.

  • max_rows_without_pager: Sets the maximum number of rows of the table returned by filum show above which the table should be displayed via the pager.

Known limitations

These are on my to-do list to improve.

  • Reddit comment sub-threads that are hidden under a comment fold (with a "load more comments" link) are ignored
  • The search command only takes in one search string at a time
  • Filters for searching cannot be combined, e.g. you can search either by a tag or by source
  • Look into alternatives to the Wayback Machine for archival (although archive.today makes it really painful to work with using scripts)
  • I may add support for discussion threads on other websites and forums in the future

If you find any bugs (of which there will be many), please file it in a GitHub issue.

Contributing

Not currently open to pull requests, but questions and suggestions are more than welcome. Feel free to open a GitHub issue.

Disclaimer

filum is alpha software and far from stable. Please do not rely solely on filum for archival—at the very least bookmark the page or use the save feature on the respective platforms.

Metadata

Release files for filum 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filum 0.1.0
File Size Uploaded Provenance Actions
filum-0.1.0.tar.gz 27.5 kB Without provenance Details for filum-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for filum 0.1.0
File Interpreter ABI Platform Actions
filum-0.1.0-py3-none-any.whl Python 3 none any Details for filum-0.1.0-py3-none-any.whl

Total release size: 55.3 kB

Release files / filum-0.1.0.tar.gz

Download URL filum-0.1.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fabf2efd9c0b4aac40ae73713663ccf5678d598d962f3e8dcdb20bf66d1b8a0e
BLAKE2b-256 checksum
How to use checksums
12d383ac2702f30a9341362505d91cfc65faf38d342dcf6cdceceaf61cdce645
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / filum-0.1.0-py3-none-any.whl

Download URL filum-0.1.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24fc918a7ee1c76b1dd6705417db98625ff8a1d1c643498af46c86a8cb4475b7
BLAKE2b-256 checksum
How to use checksums
d57f5516286400f761c75be6411c2fb355f69ddb0d99c8a17c1fdf128dd41067
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Security for filum 0.1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page