Skip to content

Latest commit

 

History

History
243 lines (165 loc) · 8.6 KB

SOURCES.org

File metadata and controls

243 lines (165 loc) · 8.6 KB

This file is an overview of available sources along with descriptions and some guidance.

See instructions below for additional information.

Extra dependencies

Some sources require additional dependencies, which you can install if needed.

  • pip3 install --user promnesia[optional]

    dependencies that bring some bells & whistles: logzero, python-magic

  • pip3 install --user promnesia[HPI]

    dependencies for HPI: HPI

  • pip3 install --user promnesia[html]

    dependencies for sources.html: beautifulsoup4, lxml

  • pip3 install --user promnesia[markdown]

    dependencies for sources.markdown: mistletoe

  • pip3 install --user promnesia[org]

    dependencies for sources.org: orgparse

Alternatively, you can just install all of them in bulk: pip3 install --user promnesia[all].

Sources

These are included with the current Promnesia distribution:

Instructions

browser

The browser source here uses HPI, which uses browserexport to save/parse browser history. Since browsers remove old history after your history database has grown to a certain size, this saves the raw database files to a directory you specify. browserexport supports many browsers, including any Chromium/Firefox based browsers (e.g. Brave, Vivaldi, Waterfox). For more instructions on backing up databases, see here, but as a quickstart, after setting up HPI, run:

hpi module install my.browser.export

Then, to save your browser history, run a command like:

browserexport save -b firefox --to ~/data/browser_history
browserexport save -b chrome --to ~/data/browser_history
browserexport save -b safari --to ~/data/browser_history

This will save your browser history to a directory, which you can then point HPI at, in your HPI config:

class browser:
    class export:
        # path[s]/glob to your backed up browser history sqlite files
        export_path: Paths = "~/data/browsing/*.sqlite"

    class active_browser:
        # paths to sqlite database files which you use actively
        # to read from. For example:
        # from browserexport.browsers.all import Firefox
        # export_path = Firefox.locate_database()
        export_path: Paths

Finally, you can add the browser source to promnesia, in your config.py:

from promnesia.sources import browser

SOURCES = [
    browser,
    ...
]

Extending

Adding your own data sources is very easy! One day I’ll add some proper documentation, but the easiest at the moment is to use existing simple modules as a reference, for example:

After that, you can simply import your custom source in config.py, and use it, same way as any builtin source.