Skip to main content

mdtk (Markdown Toolkit)

Tools for working with markdown files.

PyPI version CI Documentation License: MIT

Installation

pip install mdtk

Requires Python 3.10+.

Usage

Chrome bookmarks to markdown

  1. In Chrome, open the bookmark manager (chrome://bookmarks), put the links you want to export into one folder, and use Export bookmarks to save an HTML file.
  2. Convert that folder to a markdown link list:
mdtk-bookmarks bookmarks.html links.md --folder "Reading List"
$ cat links.md
- [GitHub - Where the world builds software](https://github.com)
- [Welcome to Python.org](https://python.org)

Options:

  • --folder NAME - the bookmark folder to extract (default: EXPORT_FOLDER)
  • --version - print the mdtk version and exit

Behavior notes:

  • Bookmarks inside nested subfolders are included, flattened in document order.
  • If several folders share the same name, the first one in the file is used.
  • Titles and URLs are escaped so the generated markdown links stay valid.
  • If the folder is not found, the error message lists the folders the export does contain.

Python API

from mdtk import BookmarkError, convert_bookmarks

count = convert_bookmarks("bookmarks.html", "links.md", folder_name="Reading List")
print(f"exported {count} bookmarks")

convert_bookmarks returns the number of bookmarks written and raises BookmarkError for anything that goes wrong (missing file, unknown folder, input that is not a bookmarks export, ...).

Development

git clone https://github.com/tommcd/mdtk.git
cd mdtk
pip install -e ".[dev]"

pytest                # run the tests
ruff check .          # lint
ruff format --check . # formatting
tox                   # everything, on all supported Python versions

Links

License

MIT

Download files

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

Source Distribution

mdtk-0.2.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdtk-0.2.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file mdtk-0.2.0.tar.gz.

File metadata

  • Download URL: mdtk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mdtk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e635097ad24142325e96502cd29cad064cdc59c0ef73a52f8a494d2d29ae885b
MD5 35d58fb76d9e5ecfbb8bacbf38a6f7fe
BLAKE2b-256 96d7e0dd00aadacfa4bad026e5215d7e59e01bb25af7ffeb94346d209d317598

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdtk-0.2.0.tar.gz:

Publisher: publish.yml on tommcd/mdtk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdtk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mdtk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mdtk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0575e4c1acb254a7fa8a206688eae3865a02d2e016f9e0b108d627c6c9e42c7c
MD5 3857f92e06026317878c26feb736c493
BLAKE2b-256 5c5ad55c168ee8a71b9fd8679ee02306fae6f1aadb0a602f3d40e2a03380782e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdtk-0.2.0-py3-none-any.whl:

Publisher: publish.yml on tommcd/mdtk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

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