buku Documentation

Bookmark: Personal mini-web in text

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy buku on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name buku -p 5001:5001 --restart always bukuserver/bukuserver
Configured Services & Ports
โš™๏ธ bukuserver
image: bukuserver/bukuserver
๐Ÿ”Œ Ports: 5001:5001
โš™๏ธ nginx
image: nginx:alpine
๐Ÿ”Œ Ports: 80:80
docker-compose.yml
yaml (docker-compose.yml)
services:
  bukuserver:
    image: bukuserver/bukuserver
    restart: unless-stopped
    environment:
      - BUKUSERVER_PER_PAGE=100
      - BUKUSERVER_OPEN_IN_NEW_TAB=true
      # - BUKUSERVER_SECRET_KEY=123456789012345678901234
      # - BUKUSERVER_URL_RENDER_MODE=full
      # - BUKUSERVER_DISABLE_FAVICON=false
    ports:
      - "5001:5001"
    volumes:
      - ./data:/root/.local/share/buku

  nginx:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - ./data/nginx:/etc/nginx/conf.d
      - ./data/basic_auth:/basic_auth

File: README.md

buku

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, Vivaldi Beta (Internal), 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:

text
# 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)

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:

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

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

text
$ sudo make install

To remove, run:

text
$ 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:

text
$ 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

text
/* Detailed source-code truncated for AI context efficiency. */

Colors

buku supports custom colors. Visit the wiki page on how to customize colors for more details.

Quickstart

  1. Export VISUAL or EDITOR to point to your favourite editor. Note that VISUAL takes precedence over EDITOR.

  2. Create a sweeter shortcut with some convenience.

    text
    alias b='buku --suggest'
  3. Auto-import bookmarks from your browser(s). Please quit the relevant browsers beforehand to ensure the databases are not locked.

    text
    b --ai
  4. Manually add a bookmark (for hands-on).

    text
    b -w
  5. List your bookmarks with DB index.

    text
    b -p
  6. For GUI and browser integration (or to sync bookmarks with your favourite bookmark management service) refer to the wiki page on System integration.

  7. Quick (bash/zsh) commands to fuzzy search with fzf and open the selection in Firefox:

    text
    firefox $(buku -p -f 10 | fzf)
    firefox $(buku -p -f 40 | fzf | cut -f1)

    POSIX script to show a preview of the bookmark as well:

    sh
    #!/usr/bin/env sh
    
    url=$(buku -p -f4 | fzf -m --reverse --preview "buku -p {1}" --preview-window=wrap | cut -f2)
    
    if [ -n "$url" ]; then
        echo "$url" | xargs firefox
    fi

