MCPcopy
hub / github.com/jarun/buku

github.com/jarun/buku @v5.1.1 sqlite

repository ↗ · DeepWiki ↗ · release v5.1.1 ↗
799 symbols 2,614 edges 34 files 232 documented · 29%
README

buku

Latest release Availability PyPI Build Status Docs Status Privacy Awareness License

buku in action!

buku in action!

Introduction

buku is a powerful bookmark manager and a personal textual mini-web.

For those who prefer the GUI, bukuserver exposes a browsable front-end on a local web host server. See bukuserver page for config and screenshots.

When I started writing it, I couldn't find a flexible command-line solution with a private, portable, merge-able database along with seamless GUI integration. Hence, buku.

buku can import bookmarks from browser(s) or fetch the title, tags and description of a URL from the web. Use your favourite editor to add, compose and update bookmarks. Search bookmarks instantly with multiple search options, including regex and a deep scan mode (handy with URLs).

It can look up broken links on the Wayback Machine. There's an Easter Egg to revisit random bookmarks.

There's no tracking, hidden history, obsolete records, usage analytics or homing.

To get started right away, jump to the Quickstart section. buku has one of the best documentation around. The man page comes with examples. For internal details, please refer to the operational notes.

buku is a library too! There are several related projects, including a browser plug-in.

Table of Contents

Features

  • Store bookmarks with auto-fetched title, tags and description
  • Auto-import from Firefox, Google Chrome, Chromium, Vivaldi, Brave, and MS Edge
  • Open bookmarks and search results in browser
  • Browse cached page from the Wayback Machine
  • Text editor integration
  • Lightweight, clean interface, custom colors
  • Powerful search options (regex, substring...)
  • Continuous search with on the fly mode switch
  • Portable, merge-able database to sync between systems
  • Import/export bookmarks from/to HTML, XBEL, Markdown, RSS/Atom or Orgfile
  • Smart tag management using redirection (>>, >, <<)
  • Multi-threaded full DB refresh
  • Manual encryption support
  • Shell completion scripts, man page with handy examples
  • Privacy-aware (no unconfirmed user data collection)
  • Can be used as a Python library (API documentation)
  • Has a compation Web-application (Bukuserver) with an HTTP-based API (for personal use only)

Installation

Dependencies

Feature Dependency
Lang, SQLite Python 3.10+
HTTPS certifi, urllib3
Encryption cryptography
HTML beautifulsoup4, html5lib

To copy URL to clipboard buku uses xsel (or xclip) on Linux, pbcopy (default installed) on OS X, clip (default installed) on Windows, termux-clipboard on Termux (terminal emulation for Android), wl-copy on Wayland. If X11 is missing, GNU Screen or tmux copy-paste buffers are recognized.

From a package manager

To install buku with all its dependencies from PyPI, run:

# pip3 install buku

You can also install buku from your package manager. If the version available is dated try an alternative installation method.

Packaging status (expand)

Packaging status

Unlisted packagers:

PyPI (pip3 install buku)

● Termux (pip3 install buku)

Release packages

Auto-generated packages (with only the cli component) for Arch Linux, CentOS, Debian, Fedora, openSUSE Leap and Ubuntu are available with the latest stable release.

NOTE: CentOS may not have the python3-beautifulsoup4 package in the repos. Install it using pip3.

From source

If you have git installed, clone this repository. Otherwise download the latest stable release or development version (risky).

Install the dependencies. For example, on Ubuntu:

$ apt-get install ca-certificates python3-urllib3 python3-cryptography python3-bs4

Install the cli component to default location (/usr/local):

$ sudo make install

To remove, run:

$ sudo make uninstall

PREFIX is supported, in case you want to install to a different location.

Running standalone

buku is a standalone utility. From the containing directory, run:

$ chmod +x buku.py
$ ./buku.py

Shell completion

Shell completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of auto-completion/. Please refer to your shell's manual for installation instructions.

Usage

Command-line options

