Parsing Netscape bookmark (Google Chrome, Firefox, ... export files) .
$ pip install bookmarks-parser
The function parse returns a list of nested dicts representing the directory structure of your bookmarks file.
import pprint
import bookmarks_parser
bookmarks = bookmarks_parser.parse("bookmarks.html")
pprint.pprint(bookmarks)The function parse_flat returns all bookmarks in a single, non-nested list.
import pprint
import bookmarks_parser
bookmarks = bookmarks_parser.parse_flat("bookmarks.html")
pprint.pprint(bookmarks)Install uv
$ uv sync
run tests
$ uv run pytest --cov=bookmarks_parser