Metadata-Version: 2.4
Name: bookmarkhtml
Version: 0.1.0
Summary: Turn a Linkwarden backup export into a bookmarks file that browsers import.
Author: Younes Z.
License: MIT
Project-URL: Homepage, https://github.com/Rezarys/bookmarkhtml
Project-URL: Issues, https://github.com/Rezarys/bookmarkhtml/issues
Keywords: bookmarks,netscape,linkwarden,backup,export,migration
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Dynamic: license-file

# 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
