Skip to main content

bookmarkhtml

pip install bookmarkhtml

Turns a Linkwarden backup export into a bookmarks file that Firefox, Chrome and Safari import as is.

Export your data from Settings, then Import and Export, then run:

bookmarkhtml backup.json
bookmarkhtml: 4 bookmarks, 3 folders -> bookmarks.html
  1 link had no URL

Then open your browser, go to the bookmark manager, and choose Import bookmarks from HTML.

What it keeps

Collections become folders, and sub collections stay nested inside their parent.

<DL><p>
    <DT><H3 ADD_DATE="1767225600">Work</H3>
    <DL><p>
        <DT><A HREF="https://example.org/tokio" ADD_DATE="1714114351" TAGS="rust,async">Tokio</A>
        <DD>the runtime everyone ends up reading
        <DT><H3 ADD_DATE="1767225600">Rust</H3>
Field in the backup Where it lands
collection name folder name
collection parentId nested folder
link name bookmark title, or the URL when empty
link url HREF
link createdAt ADD_DATE
link tags TAGS
link description DD note
pinned link outside any collection a folder named Pinned

Titles, notes and URLs are escaped, so an ampersand or a quote in a title does not break the file. The output is always written as UTF-8, so emoji survive on every platform.

What it cannot keep

A bookmarks file holds links, so parts of the backup are left out. The last lines of the run say how much:

  • links with no URL, such as an uploaded file or an image
  • RSS subscriptions and collection colors, which a bookmarks file has no place for
  • a folder whose parent is missing, or whose parents form a loop, is moved to the top level and counted

Archived page copies and highlights are not dropped here. The app leaves them out of the backup itself, so they never reach this tool.

Options

bookmarkhtml backup.json -o mybookmarks.html
bookmarkhtml backup.json -o - > mybookmarks.html
bookmarkhtml - -o out.html < backup.json
bookmarkhtml backup.json --title "Work bookmarks"
bookmarkhtml backup.json -q

It exits 0 on success and 2 when the file is missing, is not UTF-8, is not valid JSON, or is not a backup export.

Notes

No network calls, no telemetry, no dependencies beyond the standard library. Python 3.9 and later.

It reads a JSON file and writes HTML. It never talks to your server and never needs your password.

Built with AI assistance, reviewed and tested by me.

Comes from the request thread at https://github.com/linkwarden/linkwarden/issues/587

MIT licensed. Bug reports go to https://github.com/Rezarys/bookmarkhtml/issues

Metadata

Release files for bookmarkhtml 0.1.0

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

Source distribution (sdist)

Source distribution for bookmarkhtml 0.1.0
File Size Uploaded Provenance Actions
bookmarkhtml-0.1.0.tar.gz 9.7 kB Without provenance Details for bookmarkhtml-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.6 kB

Release files / bookmarkhtml-0.1.0.tar.gz

Download URL bookmarkhtml-0.1.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fdfc947ce5bd7b380fc0c97664563e28cb15f7a139864406e652c54df87a2075
BLAKE2b-256 checksum
How to use checksums
3702424303632df0376ce1b9bd27da184f043868bbb96f7d287522330a1b591a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bookmarkhtml-0.1.0-py3-none-any.whl

Download URL bookmarkhtml-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7718d4cf03b2190b8c5ce8bee483c5925ea46559aef0296066a75f38a23a6421
BLAKE2b-256 checksum
How to use checksums
c7cbfded56e4c2a25d9cc225f072a9bb072c3467afb55b914056c261b92cb1f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bookmarkhtml 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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