Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions parcing_1 (1).ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"id": "656f7301",
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"from pprint import pprint"
]
},
{
"cell_type": "markdown",
"id": "32883acd",
"metadata": {},
"source": [
"### Task 1"
]
},
{
"cell_type": "code",
"execution_count": 89,
"id": "0964f33c",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"username = 'Alberelloo'\n",
"url = f\"https://api.github.com/users/{username}/repos\"\n",
"\n",
"data_parc = requests.get(url=url)\n",
"for data in data_parc.json():\n",
" with open('task1.json', mode = 'a+', encoding = 'UTF-8') as f:\n",
" f.write(f'{data[\"name\"]} \\n')"
]
},
{
"cell_type": "markdown",
"id": "f16c7016",
"metadata": {},
"source": [
"### Task 2"
]
},
{
"cell_type": "code",
"execution_count": 85,
"id": "3535d2f4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Banana Bread Biscotti\n",
"Banana Bread Ice Cream Recipe\n",
"Banana Bread Blondies\n",
"Aunt Holly's Banana Bread\n",
"Whole wheat banana bread with brown butter\n",
"Coconut Banana Bread Muffins recipes\n",
"Caramel Rum Banana Bread\n",
"Brown Sugar Banana Bread & Celebrity Weight recipes\n",
"Baked Banana Bread Pancakes\n",
"This 3-Ingredient Banana Bread Recipe Is Almost Too Easy\n",
"Banana Bread In A Jar\n",
"Brilliant banana loaf\n",
"Naptime’s Perfect Homestyle Banana Bread\n",
"Vegan Banana French Toast\n",
"Mom's Banana Bread\n",
"Banana Bread with Pecans\n",
"Coconut Flour Banana Bread\n",
"Banana Cream Pie With Whole Grain Chocolate Crust\n",
"Quinoa, Banana And Apple Bread\n",
"Slow Cooker Banana Bread recipes\n"
]
}
],
"source": [
"url = 'https://www.edamam.com/api/recipes/v2?type=public&q=banana%20bread&_=1670954614783'\n",
"data_parc = requests.get(url = url).json()\n",
"\n",
"\n",
"data_parc['count']\n",
"for recipe in data_parc['hits']:\n",
" print(recipe['recipe']['label'])"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}