Bookmarks Converter
BookmarksConverter is a package that converts browser bookmark files, usable as a module or as a CLI.
BookmarksConverter supports the converters below:
- Bookmarkie (custom formats)
- Chrome/Chromium
- Firefox
The converters can import and export bookmarks from and to the formats listed below:
- Bookmarkie:
DB,HTML,JSON - Chrome/Chromium:
HTML,JSON - Firefox:
HTML,JSON
Notes:
- Supports Netscape-Bookmark format for
HTMLfiles - The exported
HTMLfiles are compatible with all browsers. - Custom
DBfiles are powered by SQLAlchemy ORM (seemodels.py). - Chrome/Chromium
JSONfiles cannot be directly imported but can be placed in the appropriate location (see bookmarks_file_structure.md - Chrome/Chromium - b. JSON). - For examples of supported
DB,HTML, orJSONstructures and formats, refer to the test resources or bookmarks_file_structure.md. - Custom
DBandJSONformats by BookmarksConverter are not browser-importable.
Table of Contents
Python and OS Support
The package has been tested on GitHub Actions with the following OSs and Python versions:
| OS \ Python | 3.11 |
3.12 |
3.13 |
3.14 |
|---|---|---|---|---|
macos-latest |
✓ | ✓ | ✓ | ✓ |
ubuntu-latest |
✓ | ✓ | ✓ | ✓ |
windows-latest |
✓ | ✓ | ✓ | ✓ |
Dependencies
The package relies on the following libraries:
- BeautifulSoup4: used to parse the HTML files.
- SQLAlchemy: used to create and manager the database files.
Install
Bookmarks Converter is available on PYPI
python -m pip install bookmarks-converter
Test
To test the package you will need to clone the git repository.
# Cloning with HTTPS
git clone https://github.com/radam9/bookmarks-converter.git
# Cloning with SSH
git clone git@github.com:radam9/bookmarks-converter.git
then you create and install the dependencies using uv.
# navigate to repo's folder
cd bookmarks-converter
# install the dependencies
uv sync --group dev
# run the tests
uv run pytest
Usage as Module
from pathlib import Path
from bookmarks_converter import Chrome, Firefox
from bookmarks_converter.formats import save_json
# initialize the converter
firefox = Firefox()
chrome = Chrome()
# import the bookmarks
input_file = Path("/path/to/input.html")
content = firefox.from_html(input_file)
# convert to desired format
output_file = Path("/path/to/output.json")
bookmarks = chrome.as_json(content)
# finally save the bookmarks
# there are some helper files that could be useful for saving to files
save_json(bookmarks, output_file)
Usage as CLI
bookmarks-converter cli can be installed inside a virtual environment or using pipx.
# bookmarks-converter usages:
# example 1
bookmarks-converter -i ./input_bookmarks.db --input-format 'bookmarkie/db' --output-format 'chrome/html'
# example 2
bookmarks-converter -i ./some_bookmarks.html -I 'chrome/html' -o ./output_bookmarks.json -O 'firefox/json'
The help message:
# use -h for to show the help message (shown in the code block below)
$ bookmarks-converter --help
usage: bookmarks-converter [-h] [-V] -i INPUT -I INPUT_FORMAT [-o OUTPUT] -O OUTPUT_FORMAT
Convert your browser bookmarks file.
The bookmark format is composed of two parts separated by a slash: [CONVERTER]/[FORMAT], ex. 'firefox/html'
With the converter being one of the available converters: ('bookmarkie', 'chrome', 'firefox')
And the format being one of the available formats: ('db', 'html', 'json')
Example Usage:
bookmarks-converter -i ./input_bookmarks.db --input-format 'bookmarkie/db' --output-format 'chrome/html'
bookmarks-converter -i ./some_bookmarks.html -I 'chrome/html' -o ./output_bookmarks.json -O 'firefox/json'
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-i INPUT, --input INPUT
Input bookmarks file
-I INPUT_FORMAT, --input-format INPUT_FORMAT
The bookmark format of the input bookmarks file
-o OUTPUT, --output OUTPUT
Output bookmarks file
-O OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
The bookmark format of the output bookmarks file
License
Metadata
Release files for bookmarks-converter 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bookmarks_converter-1.0.3.tar.gz | 14.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bookmarks_converter-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.2 kB
Release files / bookmarks_converter-1.0.3.tar.gz
| Download URL | bookmarks_converter-1.0.3.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
faaede82fa6a7597ffd89a8ff277e289bc1382de0677e9f8b8e6496e2d8f6a1f
|
|
BLAKE2b-256 checksum How to use checksums |
9f5599af509a42ede7c53af13813aedc13446217bc33de52cc07962c0c71ed75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bookmarks_converter-1.0.3-py3-none-any.whl
| Download URL | bookmarks_converter-1.0.3-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa61a5adb0b6f8c03a1194e8d7283a6171db1ae31308f3c42cdd2bddce567c65
|
|
BLAKE2b-256 checksum How to use checksums |
b322477fda8b8af052a91980e24d5e76a3ca6a6bb88b624ba03f58c14dd62aa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|