Created
November 6, 2016 22:11
-
-
Save rgstephens/bd76d83510b772bacfa98e7d93746c5b to your computer and use it in GitHub Desktop.
Pepperplate Export to Paprika YAML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ids=`sqlite3 ./recipes_2.db <<! | |
.mode csv | |
select Id from Recipe; | |
!` | |
dumprecipe() { | |
sqlite3 ./recipes_2.db <<! | |
.separator ' ' | |
select '- name: ', Title from Recipe where Id = $1; | |
select ' servings: ', Yield from Recipe where Id = $1; | |
select ' source: ', Source from Recipe where Id = $1; | |
select ' description: ', Description from Recipe where Id = $1; | |
select ' prep_time: ', ActiveTime from Recipe where Id = $1; | |
select ' cook_time: ', TotalTime from Recipe where Id = $1; | |
select ' notes: ', Note from Recipe where Id = $1; | |
! | |
sqlite3 ./recipes_2.db <<! | |
.separator ' ' | |
select 'categories: [', Tag.Text, ']' from ItemTag join Tag on Tag.Id = ItemTag.TagId where ItemTag.RecipeId = $1; | |
! | |
echo ' ingredients: |' | |
sqlite3 ./recipes_2.db <<! | |
.separator ' ' | |
select ' ', IngredientGroup.Title, Ingredient.Quantity, Ingredient.Text from IngredientGroup join Ingredient on Ingredient.GroupId = IngredientGroup.Id where IngredientGroup.RecipeId = $1 order by IngredientGroup.DisplayOrder, Ingredient.DisplayOrder; | |
! | |
echo ' directions: |' | |
sqlite3 ./recipes_2.db <<! | |
.separator ' ' | |
select ' ', DirectionGroup.Title, Direction.Text from DirectionGroup join Direction on Direction.GroupId = DirectionGroup.Id where DirectionGroup.RecipeId = $1 order by DirectionGroup.DisplayOrder, Direction.DisplayOrder; | |
! | |
} | |
#for id in $ids | |
for id in 483 1 435 | |
do | |
dumprecipe $id | |
echo | |
done |
For anyone looking, please note that at least as of late September 2020, Paprika now directly imports Pepperplate's text file export that Pepperplate will allow you to do for free if you don't pay their extortionate rate to continue using their service. Everyone should be incredibly thankful for people like rgstephens writing code to help before the developers get their act together -- I certainly am, but at this point, no reason to muck with any of this, simply go to Pepperplate.com, export your recipes as a .zip file, and import that .zip file directly into Paprika.
Once again, thank you to the developer for providing this option prior to the development team.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone else using this and seeing the export contain only 3 recipes, it's because of the following lines:
If you change this to just:
then all recipes will be exported. The version with the "483 1 435" was presumably there for debugging to avoid dumping too much data at once. (Sorry if this is stated elsewhere in the thread -- I didn't see it)