Coder Social home page Coder Social logo

bandecoapi's Introduction

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:

>>> 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'}}

bandecoapi's People

Contributors

maronato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.