GithubHelp home page GithubHelp logo

bplmp / sme-pratoaberto-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prefeiturasp/sme-pratoaberto-api

0.0 2.0 0.0 30 KB

API da aplicação PratoAberto

License: GNU General Public License v3.0

Python 100.00%

sme-pratoaberto-api's Introduction

Maintainability

API

A API serve dados sobre as escolas e as refeições das escolas da rede pública da cidade de São Paulo.

Instalação

Instale os requisitos através do requirements.txt e configure uma variável de ambiente chamada API_MONGO_URI com o apontamento para a base.

pip install -r requirements.txt
export API_MONGO_URI=localhost:27017
FLASK_APP=app.py flask run

Endpoints

/escolas

Lista escolas da rede publica.

Argumentos de query string:

nome:   string - opcional
        Permite a filtragem da lista de escolas pelo nome

Retorno:

[
    {
        "_id": 91065,
        "nome": "EMEI ELIS REGINA - (TERCEI.)",
        "endereco": "R. ERNESTO MANOGRASSO, 340",
        "bairro": "CID. SÃO MATEUS",
        "lat": -23.611117,
        "lon": -46.479426
    },
    ...
]

/escola/int:id_escola

Lista detalhes de uma determina escola pelo seu identificador (código Escola Online - EOL)

Parametros:

id_escola:    int

Retorno:

{
    "nome": "EMEI ELIS REGINA - (TERCEI.)",
    "tipo_unidade": "EMEI",
    "tipo_atendimento": "TERCEIRIZADA",
    "agrupamento": 4,
    "endereco": "R. ERNESTO MANOGRASSO, 340",
    "bairro": "CID. SÃO MATEUS",
    "telefone": "(11)29199960",
    "lat": -23.611117,
    "lon": -46.479426,
    "idades": [
        "Z - UNIDADES SEM FAIXA"
    ]
}

/cardapios ou /cardapios/

Lista os cardapios disponíveis

Parametros:

data:   string - opcional
        Formato: YYYYMMDD

Argumentos de query string:

agrupamento:        string - opcional
tipo_atendimento:   string - opcional
tipo_unidade:       string - opcional
idade:              string - opcional
data_inicial:       string - opcional
data_final:         string - opcional

Retorno:

[
    {
        "data": "20170922",
        "idade": "1 A 3 MESES",
        "tipo_atendimento": "DIRETA",
        "tipo_unidade": "CEI_CONVENIADO",
        "agrupamento": "4",
        "cardapio": {
            "Jantar": [
                "FORMULA LÁCTEA"
            ],
            "Desjejum": [
                "FORMULA LACTEA"
            ],
            "Almoco": [
                "FORMULA LACTEA"
            ],
            "Lanche": [
                "FORMULA LÁCTEA"
            ]
        },
    },
    ...
]

/editor/cardapios

Permite a listagem e a alteração dos dados de cardápio.

Para acesso, é necessário enviar uma chave através do cabeçalho HTTP key. A chave deve ser a mesma que a variável de ambiente API_KEY

Argumentos de query string:

status:             string - opcional
agrupamento:        string - opcional
tipo_atendimento:   string - opcional
tipo_unidade:       string - opcional
idade:              string - opcional
data_inicial:       string - opcional
data_final:         string - opcional

Retorno:

[
    {
        "data": "20170922",
        "idade": "1 A 3 MESES",
        "tipo_atendimento": "DIRETA",
        "tipo_unidade": "CEI_CONVENIADO",
        "agrupamento": "4",
        "cardapio": {
            "Jantar": [
                "FORMULA LÁCTEA"
            ],
            "Desjejum": [
                "FORMULA LACTEA"
            ],
            "Almoco": [
                "FORMULA LACTEA"
            ],
            "Lanche": [
                "FORMULA LÁCTEA"
            ]
        },
    },
    ...
]

sme-pratoaberto-api's People

Contributors

vitorhirota avatar wagnerwar avatar foliveira3101 avatar pnspinelli avatar fe-oliveira avatar

Watchers

James Cloos avatar Bernardo Loureiro 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.