Giter VIP home page Giter VIP logo

apple-obsidian's Introduction

apple-obsidian

Scripts to help migrate notes from Apple notes to Obsidian.

Note that all scripts are provided as-is, and are tested only on my files. Test them on a subset of your notes before using them for real, and of course ensure you have multiple backups. Data loss is not my responsibility :)

exporting notes from Apple notes

I'm on a Mac and used the very excellent Exporter to do the initial export. Notes were exported into folders that mimicked the structure in Apple Notes.

Once that was done though I had a couple of challenges:

  1. How to prepend metadata to each note? (I attach metadata to each note in Obsidian that forces me to associate it with a MOC and also link it to at least two other notes to aid future discoverability)
  2. How to fix the file attachment links? (I wanted to make the links point to the file stored in the attachments folder in my vault, once I'd moved it there)

So I wrote the Python scripts below.

prepend-metadata.py

  • prepends obsidian metadata to the files in a folder
  • for what folder select the folder in finder, then option-right-click to copy the path as Pathname
  • for MOC, copy the full MOC as it will be inserted as a string, ie [[Gardening MOC]]
  • obviously change the metadata in the script to what you want

search-replace.py

  • replaces the apple notes exports links to link back to your vault
  • note that it simply removes any path information from the attachment filename string, on the basis that Obsidian knows where to look for attachments based on the configuration under Settings > Files & Links
  • If you have multiple attachments with the same name, then this script will likely cause problems
  • the script is set to create backups (.bak) of any files it changes, so you can always revert if needed.

How to run these scripts

If you're on a Mac then you have python pre-installed:

  • open terminal
  • cd into the folder where the scripts are, ie cd /Users/myname/obsidian
  • to run the script it's python3 prepend-metadata.py or python3 prepend-metadata.py

If you don't have python installed then it's not too hard to do but beyond the scope of this readme.

apple-obsidian's People

Contributors

throwaway-4736528 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.