Skip to content

Instantly share code, notes, and snippets.

@mtask
mtask / canvas.py
Created September 4, 2025 19:53
Autocreate canvas with Obsidian based on entity like notes
#!/usr/bin/env python3
import os
import re
import json
import argparse
import sys
from typing import Optional, Dict, Set, List, Tuple
WIKILINK_RE = re.compile(r"\[\[([^\]]+)\]\]")
ENTITY_COLOR_MAPPER = {"event": "1", "ip": "3", "domain":"4", "email": "5", "device": "6"}