Skip to main content

md-localize-images

md-localize-images scans Markdown files, downloads remote image references, stores them locally, and rewrites the image links.

The tool is intended for Obsidian vaults, but it also works with ordinary Markdown files. The default rewritten link style is Obsidian embed syntax:

![[attachments/image.png]]

Install for development

python -m pip install -e ".[dev]"

Usage

Process one file:

md-localize-images --file path/to/note.md

Process a vault recursively:

md-localize-images --vault path/to/vault --recursive

Choose where downloaded images are stored:

md-localize-images --file note.md --images-dir attachments/imported-images

Use relative Markdown links instead of Obsidian links:

md-localize-images --file note.md --link-style relative

Run without writing files:

md-localize-images --vault . --recursive --dry-run

Create Markdown backups before modification:

md-localize-images --vault . --recursive --backup

Process raw HTML image tags as well as Markdown images:

md-localize-images --vault . --recursive --include-html-img

Exit Codes

  • 0: success
  • 1: one or more downloads failed, but processing completed
  • 2: invalid command-line arguments
  • 3: filesystem or path configuration error

Notes

  • WebP images are saved as PNG files.
  • Links inside fenced code blocks, indented code blocks, inline code spans, and HTML comments are not modified.
  • Existing image files are not overwritten; a deterministic hash is added to avoid collisions.
  • Repeated identical URLs are downloaded once per invocation.
  • Phase one does not include a persistent cache.

Release files for md-localize-images 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 md-localize-images 0.1.0
File Size Uploaded
md_localize_images-0.1.0.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for md-localize-images 0.1.0
File Interpreter ABI Platform
md_localize_images-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size:36.9 kB

Release files / md_localize_images-0.1.0.tar.gz

Download URL md_localize_images-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eb7f9df60196cb5f90067ae7e89d731146dd89d9b178390411e4b118ed91ce15
BLAKE2b-256 checksum
How to use checksums
70d71e948ca143a7d1f249967d8d746b71fc592bfaaf28ca02871013842efb7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

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

Download URL md_localize_images-0.1.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
447cc6af9043b72b2b6b7803a90714168886a9b6335f6534ca04749aaf403065
BLAKE2b-256 checksum
How to use checksums
47baaaf35b6281687109d1ba4eb2999d7d69dc3ceaf9b85ff02250d39cb55d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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