You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
5.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "607070ae-bceb-4476-b755-0835e5c07014",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"What's the recipe's name?\n",
"Provide a description for the recipe\n",
"Who is the chef?\n",
"Which ingredients do you need? Please write them separated by a comma\n",
"Which passages do you follow to cook the recipe? Please write them separated by a comma\n"
]
}
],
"source": [
"print(\"What's the recipe's name?\")\n",
"title = input()\n",
"\n",
"print(\"Provide a description for the recipe\")\n",
"description = input()\n",
"\n",
"print(\"Who is the chef?\")\n",
"chef = input()\n",
"\n",
"print(\"Which ingredients do you need? Please write them separated by a comma\")\n",
"ingredients = [ingredient.strip() for ingredient in input().split(',')]\n",
"\n",
"\n",
"print(\"Which steps do you need to follow to cook the recipe? Please write them separated by a comma\")\n",
"instructions = [instruction.strip() for instruction in input().split(',')]\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "ec5f984d-bc73-4d4e-a8e0-8b9d2e758152",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"recipes\": [{\"title\": \"Pizza and fruit salad soup\", \"description\": \"Minim laborum ipsum sunt minim nulla officia cillum quis labore ad voluptate enim deserunt nulla.\", \"chef\": \"chef Malvozzo\", \"ingredients\": [\"\\ud83c\\udf55\", \"\\ud83e\\udd6d\", \"\\ud83c\\udf49\", \"\\ud83c\\udf48\"], \"instructions\": [\"Id est velit ullamco ea sint aliqua laboris incididunt consectetur do aliqua sint eiusmod.\", \"Mescola\", \"Pariatur eu exercitation ipsum qui e\", \"Quis pariatur magna id pariatur consectetur irure in sint.\", \"Culpa sunt non consequat consequat excepteur amet ut veniam cupidatat in occaecat consectetur velit.\", \"servire ben caldo!\"]}, {\"title\": \"Kip & Ice Kream Siup\", \"description\": \"Id consequat deserunt laborum ea commodo sit voluptate sunt commodo excepteur sit incididunt amet.\", \"chef\": \"Mad Moonfish\", \"ingredients\": [\"\\ud83c\\udf57\", \"\\ud83c\\udf5a\", \"funghetti\", \"\\ud83c\\udf49\", \"\\ud83e\\udd57\"], \"instructions\": [\"Exercitation eiusmod adipisicing ex ut amet qui minim est anim reprehenderit nulla voluptate quis.\", \"Occaecat anim veniam occaecat ut pariatur culpa sit reprehenderit ullamco cupidatat.\", \"Et reprehenderit mollit cillum Lorem est.\", \"Magna aliquip sint aliqua proident.\", \"sluuuurp\"]}, {\"title\": \"NLTK Soupa\", \"description\": \"A delicious soup made with natural language tomato and kiwi\", \"chef\": \"Python\", \"ingredients\": [\"pasta\", \"mushroom\", \"pizza\", \"internet\"], \"instructions\": [\"Cook the pasta in the internet\", \"Dig a hole near a mushroom\", \"Bury the pizza in the hole\", \"Turn off internet\", \"Drain the pasta\", \"Turn internet on again\"]}, {\"title\": \"A new sup\", \"description\": \"just a test soup to see how does the cms taste like\", \"chef\": \"python\", \"ingredients\": [\"computer\", \"soupboat\", \"jupiter\", \"zen\"], \"instructions\": [\"turn on the computer\", \"enter the soupboat\", \"access jupiter\", \"start the kernel with little zen\", \"put python to boil\", \"wait and shift enter\"]}, {\"title\": \"Misu sup\", \"description\": \"A tasty misu sup yes yes yes\", \"chef\": \"Mitsos\", \"ingredients\": [\"Miso\", \"Water\", \"Salt\", \"Hash\", \"Egg\", \"Oil\", \"Pepper\", \"Glitter\", \"Mushrooms\"], \"instructions\": [\"Take the glitter and put them on your face\", \"Boil the water\", \"Throw the mushrooms in the boiling water\", \"Throw an egg against your neighbour\", \"Add salt and pepper\", \"Enjoy\"]}, {\"title\": \"A visual studio soup\", \"description\": \"A soup from the jupiter lab in visual studio ecc ecc really testy\", \"chef\": \"Visual sudo\", \"ingredients\": [\"Visual Studio\", \"Zen\", \"soup-gen repo\", \"git\", \"soupboat\"], \"instructions\": [\"Open visual studio and pull the repo from git\", \"Follow the jupiter notebook\", \"hope it works\", \"commit and push all the changes\", \"update the soupboat\"]}]}\n"
]
}
],
"source": [
"import json\n",
"recipe = {\n",
" \"title\":title,\n",
" \"description\": description,\n",
" \"chef\": chef,\n",
" \"ingredients\": ingredients,\n",
" \"instructions\": instructions\n",
"}\n",
"\n",
"\n",
"cms = ''\n",
"\n",
"with open('cms.json', 'r') as file:\n",
" cms_string = file.read()\n",
" cms = json.loads(cms_string)\n",
"\n",
"cms[\"recipes\"].append(recipe)\n",
"\n",
"with open('cms.json','w') as file:\n",
" file.write(json.dumps(cms))\n",
" print('Thank you for your contribuition')\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2d4de3af-fe7e-4691-8ac9-590b398aae66",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "63fd5069d213b44bf678585dea6b12cceca9941eaf7f819626cde1f2670de90d"
},
"kernelspec": {
"display_name": "Python 3.9.5 64-bit",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}