Examples

  1. Edit and add a bookmark from editor:

    text
    $ buku -w
    $ buku -w 'gedit -w'
    $ buku -w 'macvim -f' -a https://ddg.gg search engine, privacy

    The first command picks editor from the environment variable EDITOR. The second command opens gedit in blocking mode. The third command opens macvim with option -f and the URL and tags populated in template.

  2. Add a simple bookmark:

    text
    $ buku --nostdin -a https://github.com/
    2648. GitHub: Letโ€™s build from here ยท GitHub
    > https://github.com/
    + GitHub is where over 94 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs
     and features, power your CI/CD and DevOps workflows, and secure code before you commit it.
    
    $ buku --nostdin -a https://github.com/
    [ERROR] URL [https://github.com/] already exists at index 2648

    >: URL, +: comment, #: tags

    Title, description and tags will be fetched from site. Buku only stores unique URLs and will raise error if the URL already present in the database:

  3. Add a bookmark with tags search engine and privacy, comment Search engine with perks, fetch page title from the web:

    text
    $ buku -a https://ddg.gg search engine, privacy -c Search engine with perks
    336. DuckDuckGo
    > https://ddg.gg
    + Alternative search engine with perks
    # privacy,search engine

    where, >: URL, +: comment, #: tags

  4. Add a bookmark with tags search engine & privacy and immutable custom title DDG:

    text
    $ buku -a https://ddg.gg search engine, privacy --title 'DDG' --immutable 1
    336. DDG (L)
    > https://ddg.gg
    # privacy,search engine

    Note that URL must precede tags.

  5. Add a bookmark without a title (works for update too):

    text
    $ buku -a https://ddg.gg search engine, privacy --title
  6. Edit and update a bookmark from editor:

    text
    $ buku -w 15012014

    This will open the existing bookmark's details in the editor for modifications. Environment variable EDITOR must be set.

  7. Update existing bookmark at index 15012014 with new URL, tags and comments, fetch title from the web:

    text
    $ buku -u 15012014 --url http://ddg.gg/ --tag web search, utilities -c Private search engine
  8. Fetch and update only title for bookmark at 15012014:

    text
    $ buku -u 15012014
  9. Update only comment for bookmark at 15012014:

    text
    $ buku -u 15012014 -c this is a new comment

    Applies to --url, --title and --tag too.

  10. Export bookmarks tagged tag 1 or tag 2 to HTML, XBEL, Markdown, Orgfile or a new database:

    $ buku -e bookmarks.html --stag tag 1, tag 2
    $ buku -e bookmarks.xbel --stag tag 1, tag 2
    $ buku -e bookmarks.md --stag tag 1, tag 2
    $ buku -e bookmarks.org --stag tag 1, tag 2
    $ buku -e bookmarks.db --stag tag 1, tag 2
    All bookmarks are exported if search is not opted.

  11. Import bookmarks from HTML, XBEL, Markdown or Orgfile:

    text
    $ buku -i bookmarks.html
    $ buku -i bookmarks.xbel
    $ buku -i bookmarks.md
    $ buku -i bookmarks.org
    $ buku -i bookmarks.db
  12. Delete only comment for bookmark at 15012014:

    text
    $ buku -u 15012014 -c

    Applies to --title and --tag too. URL cannot be deleted without deleting the bookmark.

  13. Update or refresh full DB with page titles from the web:

    text
    $ buku -u
    $ buku -u --tacit (show only failures and exceptions)

    This operation can update the title or description fields of non-immutable bookmarks by parsing the fetched page. Fields are updated only if the fetched fields are non-empty. Tags remain untouched.

  14. Delete bookmark at index 15012014:

    text
    $ buku -d 15012014
    Index 15012020 moved to 15012014

    The last index is moved to the deleted index to keep the DB compact. Add --tacit to delete without confirmation.

  15. Delete all bookmarks:

    text
    $ buku -d
  16. Delete a range or list of bookmarks:

    text
    $ buku -d 100-200
    $ buku -d 100 15 200
  17. Search bookmarks for ANY of the keywords kernel and debugging in URL, title or tags:

    text
    $ buku kernel debugging
    $ buku -s kernel debugging
  18. Search bookmarks with ALL the keywords kernel and debugging in URL, title or tags:

    text
    $ buku -S kernel debugging
  19. Search bookmarks tagged general kernel concepts:

    text
    $ buku --stag general kernel concepts
  20. Search for bookmarks matching ANY of the tags kernel, debugging, general kernel concepts:

    text
    $ buku --stag kernel, debugging, general kernel concepts
  21. Search for bookmarks matching ALL of the tags kernel, debugging, general kernel concepts:

    text
    $ buku --stag kernel + debugging + general kernel concepts
  22. Search for bookmarks matching any of the keywords hello or world, excluding the keywords real and life, matching both the tags kernel and debugging, but excluding the tags general kernel concepts and books:

    text
    $ buku hello world --exclude real life --stag 'kernel + debugging - general kernel concepts, books'
  23. Search for bookmarks with different tokens for each field, and print them out sorted by the tags (ascending) and URL (descending)

    text
    $ buku --order +tags,-url --markers --sall 'global substring' '.title substring' ':url substring' :https '> description substring' '#partial,tags:' '#,exact,tags' '*another global substring'
  24. List all unique tags alphabetically:

    text
    $ buku --stag
  25. Run a search and update the results:

    text
    $ buku -s kernel debugging -u --tag + linux kernel
  26. Run a search and delete the results:

    text
    $ buku -s kernel debugging -d
  27. Encrypt or decrypt DB with custom number of iterations (15) to generate key:

    text
    $ buku -l 15
    $ buku -k 15

    The same number of iterations must be specified for one lock & unlock instance. Default is 8, if omitted.

  28. Show details of bookmarks at index 15012014 and ranges 20-30, 40-50:

    text
    $ buku -p 20-30 15012014 40-50
  29. Show details of the last 10 bookmarks:

    text
    $ buku -p -10
  30. Show all bookmarks with real index from database:

    text
    $ buku -p
    $ buku -p | more
  31. Replace tag 'old tag' with 'new tag':

    text
    $ buku --replace 'old tag' 'new tag'
  32. Delete tag 'old tag' from DB:

    text
    $ buku --replace 'old tag'
  33. Append (or delete) tags 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:

    text
    $ buku -u 15012014 --tag + tag 1, tag 2
    $ buku -u 15012014 --tag - tag 1, tag 2
  34. Open URL at index 15012014 in browser:

    text
    $ buku -o 15012014
  35. List bookmarks with no title or tags for bookkeeping:

    text
    $ buku -S blank
  36. List bookmarks with immutable title:

    text
    $ buku -S immutable
  37. Append, remove tags at prompt (taglist index to the left, bookmark index to the right):

    text
    // append tags at taglist indices 4 and 6-9 to existing tags in bookmarks at indices 5 and 2-3
    buku (? for help) g 4 9-6 >> 5 3-2
    // set tags at taglist indices 4 and 6-9 as tags in bookmarks at indices 5 and 2-3
    buku (? for help) g 4 9-6 > 5 3-2
    // remove all tags from bookmarks at indices 5 and 2-3
    buku (? for help) g > 5 3-2
    // remove tags at taglist indices 4 and 6-9 from tags in bookmarks at indices 5 and 2-3
    buku (? for help) g 4 9-6 << 5 3-2
  38. List bookmarks with colored output:

    text
    $ buku --colors oKlxm -p
  39. Add a bookmark after following all permanent redirects, but only if the server doesn't respond with an error (and there's no network failure)

    text
    $ buku --add http://wikipedia.net --url-redirect --del-error
    2. Wikipedia
       > https://www.wikipedia.org/
       + Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.
  40. Add a bookmark with tag http redirect if the server responds with a permanent redirect, or tag shaped like http 404 on an error response:

    text
    $ buku --add http://wikipedia.net/notfound --tag-redirect 'http redirect' --tag-error 'http {}'
    [ERROR] [404] Not Found
    3. Not Found
       > http://wikipedia.net/notfound
       # http 404,http redirect
  41. Update all bookmarks matching the search by updating the URL if the server responds with a permanent redirect, deleting the bookmark if the server responds with HTTP error 400, 401, 402, 403, 404 or 500, or adding a tag shaped like http:{} in case of any other HTTP error; then export those affected by such changes into an HTML file, marking deleted records as well as old URLs for those replaced by redirect.

    text
    $ buku -S ://wikipedia.net -u --url-redirect --tag-error --del-error 400-404,500 --export-on --export backup.html
  42. Print out a single random bookmark:

    text
    $ buku --random --print
  43. Print out 3 random bookmarks ordered by netloc (reversed), title and url:

    text
    $ buku --random 3 --order ,-netloc,title,+url --print
  44. Print out a single random bookmark matching search criteria, and export into a Markdown file (in DB order):

    text
    $ buku --random -S kernel debugging --export random.md
  45. Swap positions of records #4 and #5:

    text
    $ buku --swap 4 5
  46. Update indices in all bookmarks to match specified order:

    text
    $ buku --reorder ,-netloc,title,+url
  47. More help:

    text
    $ buku -h
    $ man buku

