Obsidian’s Importer Plugin Lets You Move Your Apple Notes to Any Note-Taking App That Supports Markdown - MacStories:
Apple Notes doesn’t have an export option. Instead, as Obsidian’s blog post on the Importer plugin update explains, it stores your notes in a local SQLite database. The format isn’t documented, but the developers of the plugin were able to reverse-engineer it to allow users to move notes and their attachments out of Notes and into two folders: one with Markdown versions of your notes and the other with the files attached to your notes. The folder with your notes includes subfolders that match any folders you set up in Notes, too.
This is just outstanding work from the Obsidian team. There are a couple of limitations, mostly that it can’t import password protected notes (obviously), but I’ve tested it and it worked well.
Related: undocumented SQLite databases should not be the way that a multi-gazillion dollar corporation is storing valuable data.