Skip to main content

API to get menus from Unicamp's bandeco

Project description

# Bandeco API

API to get menus from Unicamp's bandeco

## Install

run `pip install bandecoapi`

## Usage

The main endpoint is the `bandecoapi.api.get_menu` function.

```
bandecoapi.api.get_menu()

Fetch menu from Unicamp's servers

Args:
menus (list): List of menus to fetch
Options: breakfast, lunch, veglunch, dinner, vegdinner
days_delta (int, optional): Fetch menu 'n' days from now
hours_delta (int, optional): Fetch menu 'n' hours from now
date (str, optional): Date to fetch menu from (YYYY-mm-dd) - overrides days and hours delta

Returns:
dict:
menu (dict, optional): Menus from the day, if available
error (str, optional): Error message explaining what went wrong, or if there is no menu for the day

```

Example:
```Python
>>> from bandecoapi import api
>>> menus = ["breakfast", "lunch"]
>>> days_delta = 2
>>> api.get_menu(menus=menus, days_delta=days_delta)
{'menu': {'lunch': 'Arroz e feijão\nPrato principal: Carne moída nutritiva\nMacarrão alho e óleo\nPts com abóbora seca\nSalada: Acelga\nSobremesa: Melancia\nSuco: Laranja\nObservações: O cardápio contém glúten no pão e no macarrão alho e óleo. Não contém lactose. Informamos que os restaurantes: Ru,ra e rs estão funcionando normalmente. Não esqueça, sua caneca !', 'breakfast': 'Café, leite, pão, margarina, geleia, fruta'}}
```

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

bandecoapi-1.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file bandecoapi-1.1.tar.gz.

File metadata

  • Download URL: bandecoapi-1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.5

File hashes

Hashes for bandecoapi-1.1.tar.gz
Algorithm Hash digest
SHA256 48fd9dc9a63b75eb58a478b4596da296954a6ee5e9b38ad1245125ab7b0a4d92
MD5 54a4b5431ae6e9f5a8a7b6ef2ab2076b
BLAKE2b-256 1cbf43f8ac2038c604b30c46a29a5c09445bc45ef56e95f4a3b3fe9464c962ee

See more details on using hashes here.

Supported by

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