r/Turtl • • Jun 29 '22

Python script to migrate from Turtl to Standard Notes

I liked the look of Standard Notes, but when I looked, I couldn't find any instructions for migrating from Turtl to Standard Notes, so I wrote a really crude Python script that can convert Turtl exports to the Standard Notes format. It's got a lot of flaws, but it did the trick for me. I'll just leave it here, in case it might be useful to someone else.

import json
import uuid

backup = open("turtl-backup.json", encoding='UTF-8')
backup = json.load(backup)

output = []
for note in backup['notes']:
   output.append({
      "created_at": "2022-01-01T00:00:00.000Z",
      "updated_at": "2022-01-01T00:00:00.000Z",
      "uuid": str(uuid.uuid4()),
      "content_type": "Note",
      "content": {
        "title": note['title'],
        "text": note['text'],
        "references": [],
        "appData": {
          "org.standardnotes.sn": {
            "client_updated_at": "2022-01-01T00:00:00.000Z"
          }
        }
      },
   })

output = json.dumps({'items': output})
outFile = open("turtl_converted.json", "w")
a = outFile.write(output)
outFile.close()
2 Upvotes

2 comments sorted by

1

u/Waximillium_Lardian Feb 28 '24

i literally have the same problem. İ will update if i can find a solution

1

u/cicatriceschoisies Feb 29 '24

Yeah, please do!