Skip to main content

Raindrop.io CSV to Zettelkasten Markdown CLI

Project description

Raindrop.io CSV to Zettelkasten-based Markdown

A Python CLI tool to parse a CSV export from Raindrop.io and create a directory of individual markdown files - one per bookmark - using Zettelkasten-style filenames.

License: MIT

Table of Contents

Features

  • Parses Raindrop.io CSV exports
  • Extracts bookmarks and highlights
  • Creates a directory of markdown files (one per bookmark)
  • Zettelkasten-style filenames: {YYYYMMDDHHMM}_{title}.md
  • Interactive CLI to show, edit, remove, and search bookmarks in the directory
  • Fuzzy search across all bookmarks
  • Robust error handling and logging
  • Comprehensive unit tests

Requirements

  • Python 3.8+

Installation

  1. Clone the repository:

    git clone <repository-url>
    
  2. Navigate to the project directory

    cd <project-directory>
    
  3. (Optional) Create and activate a virtual environment

    python -m venv venv
    source venv/bin/activate # On Windows, use `venv\Scripts\activate`
    

Usage

  1. Place your Raindrop.io CSV export anywhere on your system.
  2. Run the script to create a directory of markdown files:
    python raindropMD.py create <your_csv_file.csv> <output_directory>
    
    Example:
    python raindropMD.py create ~/Downloads/raindrop.csv bookmarks/
    
  3. Use the CLI to manage your bookmarks:
    • List all bookmarks:
      python raindropMD.py list <output_directory>
      
    • Edit a bookmark interactively:
      python raindropMD.py edit <output_directory>
      
    • Remove a bookmark interactively:
      python raindropMD.py remove <output_directory>
      
    • Fuzzy search bookmarks:
      python raindropMD.py search <output_directory> <query>
      

Template System

This tool supports user-editable markdown templates for generating bookmark notes. Templates are written using the Jinja2 templating language and must follow these conventions:

Template File Requirements

  • Templates must be placed in the templates/ directory and have the .md.j2 extension (e.g., bookmark_template.md.j2).
  • The template filename is used as its identifier and is referenced in the YAML frontmatter of each generated note.

Template Syntax

  • Use Jinja2 variable syntax for bookmark fields, e.g. {{ title }}, {{ url }}, {{ tags }}.
  • Standard bookmark fields available:
    • title, url, cover, tags, created, favorite, excerpt, note, highlights
  • You may define additional user sections by adding new variables (e.g., {{ user_notes }}) in the template. These will be preserved and editable in the CLI.
  • To render highlights as a list, use a Jinja2 loop:
    {% if highlights %}
    ### Highlights:
    {% for h in highlights %}
    > {{ h }}
    {% endfor %}
    {% endif %}
    
  • You can use any valid Jinja2 syntax for formatting, conditionals, and loops.

YAML Frontmatter

  • Each generated note includes YAML frontmatter indicating the template used:
    ---
    template: bookmark_template.md.j2
    ---
    
  • The tool uses this field to ensure the correct template is used for editing and parsing.

Example Template

## [{{ title }}]({{ url }})
{% if cover %}![cover image]({{ cover }}){% endif %}
**Tags:** {{ tags }}
**Created:** {{ created }}
{% if favorite %}⭐ **Favorite**{% endif %}
{% if excerpt %}
_Excerpt:_ {{ excerpt }}
{% endif %}
{% if note %}
_Note:_ {{ note }}
{% endif %}
{% if highlights %}
### Highlights:
{% for h in highlights %}
> {{ h }}
{% endfor %}
{% endif %}

User-Defined Sections

  • Any variable in the template that is not a standard bookmark field is treated as a user-defined section (e.g., {{ user_notes }}).
  • The CLI will prompt for these sections when creating or editing notes, and will preserve their content on update.

Template Best Practices

  • Use clear section headers (e.g., ### Notes) for user-defined sections.
  • Avoid duplicate variable names.
  • Test your template with a sample bookmark to ensure all fields render as expected.

See the templates/ directory for working examples.

TODOs

  • Improve CLI output
  • Add markdown template customization
  • Improve bookmark editing
  • Add note title customization
  • Add GitHub Action to create, test, and publish package
  • Add Raindrop API use to automate CSV export

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

raindropmd-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

raindropmd-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file raindropmd-0.1.0.tar.gz.

File metadata

  • Download URL: raindropmd-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for raindropmd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d1e42e4ae45de54bc800edcbafbedcd185379530a8c023de16e1aaa0387165d
MD5 aa6fbe77a028c4b9a6ffaf67a3431c48
BLAKE2b-256 a9d5b5f5271c82a10dd073f9ee0b866fa7bbc1ea155461852ea0dd705aaf6c85

See more details on using hashes here.

File details

Details for the file raindropmd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: raindropmd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for raindropmd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b51fbf31eccfe8b8c3fe73ed7980511b2efb31a81a8fab51bd54fe4c5f203d8
MD5 ce7d498dd29425ed1fee31d746358590
BLAKE2b-256 0568f0d3e2bdc28613245a3b4006879a3e7d6d778ed9854a2a4d6c3518d2f30d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page