Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bookmarkdown-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

bookmarkdown-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file bookmarkdown-0.1.1.tar.gz.

File metadata

  • Download URL: bookmarkdown-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.8.0-63-generic

File hashes

Hashes for bookmarkdown-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d69152b33de6d498b2aeec382f8df699d84e35efa0cf5d5ff8ef085d3e940cf9
MD5 528141c092c5762c8743c16d7fe0c852
BLAKE2b-256 5f3188fee72959ac7ed2b7abaaec92347d89e230a7c90b84509d2eb654bf1a28

See more details on using hashes here.

File details

Details for the file bookmarkdown-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bookmarkdown-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.8.0-63-generic

File hashes

Hashes for bookmarkdown-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16df2636eabccc70a9f6352a17f33193861e815b0acb112b4f976b04c63bab6f
MD5 4df9a960d94ec79bb444475f7669bce3
BLAKE2b-256 9bc0b95b23f1ca66f6d99a97573ae168d33666f2ab74b952855214f07f0964c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page