``` usage: buku [OPTIONS] [KEYWORD [KEYWORD ...]]

Bookmark manager like a text-based mini-web.

POSITIONAL ARGUMENTS: KEYWORD search keywords

GENERAL OPTIONS: -a, --add URL [+|-] [tag, ...] bookmark URL with comma-separated tags (prepend tags with '+' or '-' to use fetched tags) -u, --update [...] update fields of an existing bookmark accepts indices and ranges refresh title and desc if no edit options if no arguments: - update results when used with search - otherwise refresh all titles and desc -w, --write [editor|index] edit and add a new bookmark in editor else, edit bookmark at index in EDITOR edit last bookmark, if index=-1 if no args, edit new bookmark in EDITOR -d, --delete [...] remove bookmarks from DB accepts indices or a single range if no arguments: - delete results when used with search - otherwise delete all bookmarks --retain-order prevents reordering after deleting a bookmark -h, --help show this information and exit -v, --version show the program version and exit

EDIT OPTIONS: --url keyword bookmark link --tag [+|-] [...] comma-separated tags clear bookmark tagset, if no arguments '+' appends to, '-' removes from tagset --title [...] bookmark title; if no arguments: -a: do not set title, -u: clear title -c, --comment [...] notes or description of the bookmark clears description, if no arguments --immutable N disable web-fetch during auto-refresh N=0: mutable (default), N=1: immutable --swap N M swap two records at specified indices

SEARCH OPTIONS: -s, --sany [...] find records with ANY matching keyword this is the default search option -S, --sall [...] find records matching ALL the keywords special keywords - "blank": entries with empty title/tag "immutable": entries with locked title --deep match substrings ('pen' matches 'opens') --markers search for keywords in specific fields based on (optional) prefix markers: '.' - title, '>' - description, ':' - URL, '#' - tags (comma-separated, PARTIAL matches) '#,' - tags (comma-separated, EXACT matches) '*' - any field (same as no prefix) -r, --sreg expr run a regex search -t, --stag [tag [,|+] ...] [- tag, ...] search bookmarks by tags use ',' to find entries matching ANY tag use '+' to find entries matching ALL tags excludes entries with tags after ' - ' list all tags, if no search keywords -x, --exclude [...] omit records matching specified keywords --random [N] output random bookmarks out of the selection (default 1) --order fields [...] comma-separated list of fields to order the output by (prepend with '+'/'-' to choose sort direction)

ENCRYPTION OPTIONS: -l, --lock [N] encrypt DB in N (default 8) # iterations -k, --unlock [N] decrypt DB in N (default 8) # iterations

POWER TOYS: --ai auto-import bookmarks from web browsers Firefox, Chrome, Chromium, Vivaldi, Brave, Edge (Firefox profile can be specified using environment variable FIREFOX_PROFILE) -e, --export file export bookmarks to Firefox format HTML export XBEL, if file ends with '.xbel' export Markdown, if file ends with '.md' format: title export Orgfile, if file ends with '.org' format: [[url][title]] :tags: export rss feed if file ends with '.rss'/'.atom' export buku DB, if file ends with '.db' combines with search results, if opted -i, --import file import bookmarks from file supports .html .xbel .json .md .org .rss .atom .db (.json = Firefox backup; .db = another Buku DB) -p, --print [...] show record details by indices, ranges print all bookmarks, if no arguments -n shows the last n results (like tail) -f, --format N limit fields in -p or JSON search output N=1: URL; N=2: URL, tag; N=3: title; N=4: URL, title, tag; N=5: title, tag; N0 (10, 20, 30, 40, 50) omits DB index -j, --json [file] JSON formatted output for -p and search. prints to stdout if argument missing. otherwise writes to given file --colors COLORS set output colors in five-letter string --nc disable color output -n, --count N show N results per page (default 10) --np do not show the subprompt, run and exit -o, --open [...] browse bookmarks by indices and ranges open a random bookmark, if no arguments --oa browse all search results immediately --default-scheme S if scheme is missing from uri, assume S when opening in browser (default http) --replace old new replace old tag with new tag everywhere delete old tag, if new tag not specified --url-redirect when fetching an URL, use the resulting URL from following permanent* redirects (when combined with --export, the old URL is included as additional metadata) --tag-redirect [tag] when fetching an URL that causes permanent redirect, add a tag in specified pattern (using 'http:{}' if not specified) --tag-error [tag] when fetching an URL that causes an HTTP error, add a tag in specified pattern (using 'http:{}' if not specified) --del-error [...] when fetching an URL causes any

Core symbols most depended-on inside this repo

get
called by 93
bukuserver/api.py
_add_rec
called by 54
tests/util.py
parse_tags
called by 49
buku.py
get_rec_by_id
called by 29
buku.py
close
called by 29
buku.py
add_rec
called by 25
buku.py
apply
called by 23
bukuserver/filters.py
get_rec_all
called by 22
buku.py

Shape

Function 493
Method 238
Class 49
Route 19

Languages

Python78%
TypeScript22%

Modules by API surface

bukuserver/static/bukuserver/js/Chart.js170 symbols
buku.py165 symbols
tests/test_bukuDb.py87 symbols
bukuserver/views.py71 symbols
tests/test_buku.py50 symbols
bukuserver/filters.py44 symbols
bukuserver/api.py34 symbols
tests/test_views.py33 symbols
bukuserver/forms.py23 symbols
tests/test_cli.py20 symbols
tests/test_server.py19 symbols
bukuserver-runner/buku-server.py19 symbols

Dependencies from manifests, versioned

Flask2.2.2 · 1×
Flask-Admin2.0.0 · 1×
Flask-WTF1.0.1 · 1×
Jinja23 · 1×
arrow1.2.2 · 1×
beautifulsoup44.4.1 · 1×
certifi
colorama0.4.6 · 1×
cryptography1.2.3 · 1×
flask-paginate2022.1.8 · 1×
html5lib1.0.1 · 1×
urllib31.23 · 1×

For agents

$ claude mcp add buku \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact