How to access to iCloud Notes with pyiCloud

Viewed 837

I'm trying to access to my iCloud Notes with a python script using pyiCloud framework, but when I try to list the notes it seems that Documents folder is empty. Does anyone know how I should make that?

>>> api.files['com~apple~Notes']['Documents'].dir() It returns:

>>> []

1 Answers

It sounds like you have an authentication problem that you can't get access to your Notes from the file storage (the UbiquityService). This issue might give you some more clues.

On the other note (!), I found the following a better way to get my Notes exported. I have tried a couple of ways mentioned around the web. Although there is no in-app solution to export Notes in a format other than PDF files, I have stumbled upon the following two solutions:

  1. Export in Markdown (or in other formats in the paid version) via the Bear app. I found this way easier and of more quality in terms of keeping the formatting, attachments, etc:
  • Download the Bear migration Workflow script from here and follow the instructions.
  • [optional] At this point, you have the HTML files with inline encoded images. Use my script to decode images to get regular HTML files with the images in an accompanying directory.
  • Install Bear and import the exported files from Notes.
  • Export the files as Markdown, HTML, or whatever format you desire from File -> Export Notes within the Bear app. Don't forget to check the "Export attachments" box in the export dialog.
  1. Export in HTML (and then convert to Markdown if you want) via the Notes Exporter app. The app gives you HTML files with inline encoded Base64 images saved with .txt extension (?!). Although I personally like this way as it generates output files that mimic closely the original Notes, the hyperlinks are missing in the exported files (it still keeps the hyperlink coloring though):
  • Download Notes Exporter from here.
  • Export Notes to the path you choose.
  • [optional] Rename file extensions to .html.
  • VoilĂ , now you have your Notes as HTML files with the same formatting and images.
  • Decode inline Base64 images and save HTML files with images saved in a separate adjacent directory using the script that I wrote for this: https://gist.github.com/SHi-ON/945ea2272ea4bb29e13bd0305370da90

Hope this helps to give you an idea!

Related