recipe-graph/README.md

61 lines
1.2 KiB
Markdown
Raw Normal View History

2022-07-18 11:13:53 -04:00
# Recipe Graph
## Setup
Prerequisits
- Docker compose
- Python
Install python requirements
```sh
python -m pip installl -r requirements.txt
```
Start database
```sh
docker-compose up
```
Initialize database and recipe sites
```sh
python src/db.py
python src/inser_sites.py data/sites.json
```
## Usage
2022-07-24 21:01:31 -04:00
### Scrape
2022-07-18 11:13:53 -04:00
import new recipes
```sh
2022-07-24 21:01:31 -04:00
python src/scrape.py <SiteName> -id <RecipeIdentifier>
2022-07-18 11:13:53 -04:00
```
2022-07-24 21:01:31 -04:00
To scrape only one recipe.
2022-07-18 11:13:53 -04:00
2022-07-24 21:01:31 -04:00
or
```sh
python src/scrape.py <SiteName> -a <N>
```
To scrape `<N>` recipes
By default it will start at id `0` or the greatest value of id alread in the
database. To start at another value please use both `-id` and `-a`.
```
Scrape a recipe site for recipies
positional arguments:
site Name of site
options:
-h, --help show this help message and exit
-id ID, --identifier ID
url of recipe(reletive to base url of site) or commma seperated list
-a N, --auto N automaticaly generate identifier(must supply number of recipies to scrape)
-v, --verbose
```
2022-07-18 11:13:53 -04:00
## TODO
2022-07-24 21:01:31 -04:00
> ☑ automate scraping\
2022-07-20 15:07:24 -04:00
> ☐ extend importing funcionality to more websites\
2022-07-24 21:01:31 -04:00
> ☑ extracting quantity and name (via regex)\
> ☐ create ontology of ingredients
> ☐ visualization