https://github.com/leomaurodesenv/data-science-api-framework
A simple framework to test and deploy your Data Science API
https://github.com/leomaurodesenv/data-science-api-framework
api api-rest data-science dataops docker flask-api python
Last synced: 4 months ago
JSON representation
A simple framework to test and deploy your Data Science API
- Host: GitHub
- URL: https://github.com/leomaurodesenv/data-science-api-framework
- Owner: leomaurodesenv
- License: mit
- Created: 2020-07-15T19:55:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-25T12:45:44.000Z (10 months ago)
- Last Synced: 2025-06-06T14:43:58.947Z (7 months ago)
- Topics: api, api-rest, data-science, dataops, docker, flask-api, python
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Data Science API Framework
[](LICENSE)
[](https://github.com/leomaurodesenv/data-science-api-framework)
[](https://www.codacy.com/manual/leomaurodesenv/data-science-api-framework?utm_source=github.com&utm_medium=referral&utm_content=leomaurodesenv/data-science-api-framework&utm_campaign=Badge_Grade)
[](https://travis-ci.com/leomaurodesenv/data-science-api-framework)
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](https://travis-ci.com/), a [Docker](https://www.docker.com/) 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](https://en.wikipedia.org/wiki/DataOps).

---
## Start Coding
### Installation
Important links: [DockerHub](http://hub.docker.com/), [Documentation](https://docs.docker.com/).
Each Operating System (OS) have its own steps.
**Note**: Docker CE (Community Edition), Docker EE (Enterprise Edition).
### Running
Download or clone this repository, and run
```shell
## 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/.
### Coding your API
Create your endpoint logic (API), such as [app/routers/hello_world.py](app/routers/hello_world.py).
Add the new endpoint to [app/main.py](app/main.py); that is it, just run.
---
## Deep personalization
Useful personalizations:
- Add Python libraries for your API; see [requirements.txt](requirements.txt).
- Add new API routers; see [app/main.py](app/main.py).
- Create new routers, such as [app/routers/hello_world.py](app/routers/hello_world.py).
- Improve the continuos integration tests; see [travis.yml](travis.yml).
- Improve the Docker image; see [Dockerfile](Dockerfile).
- Create an issue for any questions or suggestions!
---
## Also look ~
- License [MIT](LICENSE)
- Created by Leonardo Mauro ~ [leomaurodesenv](https://github.com/leomaurodesenv/)