collab-uniba / pynblint

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

Added end-point for linting a local repository as a .zip file #50

Closed RomitoVincenzo closed 3 years ago

RomitoVincenzo commented 3 years ago

Using:

curl -X 'POST' \
  'http://127.0.0.1:8000/linters/repo-linter/' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'local_project=@Sentiment_Analysis_4SE_BERT-master.zip;type=application/x-zip-compressed' \
  -F 'bottom_size=4' 

Is now possible to request the linting of a local project as a .zip file, and, in this case of the Sentiment_Analysis_4SE_BERT to get the following response:

{
  "data": [
    {
      "notebookName": "Sentiment_Analysis_4SE_BERT\\notebooks\\cross-platform-w-bert.ipynb",
      "notebookStats": {
        "numberOfCells": 13,
        "numberOfMDCells": 0,
        "numberOfCodeCells": 13,
        "numberOfRawCells": 0
      },
      "lintingResults": {
        "linearExecutionOrder": true,
        "numberOfClassDefinitions": 0,
        "numberOfFunctionDefinitions": 0,
        "allImportsInFirstCell": false,
        "numberOfMarkdownLines": 0,
        "numberOfMarkdownTitles": 0,
        "bottomMarkdownLinesRatio": 0,
        "nonExecutedCells": 0,
        "emptyCells": 0,
        "bottomNonExecutedCells": 0,
        "bottomEmptyCells": 0
      }
    },
    {
      "notebookName": "Sentiment_Analysis_4SE_BERT\\notebooks\\github-w-bert.ipynb",
      "notebookStats": {
        "numberOfCells": 17,
        "numberOfMDCells": 0,
        "numberOfCodeCells": 17,
        "numberOfRawCells": 0
      },
      "lintingResults": {
        "linearExecutionOrder": true,
        "numberOfClassDefinitions": 0,
        "numberOfFunctionDefinitions": 0,
        "allImportsInFirstCell": false,
        "numberOfMarkdownLines": 0,
        "numberOfMarkdownTitles": 0,
        "bottomMarkdownLinesRatio": 0,
        "nonExecutedCells": 0,
        "emptyCells": 0,
        "bottomNonExecutedCells": 0,
        "bottomEmptyCells": 0
      }
    },
    ...
}