Skip to main content

bookmarkdown

Parse your browser's exported HTML bookmark file to Markdown.

Supported browsers: Brave.

Installation

pip install bookmarkdown

Usage

CLI

# Convert "bookmarks.html" to markdown and output to STDOUT
btm bookmarks.html

# Convert "bookmarks.html" to markdown and write to "bookmarks.md"
btm --output=bookmarks.md bookmarks.html

# Alternatively
btm bookmarks.html > bookmarks.md

Python

The BookmarkHTMLParser is an instance of the Python standard library's HTMLParser and thus supports all its methods.

from bookmarkdown import btm

parser = btm.BookmarkHTMLParser()
parser.feed(html_content)

# Access the data
parser.data

FAQ

Concerns

  • Minimal dependencies. bookmarkdown is likely to be installed on the system level Python to make use of the btm script.
  • Correctness. No one likes to lose a bookmark nor a different ordering.

Future ideas

The current application solves my needs pretty well, but there are additional applications I can think of. Such as merging multiple bookmark files.

Add functionality to the CLI and Python codebase to support the following:

# Merge bookmark html-file into existing markdown file.
btm --merge=[md-file] [html-file]

btm [html-file]  # already implemented

# Read the `-r` as "reverse", i.e. instead of bookmark to markdown it
# becomes markdown to bookmark.
btm -r [md-file]

btm -r --merge=[md-file] [html-file]

Project structure

The project structure was automatically set up using cookiecutter and my Python template: cutter-py.

Release files for bookmarkdown 0.1.1

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

Source distribution (sdist)

Source distribution for bookmarkdown 0.1.1
File Size Uploaded
bookmarkdown-0.1.1.tar.gz 4.4 kB Details

Built distribution (wheel)

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

Total release size: 9.1 kB

Release files / bookmarkdown-0.1.1.tar.gz

Download URL bookmarkdown-0.1.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d69152b33de6d498b2aeec382f8df699d84e35efa0cf5d5ff8ef085d3e940cf9
BLAKE2b-256 checksum
How to use checksums
5f3188fee72959ac7ed2b7abaaec92347d89e230a7c90b84509d2eb654bf1a28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.10 Linux/5.8.0-63-generic

Release files / bookmarkdown-0.1.1-py3-none-any.whl

Download URL bookmarkdown-0.1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16df2636eabccc70a9f6352a17f33193861e815b0acb112b4f976b04c63bab6f
BLAKE2b-256 checksum
How to use checksums
9bc0b95b23f1ca66f6d99a97573ae168d33666f2ab74b952855214f07f0964c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.10 Linux/5.8.0-63-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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