Skip to main content

Python interface for the Lunchbot API.

Project description

Lunchbot-Python

A Python package for interracting with the @Nero2k Lunchbot API, an API that provides the weekly lunch menu of the Eatery Kista Nod restaurant.

The package fully parses menu attributes into Python objects and is very easy to use.

Installation

Installation is done via:

pip install eatery-python

Quickstart

For a more detailed guide with more code examples, please refer to the the official documentation.

There is also an image quickstart example and a compact example of the code below, but that is also available in the official documentation linked above.

"""Websocket/API example
This example shows you the "standard" way of getting the week
menu, which will return a parsed list of Day objects. The Day class is implemented with this API
NOTE: Want to do this with less code?
Check the compact example."""
from eatery_nod import EateryNod #Import the library
menu = EateryNod.Menu() #Create a menu object
menu.initialize() #Initialize (this is only required when using WebSockets)
print("Retrieving menu...") #Print out the status
week_menu = menu.get_menu() #Get the menu
for day in week_menu: #Loop through all the days in the menu
    menu_items_str = "\n".join(day.menu_items) #Format the menu items to a pretty string as they are returned as a list
    print(day.day_name_sv) #Print out the day name (in Swedish)
    print(menu_items_str) #Print out the menu items
    print("Day information:") #Print out a nice divider
    print("Date: " + str(day.day_date)) #Print out the day date
    print("Dessert served?: " + str(day.dessert_served)) #Print out if dessert is served (this will print either True or False)
    print("Pancakes served?: " + str(day.pancakes_served)) #Print out if pancakes are served (this will print either True or False)
    print("Hamburgers served?: " + str(day.burgers_served)) #Print out if hamburgers are served (this will print either True or False)
    print("---------------------------------------------------") #Print out a divider line
last_retrieved = menu.last_retrieved["json"] #Get when the menu was last retrieved
print("Menu retrieved: " + str(last_retrieved)) #Print out when the menu was last retrieved.

Changelog

See the "Releases" tab and the documentation.

More documentation

All functions, variables, and attributes of the code are documented. You can find it on the official library documentation, which is provided by GitBook and hosted on https://lunchbot-python.albins.website.

(no code has been uploaded yet, it's just the initial repository that has been created)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lunchbot-python-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lunchbot_python-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file lunchbot-python-0.1.0.tar.gz.

File metadata

  • Download URL: lunchbot-python-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for lunchbot-python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 efa57d2ab9286fb6e1f2eeb6fabf628f20181489e89c9d520a80f75da5c8e07c
MD5 034ccc314a0701e1243da40ad0b0f4a6
BLAKE2b-256 caa5c501b82b645c4384ed21b3e75b71cafc77e772799bc77deb0d2e52c1a062

See more details on using hashes here.

File details

Details for the file lunchbot_python-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lunchbot_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2

File hashes

Hashes for lunchbot_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4ec2b0ab0f1dd53356e0999bf0ac95561954161a78f1bfd0e17671050e763e5
MD5 de14cd3b5dc66bc44b1c6acc23d471c0
BLAKE2b-256 a8ece72b71d65753e2bb94f6581764b63ae29d46e6bf363d244909132fa5ffee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page