Paprika Recipe Manager for iPad: export format

Another post about Paprika… Before adding a lot of new recipes, I just wanted to make sure that Paprika is not a “dead-end” in the sense that you can put things in but never get them out, for instance when you want to move to a different recipe manager. Paprika supports exports in two formats: HTML and “Paprika Recipe Format”.

In HTML, each recipe is saved as a separate HTML file in a folder called “Export <Category name> <date> <time>”. All photos are saved in the sub folder “images”. Each recipe file will contain hrecipe metadata in the HTML, so that it can easily be parsed by a recipe manager that understands hrecipe tags. The exported folder will appear in App File Sharing section of iTunes and can be copied to your PC (you can copy the complete folder, all contents in it will be copied automatically).

Although automatic parsing of the HTML files is feasible, I also had a quick look into the (proprietary) “Paprika Recipe Format” to see if that one would be easier to process, if the need may ever arise. The export is in the form of a single, huge file called “Export <Category name> <date> <time>.paprikarecipes. It turns out to be a ZIP file (at least version 2.0 to extract). When unzipped, you will get one file for each recipe, called <recipe title>.paprikarecipe (for instance “Boeuf bourguignon.paprikarecipe”). Each of these file is gzipped. Once un-gzipped, it appears to be in JSON format. There are no line breaks, so everything is on one single line. In the example below, I added some line breaks and shortened some lines (indicated by “(…)” ):

{
 "uid":"C918EB00-71BE-4AEE-A215-96373518F7A8-(...)F945F4",
 "name":"Antipasto van gemarineerde groenten",
 "directions":"1 Grill voorverwarmen.\n2 Intu(...)brood.\n",
 "servings":"4",
 "rating":0,
 "difficulty":null,
 "ingredients":"1\/2 limoen\n4 eetlepels (olijf)(...)\n",
 "notes":null,
 "created":"2012-09-29 18:06:46",
 "image_url":null,
 "cook_time":"10 min",
 "prep_time":"25 min",
 "source":"Allerhande 1998 nummer 9 pagina 23",
 "source_url":null,
 "photo_hash":"79f74b8a753fef94ee45a4981304fdd8e(...)cf",
 "photo":"20740DFC-8415-42B3-97E5-7D7049DFF0CA-1(...)8.jpg",
 "nutritional_info":"145 kcal",
 "photo_data":"\/9j\/4AAQSkZJRgABAQAAAQABAAD\/4Q(...)\/\/Z",
 "categories":["Voorgerecht"]
}

A few observations:

  • “photo_data” seems to be Base64 encoded photo (jpg?). I haven’t tried to decode it yet. Slashes seem to be escaped (“\/”).
  • Paragraphs of the directions are separated by “\n”.
  • Ingredients are separated by “\n”. Again, some characters are escaped by backslashes, such as “\/”
  • The meaning of “photo_hash” is not immediately obvious to me.
  • “source_url” is the URL of the web page  when the recipe was scraped off some website, “image_url” is the URL of the original photo. Slashes are escaped again (“\/”).
  • “photo” seems to be the internal file name of the photo. The same name is used when a recipe is exported in HTML format.
  • When exporting “All Recipes”, there doesn’t seem to be any indication about recipes being favorite. But one can export the Favorite recipes separately from Paprika (option in the Export menu)

I believe that any skilled programmer will be able to write a simple converter for the HTML or “Paprika Recipe Format” to produce whatever format is needed, so Paprika is certainly not a “dead end” for your valuable recipes.

NB: just in case anyone wonders why forward slashes are escaped: read this

6 responses to “Paprika Recipe Manager for iPad: export format

  1. I believe what appears to be JSON is actually YAML, I will leave the web to explain the differences if you care to look it up. Namely YAML sells itself as more human readable than JSON but otherwise nearly identical.

    Thanks for pointing out that the paprika file export was a zip, I should have seen that when I was trying to figure out, same as you, if paprika would end up being a data dead end or not.

    Photo hash should be little more than a file hash such as used for checking file integrity and or unique files from one another like in file sharing programs, I will be verifying this.

    You are correct about the BASE 64 photo, as Paprika said in their User Guide in the YAML section. Only exception is / is escaped with \ , again as you noted above, a simple replace “\/” with “/” in any text editor gives the BASE 64 to be encoded.

    I am actually kinda miffed paprika said they would not be developing a Windows program, and only MIGHT consider a web based version if enough users clamor for it. So I am considering writing a program to at least read the info into editable fields on Windows, though who knows how far that will lead, software wise.

    • Roy,
      Did you write something for parsing/reading the Paprika JSON/YAML files into editable fields on Windows. I’d love to find an easy two-way tool to manipulate my 3000+ recipes outside of the iPad (export, manipulate/categorize in a spreadsheet or something and re-import back into Paprika).
      Cheers,
      Todd

  2. Hi Roy, thanks for your comments. But I think it’s really JSON, not YAML (I know YAML, I wrote my own converter to import all my recipes into Paprika through YAML).
    YAML: name: My Tasty Recipe
    JSON: { “name”: “My Tasty Recipe” }
    Not that it matters, it’s readable/parseable

    The photo hash is not so relevant if you only want to get recipes *out* of Paprika. If you want to import it through this format, it should probably be calculated in the right way, but then you better use the YAML import feature.

  3. Thanks for your analysis of this format. I am writing a parser at the moment for some ebook versions of my cookbooks so I can get my paper-based cookbook recipes into Paprika.

  4. One thing I am wondering about is whether you can package multiple recipes in one .paprikarecipe file. I have contacted the company to ask about the spec, and I will report back.

  5. Thanks for posting this info. I File > Backup, which created a file “Backup 2017-04-08 23.06.10.paprikabak”. I then used your tip to unzip this file, and BOOM! an sqlite database file appeared. =)

Leave a comment