A Python CLI tool for converting Leaflet to Zoommap.
Project description
Leaflet-to-Zoommap Converter
This repository contains a Python CLI tool to parse Obsidian Vaults and convert Leaflet codeblocks to Zoommap (TTRPG Tools: Maps) format, supporting map scales, icons and shapes.
Overview
ZoomMap Converter is designed to facilitate the migration from the Obsidian Leaflet plugin to the ZoomMap plugin. It handles the conversion of map notes, markers, and configurations while maintaining compatibility with Obsidian vault structures.
Features
- Note Conversion: Converts Leaflet-formatted codeblocks to ZoomMap format.
- Icon Processing: Transforms custom SVG icons with color and size normalisation over to Zoommap.
- Error Handling: Validation and logging for troubleshooting.
- Path Management: Handles Obsidian vault file paths and structures.
Installation
Prerequisites
- Python 3.12+
- Obsidian vault with Leaflet plugin notes
- Leaflet Plug-In installed and enabled.
- Zoommap Plug-In installed and enabled.
Setup
- Download the CLI tool using
pip.
pip install zoommap-converter
- Once installed, you can test the install was successful using:
zoommap-converter --version
Usage
Basic Conversion
- Create and configure the
settings.yamlfile and ensure to include thevault_pathandtarget_path:
vault_path: leaflet-vault
target_path: converted-leaflet-vault
Note: See the sample settings.yaml for more configuration options.
- Set the path to your settings.yaml via environment variables:
export SETTINGS=path/to/settings.yaml
zoommap-converter
Or pass it as an argument to the tool:
zoommap-converter --settings path/to/settings.yaml
CLI Arguments
| Argument | Description | Default Value | Type/Action |
|---|---|---|---|
--settings |
Path to the settings file. | $SETTINGS env var |
Path |
--version |
Show the tool version and exit. | - | version |
--no-backup |
Do not create a backup of the original vault before conversion. | False |
store_true |
-v, --verbose |
Increase output verbosity. | False |
store_true |
--in-place |
Convert the vault in-place (no duplicate created). | False |
store_true |
--log-level |
Set the logging level. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL. |
$LOG_LEVEL or INFO |
str (uppercase) |
Development
Project Structure
├── src
│ └── zoommap_converter
│ ├── __init__.py
│ ├── __main__.py
│ ├── app.py
│ ├── cli.py # Command-line interface
│ ├── logs.py
│ ├── bootstrap/ # Initialisation and setup
│ ├── conf/ # Settings Config
│ ├── converter/ # Core conversion logic
│ └── models/ # Data models and schemas
tests/
Developer Setup
-
Clone the repository:
git clone https://codeberg.org/paddyd/zoommap-converter.git cd zoommap-converter
-
Install dependencies using
uv:uv install -
Configure the vault path in
settings.yamlor via environment variables
Running Tests
uv run pytest tests
Building
uv build
Contributing
Contributions are welcome. Please use the provided issue and pull request templates when contributing and follow these guidelines:
- Fork the repository
- Create a feature branch
- Submit a pull request with clear documentation
- Include tests for new functionality
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues, questions or feature requests, please file an issue.
Acknowledgements
- Jareika the creator of TTRPG Tools: Maps.
- Obsidian community for plugin development
- Font Awesome for icon assets
- Pydantic for data validation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zoommap_converter-0.3.4a1.tar.gz.
File metadata
- Download URL: zoommap_converter-0.3.4a1.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4f06da6a7a4078be51613ac22a7176c603e2798ec4af00ed1c7ecd2404aa87
|
|
| MD5 |
a88b593e4771db0a0542dcec722e8347
|
|
| BLAKE2b-256 |
975d313a8ad23f4fc136fe1d4a2b647cb09447a29fe2f2cd084c38e9bd62b339
|
File details
Details for the file zoommap_converter-0.3.4a1-py3-none-any.whl.
File metadata
- Download URL: zoommap_converter-0.3.4a1-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c47da909b4aaaf20b90823b2e563324dbf3f7984861f6b4b228e6974fdc537a
|
|
| MD5 |
256c7ff617bb30fe75a69ed437358eed
|
|
| BLAKE2b-256 |
4a74d790406dc67942733ec6dd786f9411210498b8d511165ba855ca2662a5f7
|