Automation

Interactive workflows can be automated using expect. Issue #368 has a working example on automating auto-import.

Troubleshooting

Editor integration

You may encounter issues with GUI editors which maintain only one instance by default and return immediately from other instances. Use the appropriate editor option to block the caller when a new document is opened. See issue #210 for gedit.

Collaborators

Copyright ยฉ 2015-2026 Arun Prakash Jana

Contributions

Missing a feature? There's a rolling ToDo List with identified tasks. Contributions are welcome! Please follow the PR guidelines.

See also our documentation here

  • bukubrow, WebExtension for browser integration
  • oil, search-as-you-type cli front-end
  • buku_run, rofi front-end
  • pinku, a Pinboard-to-buku import utility
  • buku-dmenu, a simple bash dmenu wrapper
  • poku, sync between Pocket and buku
  • Ebuku, Emacs interface to buku
  • diigoku, buku importer for Diigo
  • BukuBot, Chat bot for XMPP with an extended visual interface

Videos

In the Press


File: bukuserver/README.md

Bukuserver

Note: see the runner script for advanced installation/running/DB swapping functionality

Table of Contents

Installation

You need to have some packages before you install bukuserver on your server.
So be sure to have python3, python3-pip , python3-dev, libffi-dev packages from your distribution.

Dependencies

