Skip to content

Commit

Permalink
📖 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Valaraucoo committed Dec 3, 2022
1 parent b531db6 commit 2a7fb09
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 12 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ $ what-to-eat --help

Usage: what-to-eat [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell.
│ --show-completion Show completion for the current shell, to copy
it or customize the installation.
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ configure Create configuration file to your orders │
│ ls Finds best restaurants via Wolt API │
│ random Finds random restaurant via Wolt API │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ --version -v
│ --install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit.
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ configure Create configuration file to your orders
│ ls List restaurants queried from Wolt API.
│ random Finds random restaurant via Wolt API
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

```

Expand Down Expand Up @@ -155,6 +155,14 @@ You can select one of the following techniques:
- `delivery_time` - the restaurant will be selected based on the delivery time.
- `random` - the restaurant will be selected randomly.

<h2>📖 Documentation </h2>

| Documentation | Command | Options |
|-----------------------------------------------------------|-----------------------|--------------------------------------------------------|
| [🚀 List all restaurants](./docs/list-all-restaurants.md) | `what-to-eat ls` | `query`, `profile`, `tag`, `sort`, `ordering`, `limit` |
| [🎲 Random restaurant](./docs/random.md) | `what-to-eat random` | `profile`, `tag`, `technique` |
| 👤 Configure profile | `what-to-eat config` | |

<h2>📚 License</h2>

This project is licensed under the terms of the MIT license.
108 changes: 108 additions & 0 deletions docs/list-all-restaurants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<h2>📖 Documentation: List all restaurants</h2>

Command manual:

```console
$ what-to-eat ls --help

Usage: what-to-eat ls [OPTIONS] [RESTAURANT]

List restaurants queried from Wolt API.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ restaurant [RESTAURANT] Restaurant name [default: None] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --query -q TEXT Query search for restaurants [default: None] │
│ --profile -p TEXT Profile name [default: None] │
│ --tag -t TEXT Tag [default: None] │
│ --sort -s [none|restaurant|address|delivery_cost|estimate_time|rating|price] Sort by: none, restaurant, address, delivery_cost, estimate_time, rating, price │
│ [default: Sort.NONE] │
│ --ordering -o [asc|desc] Ordering: asc, desc [default: Ordering.ASC] │
│ --limit -l INTEGER Limit results [default: None] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

```

By default your first profile is `default` one. But while listing restaurants you can change it using `profile` option:

```console
$ what-to-eat ls --profile work
```

You can query restaurants by name using `query` option and limit the number of results using `limit` option:

```console
$ what-to-eat ls --query pizza --limit 3
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ No. ┃ Restaurant ┃ Address ┃ Estimate time ┃ Delivery cost ┃ Rating ┃ Price ┃ Tags ┃
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │ Pizza Royal │ Chełmońskiego 11 │ 50 - 60 min │ 9.99 PLN │ 8.2 │ 💰💰 │ Pizza, Italian │
│ 2 │ N'Pizza │ Ul. Rajska 3/lok. 2 │ 30 - 40 min │ 2.49 PLN │ 9.2 │ 💰💰 │ Italian, Pizza, European │
│ 3 │ Nonna Maria Pizza Napoletana │ Dajwór 9 │ 25 - 35 min │ 2.49 PLN │ 9.2 │ 💰💰 │ Italian, Pizza │
└─────┴──────────────────────────────┴─────────────────────┴───────────────┴───────────────┴────────┴───────┴──────────────────────────┘
🍿 Restaurants in Kraków via wolt 🍿

```

Another cool feature is to list restaurants by tags. You can use `--tag` (or `-t`) option to filter restaurants by tags:

```console
$ what-to-eat ls --tag kebab --limit 3
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ No. ┃ Restaurant ┃ Address ┃ Estimate time ┃ Delivery cost ┃ Rating ┃ Price ┃ Tags ┃
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │ Berlin Döner Kebap Galeria Krakowska │ Pawia 5 │ 25 - 35 min │ 2.49 PLN │ 8.2 │ 💰 │ Doner, Kebab, Middle eastern │
│ 2 │ Vegab │ Starowiślna 8 │ 25 - 35 min │ 2.49 PLN │ 9.2 │ 💰💰 │ Bowl, Kebab, Vegan │
│ 3 │ Kebaber Starowiślna 8 │ Starowiślna 8 │ 20 - 30 min │ 2.49 PLN │ 8.8 │ 💰 │ Kebab, Turkish │
└─────┴──────────────────────────────────────┴───────────────┴───────────────┴───────────────┴────────┴───────┴──────────────────────────────┘
🍿 Restaurants in Kraków via wolt 🍿

```

By using sorting options you can sort restaurants by name, rating, price, delivery cost and delivery time and chose order (ascending or descending):

```console
$ what-to-eat ls --sort rating --ordering desc --limit 3
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┓
┃ No. ┃ Restaurant ┃ Address ┃ Estimate time ┃ Delivery cost ┃ Rating ┃ Price ┃ Tags ┃
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1 │ Cukiernia Czarodziej │ Karmelicka 15 │ 20 - 30 min │ (No delivery) │ 10.0 │ 💰💰 │ Ice cream │
│ 2 │ MARLIN - Fish & Chips - Smażalnie Rybne │ Krowoderskich Zuchów 21A │ 45 - 55 min │ (No delivery) │ 9.8 │ 💰💰 │ Fish, Mediterranean │
│ 3 │ Baqaro - Rakowicka │ Rakowicka 11 │ 25 - 35 min │ 2.49 PLN │ 9.8 │ 💰💰 │ Italian, Pinsa, Pizza │
└─────┴─────────────────────────────────────────┴──────────────────────────┴───────────────┴───────────────┴────────┴───────┴───────────────────────┘
🍿 Restaurants in Kraków via wolt 🍿

```

You can also display restaurant details by using `ls` command with restaurant name:

```console
$ what-to-eat ls poco
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 🍕 Poco Loco Czysta ┃ Kraków, Ul. Czysta 9 🍕 ┃
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Rating │ Excellent (9 / 200 reviews) │
│ Price │ 💰💰 │
│ Opening time │ 12:00 - 23:00 │
│ Website │ https://wolt.com/pl/pol/krakow/restaurant/poco-loco │
│ Phone │ +48 690800805 │
│ Estimates │ 35 minutes │
│ Payment Methods │ Card │
│ Description │ Zdrowa i lekka kuchnia meksykańska w nowej odsłonie... │
│ Tags │ Mexican, Taco, Latin american │
└─────────────────────┴────────────────────────────────────────────────────────┘
```

<h2>⚙️ Options </h2>


| Option | Description | Example usage |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| `--query`, `-q` | Command used to query restaurants by `Restaurant Name`, `Address` and `Tags`. Query search is case insensitive. | `what-to-eat ls -q pizza` |
| `--profile`, `-p` | Command used to set profile while listing restaurants. By default the `default` profile is used. | `what-to-eat ls -p work` |
| `--tag`, `-t` | Command used to search restaurants by `Tags`. Searching is case insensitive. | `what-to-eat ls -t italian` |
| `--sort`, `-s` | Command used to sort restaurants by one of following fields: `restaurant, address, delivery_cost, estimate_time, rating, price`. | `what-to-eat ls -s rating` |
| `--ordering`, `-o` | Command used to order restaurants ascending or descending by field specified in `--sort` option. | `what-to-eat ls -s rating --ordering desc` |
| `--limit`, `-l` | Command used to limit result to specified number of restaurants. | `what-to-eat ls -l 5` |
Loading

0 comments on commit 2a7fb09

Please sign in to comment.