DEV Community

Cover image for 🐼 Restaurant menu, as data 😋
adriens
adriens

Posted on

🐼 Restaurant menu, as data 😋

❔ About

At Nouméa, I have a kind of "fétiche" restaurant called "Au p'tit café"

They :

  • 👐 Are very kind people : I love spend time there (at least once a week)
  • 🧑‍🍳 Have awesome creative and tasty menus
  • Have a unique management approach and have implemented a 4.5 days work week:

Au P’tit Café, une semaine de quatre jours et demi – DNC.NC

Le restaurant de Nouméa est ouvert du mardi au vendredi. Le lundi, une partie de l’équipe profite d’un jour de repos, tandis qu’une autre prépare des plats à emporter. Les 12 employés et gérants tentent ainsi de concilier passion, travail et vie personnelle.

favicon dnc.nc

What is very convenient is that their website describes very well its menus for the week, with a core philosophy:

  • 🤏 Few menus
  • ☝️ Focused on high quality and fresh food

I do often go and read their website:

🤔 Inception

... and was wondering if I could build something "nerdy" around it...(for example play with it from my terminal 🤓)

💡 The idea

As I did never create a Python package, I finally decided to :

  1. Create & release a dedicated poetry package that would get the menus data... so anyone could have fun with it (with a very few set of lines of code)
  2. Get the menu's datas as pandas dataframe... and csv

💭 Why Python ?

As Python is very widely used to create many things like:

🤓 Do it

I finally created the package :

GitHub logo adriens / auptitcafe-sdk

😋 SDK Python pour accéder aux menus du restaurant "Au p'tit café" - Nouméa, Nouvelle-Calédonie

PyPI - Implementation PyPI - Python Version PyPI - Wheel PyPI - Format PyPI

About

Finally a Python package to make getting Au p'it café's menus a piece of (cheese) cake.😅

With this package you can:

... and get them as list of objects or csv.

👉 See it live on Kaggle 👈

🔖 Social networks

IMAGE ALT TEXT HERE

🤓 Nerd resources

🚀 Quickstart

For the impatients, here is a quick and ready to use code snippet:

# Install the package
!pip install auptitcafe --upgrade
# Make some imports
from auptitcafe.menus import Menus
import pandas as pd

# Create the main utility instance
menu_instance = Menus()

# Dump menus as a csv file
menus = 'menus.csv'
menu_instance.to_csv(menus)

# Load menus in a panda dataframe
df = pd.
Enter fullscreen mode Exit fullscreen mode

... then released it on pypi:

auptitcafe · PyPI

SDK pour interagir avec http://auptitcafe.nc/menu/

favicon pypi.org

Finally, it became as easy as follows to get menus as data:

# Install the package
!pip install auptitcafe

# Make some imports
from auptitcafe.menus import Menus
import pandas as pd

# Create the main utility instance
menu_instance = Menus()

# Dump menus as a csv file
menus = 'menus.csv'
menu_instance.to_csv(menus)

# Load menus in a pandas dataframe
df = pd.read_csv(menus)
# Diplay dataframe
df
# Be creative with dataframe 
Enter fullscreen mode Exit fullscreen mode

🕹️ Enjoy the data on Kaggle

Image description

🍿 Demo

📑 Resources

Top comments (4)

Collapse
 
adriens profile image
adriens

Collapse
 
adriens profile image
adriens
Collapse
 
adriens profile image
adriens
Collapse
 
adriens profile image
adriens