text
$ # venv activation (for development)
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip

From PyPi

sh
$ # regular/venv install
$ pip3 install "buku[server]"
$ # pipx install
$ pipx install "buku[server]"
$ # with locales
$ pipx install "buku[server,locales]"

From source

sh
$ git clone https://github.com/jarun/buku
$ cd buku
$ # regular/venv install
$ pip3 install ".[server]"
$ # with locales
$ pip3 install ".[server,locales]"

Using Docker

To build the image execute the command from the root directory of the project:

sh
docker build -t bukuserver .

To run the generated image.

sh
docker run -it --rm -v ~/.local/share/buku:/root/.local/share/buku -p 5001:5001 bukuserver

All the data generated will be stored in the ~/.local/share/buku directory.
Feel free to change it to the full path of the location you want to store the
database.

Visit 127.0.0.1:5001 in your browser to access your bookmarks.

Using Docker Compose

There is a docker-compose.yml file present in the docker-compose directory
in the root of this project. You may modify the configurations in this file to
your liking, and then simply execute the below command.

sh
docker-compose up -d

You will have you bukuserver running on port port 80 of the host.

To stop simply run

sh
docker-compose down

In case you want to add basic auth to your hosted instance you may do so by
creating a .htpasswd file in the data/basic_auth directory. Add a user to
the file using

sh
htpasswd -c data/basic_auth/.htpasswd your_username

And then comment out the basic auth lines from the data/nginx/nginx.conf file.

For more information please refer the nginx docs.

Webserver options

To run the server on host 127.0.0.1, port 5001, run following command:

text
$ bukuserver run --host 127.0.0.1 --port 5001

Visit 127.0.0.1:5001 in your browser to access your bookmarks.

See more option on bukuserver run --help and bukuserver --help

Configuration

The following are os env config variables available for bukuserver.

Important: all of them have a shared prefix BUKUSERVER_.

