collab-uniba / pynblint

Pynblint is a linter for Python Jupyter notebooks.
MIT License
40 stars 2 forks source link

[API] Lint a single notebook #31

Closed louieQ closed 3 years ago

louieQ commented 3 years ago

As a user of the pynblint REST API, I want to be able to upload my Jupyter notebook with a POST HTTP request and get QA analysis results from pynblint.

For example, I might call the pynblint web API as follows:

curl -X POST \
     -H "Content-Type: multipart/form-data" \
     -F "data=@test_notebook.ipynb" http://pynblint.io/api/linters/nb-linter/

And get the following JSON object in the response body:

{
    "data": {
        "notebookName": "test_notebook.ipynb",
        "numberOfClassDefinitions": 1,
        "numberOfFunctionDefinitions": 4,
        "allImportsInFirstCell": true,
        "...": "..."
    }
}
louieQ commented 3 years ago

@RomitoVincenzo I've slightly changed the format of the JSON object that should be shipped in the response body. I did the same also in #32 and #33.