A simple example of python api for real time machine learning, using scikit-learn, Flask and Docker
18/100 healthLoading repository data…
Loading repository data…
Lucasbrunoferreira / repository
A simple example to implements a http web service with python, tornado framework, docker, mongo and marshmallow schemas.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This is a example, to implements a http web server (API RESTfull) in python with tornado framework, mongo, redis and docker..
| Dependency | For what? | Link |
|---|---|---|
| tornado | web framework server | https://www.tornadoweb.org/ |
| pymongo | mongo database driver | https://api.mongodb.com/python/current/ |
| marshmallow | ODM (Object Document Mapper) | https://marshmallow.readthedocs.io |
| redis | caching requests | https://redis-py.readthedocs.io |
| logzero | create application logs | https://logzero.readthedocs.io/en/latest/ |
| unittest | unit tests | https://docs.python.org/3/library/unittest.html |
/api/v1/users - Get all users/api/v1/users/{user_id} - Get only the user for the id entered in the parameter/api/v1/user - Create new user/api/v1/users/{user_id} - Edit the user referring to the id entered in the parameter/api/v1/users/{user_id} - Delete the user referring to the id entered in the parameterHandlers - It is the layer responsible for manipulating requests and performing business rules.
Persistence - Layer responsible for data manipulation.
- Data modeling.
Selected from shared topics, language and repository description—not editorial ratings.
A simple example of python api for real time machine learning, using scikit-learn, Flask and Docker
18/100 healthimgVOID /
A simple Docker sandbox example and a ready-to-use autograder API. Based on asynchronous FastAPI and disposable Docker containers. Three modes of operation: Python subprocess, Python Docker SDK and Python on Whales.
23/100 healthDatabase - Connection and manipulation with database.
Tests - Layer with unit application tests
Util - Gathers higher-use (repetitive) codes in the project.
Run all unit application tests
cd project-folderpython -m unittestAfter preparing your environment and your virtualenv, follow the steps:
cd project-folderpip install -r requirements.txtpython server.pyRun application with docker:
cd project-folderdocker build -t api-tornado-img .docker run -d -p 8080:8080 --name api-tornado -e MONGO_URI="mongodb://user:password@host:port/database" -e REDIS_HOST="127.0.0.1" -e REDIS_PORT=6379 -e REDIS_PASS="your-redis-pass" api-tornado-img:latestEste é um exemplo, para implementar um servidor web http (API RESTfull) em python com framework tornado, mongo, redis e docker.
| Dependência | Qual o uso? | Link |
|---|---|---|
| tornado | servidor web | https://www.tornadoweb.org/ |
| pymongo | conexão com o banco de dado NoSQL mongo | https://api.mongodb.com/python/current/ |
| marshmallow | ODM (Object Document Mapper) | https://marshmallow.readthedocs.io |
| redis | caching requisições | https://redis-py.readthedocs.io |
| logzero | criação de logs da applicação | https://logzero.readthedocs.io/en/latest/ |
| unittest | testes unitários | https://docs.python.org/3/library/unittest.html |
/api/v1/users - Buscar todos os usuários cadastrados/api/v1/users/{user_id} - Busque apenas o usuário referente ao id informado no paramêtro/api/v1/users - Criar um novo usuário/api/v1/users/{user_id} - Editar o usuário referente ao id informado no parâmetro/api/v1/users/{user_id} - Deletar o usuário referente ao id informado no parâmetroHandlers - É a camada responsável por manipular as requisições e realizar as regras de negócios.
Persistence - Camada responsável pela manipulação de dados.
Schemas - Modelagem de dados.
Database - Conexão e manipulação com banco de dados.
Tests - Camada com os testes unitarios da aplicação
Util - Reúne códigos de uso mais alto (repetitivos) no projeto
Para realizar todos os testes do projeto, execute:
cd project-folderpython -m unittestDepois de preparar seu ambiente e seu virtualenv, siga os passos:
cd project-folderpip install -r requirements.txtpython main.pySe preferir, pode executar a aplicação com o docker:
cd project-folderdocker build -t api-tornado .docker run -d -p 8080:8080 --name api-tornado -e MONGO_URI="mongodb://user:password@host:port/database" -e REDIS_HOST="127.0.0.1" -e REDIS_PORT=6379 -e REDIS_PASS="your-redis-pass" api-tornado-img:latestLucasbrunoferreira /
📡 A simple example to implements a http web service with python, flask framework, docker, mongo and marshmallow schemas.
inikhilkedia /
** This assignment will combine a few things that you have learned in this class and will require a little learning on your own. Do your best and be creative. If you need help ask sooner rather than later in slack. Myself and your classmates are here to help and do not wait to the last minute to do this assignment. ** You may work in two person teams, if you plan to do so please email me to let me know who you are working with. You may NOT work in multiple teams. ** You may use python, JAVA or node.js (javascript) for this assignment. ** I have listed some tutorials below, but you may need to google some on your own. What You Will Do: You will create a RESTful web service that runs in a docker container. Your web service will contain two GET routes: One that displays a collection of records One that displays a single record that the corresponds to an ID Example: If I created two routes, /customers and /customers/35 (note, that 35 is the ID of a given customer in my database) The data returned from your web service routes must be in JSON or XML form. Note, if you would like to load your results in a web page you are welcome to do so, you just need a way to display the data your routes return in a web browser. You will create a hardcoded JSON file based database as the backing datastore for your web service routes. Note, if you are comfortable using a SQL or NO-SQL database as your datastore you may do so but it is not required. Also note, your data model is something you make up. Meaning you can store a collection of cars, customers, food items, restaurants, video games, sports teams etc. Be creative :) This is similar to what the presenter did in the GraphQL video we watched in our last class. He used a JSON file as a database for his demo. You will have to present your work to the class, with a live demo or video you recorded of you running your web service from own computer. This is not optional! Tutorials: Docker What is docker: https://www.youtube.com/watch?v=dz5_lsWlfTU Installing Docker: Windows - https://www.youtube.com/watch?v=wCTTHhehJbU Docker Tutorial (Step by Step) - https://www.youtube.com/watch?v=Vyp5_F42NGs https://blog.talpor.com/2015/01/docker-beginners-tutorial/ https://docs.docker.com/engine/getstarted/ https://hackr.io/tutorials/learn-docker Python RESTful services using Flask: https://code.tutsplus.com/tutorials/building-restful-apis-with-flask-diy--cms-26625 https://impythonist.wordpress.com/2015/07/12/build-an-api-under-30-lines-of-code-with-python-and-flask/ Node + Express REST API Example https://closebrace.com/tutorials/2017-03-02/creating-a-simple-restful-web-app-with-nodejs-express-and-mongodb Node Simple RESTful API (shows using json file as DB) https://www.tutorialspoint.com/nodejs/nodejs_restful_api.htm Dockerize your Flask App https://www.smartfile.com/blog/dockerizing-a-python-flask-application/ http://containertutorials.com/docker-compose/flask-simple-app.html Docker + Spring Boot (JAVA) https://spring.io/guides/gs/spring-boot-docker/ To Submit The Assignment (Read Carefully): ** Please follow all instructions as not following them will lead to loss of points. Create a github account. Create public github repository and all all of your source code for this assignment to the repository. (See the “getting started with github” document in the “Course Documents > Tutorials & Cheat Sheets” folder for help) Make sure to add a README file to the root of your repository that describes what your web service does. Create a presentation powerpoint slide deck that contains 2 slides: A title slides that contains your name(s) and the name of your web service project A slide that talks a little about your data model Submit the following to the “Submit Assignment” thread in RESTful Web Service Implementation + Docker discussion board. The powerpoint slide file. Link to your public github repository that contains all of the source code including your JSON database file. Note, if you worked with classmate for this assignment...if you did please state the person you worked with.
31/100 healthalexjosesilva /
An example of an simple web app based on Flask and MySQL and making it run with Docker and docker-compose.
17/100 healthrobsonlimadeveloper /
RemoteLab API is a simple RESTful API example built with Python using the Flask framework, SQLAlchemy as the ORM, and MariaDB as the database. The project is containerized with Docker and orchestrated with Docker Compose for easy deployment and development.
31/100 health