Name (without prefix) Description Value ยฒ
PER_PAGE bookmarks per page positive integer [default: 10]
SECRET_KEY flask secret key string [default: random value]
URL_RENDER_MODE url render mode full, netloc or netloc-tag [default: full]
DB_FILE full path to db fileยณ path string [default: standard path for buku]
READONLY read-only mode booleanยน [default: false]
DISABLE_FAVICON disable bookmark favicons booleanยน [default: true] (here's why)
AUTOFETCH initial Fetch value in Create form booleanยน [default: true]
OPEN_IN_NEW_TAB url link open in new tab booleanยน [default: false]
REVERSE_PROXY_PATH reverse proxy pathโต string
SERVER_NAME canonical host:port for URL generationโถ string (e.g. example.com:443)
THEME GUI theme string [default: default] (slate is a good pick for dark mode)
LOCALE GUI languageโด (partial support) string [default: en]
DEBUG debug mode (verbose logging etc.) booleanยน [default: false]

ยน valid boolean values are true, false, 1, 0 (case-insensitive).

ยฒ if input is invalid, the default value will be used if defined

ยณ BUKUSERVER_DB_FILE can be a DB name (plain filename without extension; cannot contain .). The specified DB with .db extension is located in default DB directory (which you can override with BUKU_DEFAULT_DBDIR).

โด BUKUSERVER_LOCALE requires buku to be installed with [locales]

โต the value for BUKUSERVER_REVERSE_PROXY_PATH is recommended to include preceding slash and not have trailing slash (i.e. use /foo not /foo/)

โถ BUKUSERVER_SERVER_NAME mitigates Host header injection. When set, absolute URLs (e.g. bookmarklet) use this value instead of the client-supplied Host. Recommended for production and reverse proxy deployments.

How to specify environment variables

E.g. to set bukuserver to show 100 items per page run the following command:

text
# on linux
$ export BUKUSERVER_PER_PAGE=100

# on windows
$ SET BUKUSERVER_PER_PAGE=100

# in dockerfile
ENV BUKUSERVER_PER_PAGE=100

# in env file
BUKUSERVER_PER_PAGE=100

Note: an env file can be supplied either by providing --env-file CLI argument (requires python-dotenv installed),
or as config for the runner script.

Why favicons are disabled by default

At Bukuserver, we have disabled favicon as a default setting in order to prevent any non-user triggered network activity.

Our favicon is generated with the assistance of Google.

It is important to be aware that favicon has the potential to be used for browser fingerprinting,
a technique used to identify and track a person's web browsing habits.

It is important to note that favicon can potentially be exploited in this way.

API

Bukuserver implements a RESTful API that provides an HTTP-based interface for the main functionality.

The API root is at /api; you can also access a Swagger-based interactive doc at the endpoint /apidocs (e.g. http://localhost:5000/apidocs).

Note: unlike regular IDs, indices aren't static; they're likely to change if used with ID

  • /api/tags can be used to GET the list of all tags
  • /api/tags/{tag} can be used to GET information on specified tag, as well as DELETE or replace it with new tags (PUT) in all bookmarks
  • /api/bookmarks can be used to GET or DELETE all bookmarks, as well as create (POST) a new one
  • /api/bookmarks/{index} can be used to GET, DELETE or update (PUT) an existing bookmark
  • /api/bookmarks/{start_index}/{end_index} can be used to GET, DELETE or update (PUT) bookmarks in existing index range
  • /api/bookmarks/search can be used to GET or DELETE bookmarks matching the query (you can use it to obtain current index by URL)
  • /api/bookmarks/{index}/tiny can be used to GET a shortened URL (the service providing this functionality is no longer available)
  • /api/bookmarks/{index}/refresh can be used to update (POST) data for a bookmark by remotely fetching & parsing the URL
  • /api/bookmarks/refresh can be used to update (POST) data for all bookmarks by remotely fetching & parsing the URLs
  • /api/fetch_data can be used to invoke (POST) the fetch+parse functionality for an arbitrary URL
  • /api/network_handle can be used to invoke (POST) the fetch+parse functionality for an arbitrary URL (outdated interface)

Also note that certain POST/DELETE endpoints (bookmarks search & data fetch) expect their parameters in urlencoded format, while others expect JSON.

Screenshots

Note: more screenshots (to show off default & slate themes) can be found on the respective project wiki page


File: bukuserver-runner/README.md

Bukuserver runner

This tool can be used to run and restart Bukuserver, switching databases between runs. It has no third-party dependencies, allowing to run Bukuserver sandboxed in a virtualenv as easily as the system-wide install (which is especifally useful for development).

I suggest installing/symlinking it system-wide (e.g. as an /usr/local/bin/buku-server executable). Either of the *.desktop files can be edited according to match your setup and installed in your local/share/applications/ folder for access from system menu.

On Windows, you can create a shortcut file pointing to any Python executable (python.exe for windowed mode, pythonw.exe for headless) with added CLI arguments: path to buku-server.py followed by --stop-if-running.

Note that windowed mode may be necessary if you want to see Bukuserver logs, or use noGUI mode (see below). The terminal window can be minimized to tray when not in use, by a program like KDocker, RBTray or SmartSystemMenu.

Usage

When running buku-server.py without arguments, it will prompt for database file, then start the Bukuserver. These actions will be repeated once Bukuserver stops running (e.g. after hitting Ctrl+C). The script will quit if you cancel the prompt.

In GUI mode, the prompt is implemented as 2 dialogs; a list of databases to choose from, and a text input for creating a new DB. In the shell mode, you can type in DB number from the list, or a new DB name. Note that DB names must be valid filenames in your system (sans the .db extension). These files are located in your Buku settings folder (along with the default bookmarks.db file).

Running buku-server.py --stop will kill the currently running Bukuserver process (thus allowing to restart it in the background, like a daemon). buku-server.py --stop-if-running will either start the script or kill Bukuserver if it's running already.

Screenshots

DB selection dialog โ€“ shown on startup (unless no DB files were found); initially the previous DB is selected

DB creation dialog โ€“ shown if no DB was selected (or none found)

A confirmation dialog is shown if new DB name is taken already

DB name must be a valid filename, sans the .db extension (invalid chars: / on Linux, or any of <>:"/\|?* on Windows)

DB selection prompt in console shell/no-GUI mode (BUKU_NOGUI=y)

Environment variables

The script behaviour can be configured by setting the following environment variables:

  • BUKUSERVER specifies path to your Bukuserver executable or Buku source directory.
  • BUKU_DEVMODE โ€“ if not empty, Bukuserver will be run in development mode. Normally used with source directory in BUKUSERVER.
  • BUKU_VENV overrides path to your virtualenv sandbox (default depends on whether BUKU_DEVMODE is set):
    • when devmode is off, the virtualenv location defaults to a venv/ folder in your Buku settings directory;
    • when devmode is on, the virtualenv location defaults to a venv/ folder in the source directory.
  • BUKU_NOGUI โ€“ if not empty, fallback shell prompt will be used (also happens if Tkinter is not present in your Python installation).
  • BUKU_DEFAULT_DBDIR โ€“ specify directory for DB selection (same as Buku itself).

Default values for all of these (as well as for BUKUSERVER_ options) can be specified in a bukuserver.env file in your Buku settings folder:

sh
# ~/.local/share/buku/bukuserver.env
BUKUSERVER='~/Sources/buku/'  # when running from sources
BUKUSERVER_THEME=slate
BUKUSERVER_DISABLE_FAVICON=false
BUKUSERVER_OPEN_IN_NEW_TAB=true

File: docs/source/buku.rst

buku module

.. automodule:: buku
:members:
:undoc-members:
:show-inheritance:


File: docs/source/bukuserver.rst

bukuserver package

bukuserver.filters module

.. automodule:: bukuserver.filters
:members:
:undoc-members:
:show-inheritance:

bukuserver.forms module

.. automodule:: bukuserver.forms
:members:
:undoc-members:
:show-inheritance:

bukuserver.response module

.. automodule:: bukuserver.response
:members:
:undoc-members:
:show-inheritance:

bukuserver.server module

.. automodule:: bukuserver.server
:members:
:undoc-members:
:show-inheritance:

bukuserver.views module

.. automodule:: bukuserver.views
:members:
:undoc-members:
:show-inheritance:


File: docs/source/index.rst

.. buku documentation master file, created by
sphinx-quickstart on Thu Sep 7 12:54:59 2017.
You can adapt this file completely to your liking, but it should at least
contain the root toctree directive.

buku

Bookmark manager like a text-based mini-web.

.. toctree::
:maxdepth: 2
:caption: User guide
.. toctree::
:glob:
:maxdepth: 2
:caption: Wiki

wiki/*

.. toctree::
:maxdepth: 2
:caption: Buku Documentation

buku

.. toctree::
:maxdepth: 2
:caption: Bukuserver Documentation

bukuserver

Indices and tables

  • :ref:genindex
  • :ref:modindex
  • :ref:search

File: docs/source/modules.rst

buku

.. toctree::
:maxdepth: 4

buku

bukuserver

.. toctree::
:maxdepth: 4

bukuserver


File: docs/source/tutorial_for_developer.md

Tutorial for Developer

get buku database

python
>>> import buku
>>> bdb = buku.BukuDb()

simplest way to add url to buku

python
>>> rec_id = bdb.add_rec('http://example.com')
>>> rec_id
40296

get record id from url

python
>>> url = 'https://example.com'
>>> rec_id = bdb.add_rec(url)
... if rec_id == -1:
...     rec_id = bdb.get_rec_id(url)
>>> rec_id
40296

get url data from record id

python
>>> rec = bdb.get_rec_by_id(40296)
>>> rec
(40296, 'http://example.com', 'Example Domain', ',', '', 0)

get tag list

python
rec[3].split(buku.delim)