Skip to content

Instantly share code, notes, and snippets.

@rgstephens
Created November 6, 2016 22:11
Show Gist options
  • Save rgstephens/bd76d83510b772bacfa98e7d93746c5b to your computer and use it in GitHub Desktop.
Save rgstephens/bd76d83510b772bacfa98e7d93746c5b to your computer and use it in GitHub Desktop.
Pepperplate Export to Paprika YAML
#!/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
@ProfEiz
Copy link

ProfEiz commented Sep 28, 2020

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