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 lunchbot-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lunchbot-python-0.1.1.tar.gz
.
File metadata
- Download URL: lunchbot-python-0.1.1.tar.gz
- Upload date:
- Size: 7.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab9c6c6f5e4188b0ed6d455af494eaee357d97f589bf1f918242cb14ffca1f88 |
|
MD5 | 3cd457f1b09b90391c830f8612d2aca5 |
|
BLAKE2b-256 | f7b3aa17964fbd2607c435361cf25efbb4a64bced006c0859128b6d12d00e506 |
File details
Details for the file lunchbot_python-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: lunchbot_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6b9381e5322d575dff4ab7fc12503e3f377b6d407b29e9df4855195a838d953 |
|
MD5 | 06ba8face8977374bffd17ba36d6de73 |
|
BLAKE2b-256 | 4d46665fa2fa9059c1ef33bec534bd932e78011e87df256e2fd6702d7838ef3d |