Skip to content

Instantly share code, notes, and snippets.

@jckw
Created November 14, 2021 10:56
Show Gist options
  • Save jckw/81537c608b4bc9d58af9887fbd871fb1 to your computer and use it in GitHub Desktop.
Save jckw/81537c608b4bc9d58af9887fbd871fb1 to your computer and use it in GitHub Desktop.
Rename Roam daily notes to Obsidian format.
import os
import dateutil
import glob
# Assumes you're working in a directory with only the Daily Notes
# Files that aren't parseable dates will fail
files = map(lambda n: n[2:-2], glob.glob("./*.md"))
for f in files:
d = dateutil.parser.parse(f)
new_name = d.strftime("%Y-%m-%d") + ".md"
os.rename(f + ".md", new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment