docs/charpy_swagger.yml
swagger: '2.0'
info:
description: This is a simple API to get json and display charts form csv files
version: 1.0.0
title: Charpy
# put the contact info for your development or API team
contact:
email: sylhare@outlook.com
license:
name: MIT
url: https://github.com/Sylhare/charpy/blob/master/LICENSE
tags:
- name: "dataframe"
description: "Your csv dataframe into json"
externalDocs:
description: "Find out more about Pandas dataframe"
url: "https://pandas.pydata.org"
- name: "chart"
description: "Render your csv into a chartjs graph"
externalDocs:
description: "Find out more about chartjs"
url: "http://www.chartjs.org/"
schemes:
- "http"
paths:
/dataframe:
get:
tags:
- dataframe
summary: list of all column of the dataframe
description: Returns list of all columns
operationId: getDataframe
responses:
"200":
description: List all columns
schema:
title: Dataframe
type: array
items:
$ref: '#/definitions/Dataframe'
"404":
description: Dataframe not found
/dataframe/html:
get:
tags:
- dataframe
summary: list of all column of the dataframe
description: Returns list of all columns
operationId: getDataframeHTML
responses:
"200":
description: List all columns
schema:
title: Dataframe
type: array
items:
$ref: '#/definitions/Dataframe'
/dataframe/column/{column_name}:
get:
tags:
- dataframe
summary: list of all column of the dataframe
description: Returns list of all columns
operationId: getColumn
parameters:
- in: path
name: column_name
description: name of the column to display
required: true
type: string
responses:
"200":
description: List all columns
schema:
title: Dataframe
type: array
items:
$ref: '#/definitions/Dataframe'
/chart/types:
get:
tags:
- chart
summary: list of chart type implemented
description: Returns list of chart type
operationId: getChart
responses:
"200":
description: List all charts
schema:
title: Charts
type: array
items:
$ref: '#/definitions/Chart'
/chart/draw/{chart_type}:
get:
tags:
- chart
summary: Draw the specified chart based on the type
description: Return a html page with the chart
operationId: getDrawnChart
parameters:
- in: path
name: chart_type
description: type of the chart to display
required: true
type: string
responses:
"200":
description: successful operation
schema:
$ref: "#/definitions/Chart"
"501":
description: Chart not yet implemented
definitions:
Chart:
type: object
properties:
id:
type: integer
format: int64
type:
type: string
Dataframe:
type: object
properties:
id:
type: integer
format: int64
column:
type: string