This repository is the basis for a fast, efficient and scalable python API structure for data scientists.
This framework presents a continuous integration test using Travis CI, a Docker image to deploy your data science project, and, finally, a simple API Restful implementation to allow security access for everyone; facilitating the documentation, test, development, and deployment for production.
Combing all these things, this framework provides an potential DataOps procedure for your project. "DataOps is an automated, process-oriented methodology, used by analytic and data teams, to improve the quality and reduce the cycle time of data analytics ... DataOps focuses on continuous delivery by leveraging on-demand IT resources and by automating test and deployment". Wikipedia.
Important links: DockerHub, Documentation.
Each Operating System (OS) have its own steps.
Note: Docker CE (Community Edition), Docker EE (Enterprise Edition).
Download or clone this repository, and run
## Install requirements
$ pip install --no-cache-dir -r ./requirements.txt
## Running local - with Python
$ uvicorn app.main:API --port 5050
## Running local - with Docker
$ docker build -t ds-api .
$ docker run -it --rm --name api-container -p 5050:8080 ds-api
## Open browser
# http://127.0.0.1:8080/
## Open browser - Swagger documentation
# http://127.0.0.1:8080/docs
Done! You can access your API in http://localhost:5050/.
Create your endpoint logic (API), such as app/routers/hello_world.py.
Add the new endpoint to app/main.py; that is it, just run.
Useful personalizations:
- Add Python libraries for your API; see requirements.txt.
- Add new API routers; see app/main.py.
- Create new routers, such as app/routers/hello_world.py.
- Improve the continuos integration tests; see travis.yml.
- Improve the Docker image; see Dockerfile.
- Create an issue for any questions or suggestions!
- License MIT
- Created by Leonardo Mauro ~ leomaurodesenv