Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Invictify/Jupter-Notebook-REST-API
Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.
https://github.com/Invictify/Jupter-Notebook-REST-API
data-science data-science-pipelines docker dockerfile fastapi jupyter python rest-api
Last synced: about 2 months ago
JSON representation
Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.
- Host: GitHub
- URL: https://github.com/Invictify/Jupter-Notebook-REST-API
- Owner: Invictify
- License: mit
- Created: 2020-03-31T22:48:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:56:51.000Z (about 2 years ago)
- Last Synced: 2024-08-01T00:41:54.511Z (5 months ago)
- Topics: data-science, data-science-pipelines, docker, dockerfile, fastapi, jupyter, python, rest-api
- Language: Jupyter Notebook
- Size: 25.4 KB
- Stars: 77
- Watchers: 3
- Forks: 10
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fastapi - Jupyter Notebook REST API - Run your Jupyter notebooks as RESTful API endpoints. (Third-Party Extensions / Developer Tools)
- awesome-jupyter-resources - GitHub
- awesome-fastapi - Jupyter Notebook REST API - Run your Jupyter notebooks as RESTful API endpoints. (Third-Party Extensions / Developer Tools)
README
# Jupter Notebook REST API
Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.## Running locally
#### Clone project
```
mkdir rest-project
cd rest-project
git clone https://github.com/Invictify/Jupter-Notebook-REST-API .
```#### Install via Pipenv
```
pipenv install
pipenv shell
```
> You can also use `pip install -r requirements.txt`### Add your notebook(s) to "src/notebooks"
There's an example notebook already in there called `scrape.ipynb`.### Run locally
```
pipenv run uvicorn src.server:app --reload
```
You can also do:```
chmod +x run.sh
./run.sh
```## Trigger a notebook.
With the server running, trigger notebook (relative path) like `notebooks/scrape.ipynb````python
import requests
r = requests.post("http://localhost:8000/trigger/notebooks/scrape.ipynb")
print(r.json())
```## Deployment
#### Create Heroku app
You'll only have to do this 1 time.
```
heroku apps:create
```### Using Git
```
git init
git add --all
git commit -m "Project commit"
git push heroku master
```### Using Docker
#### Login to Heroku Container Registry
```
heroku container:login
```#### Build & Push to Heroku
```
docker build -t -f Dockerfile.web .
heroku container:push web --recursive
heroku container:release web
```