Skip to content

An example of using the Apwrite function to generate graphs in Python using a URL endpoint and parameters.

Notifications You must be signed in to change notification settings

MatusFercak/graph-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

📈 Python Graph genration Function

Generate a graph using only the specified URL and parameters.

🧰 Usage

GET /graph.png

URL Parameters

Name Description Location Type Sample Value
x Values of x-axis. Query string csv 1,2,3,4,5,6,7,8
y Values of y-axis. Query string csv 1,2,3.5,4,2.1,1.2,2.5,3.2
x_type Type of values in x Query string String num
y_type Type of values in y Query string String num
x_label Label for x-axis Query string String X_label
y_label Label for y-axis Query string String Y_label
title Graph title Query string String X_label

You can use the function with parameters provided in the request body, except for the change in the x and y attributes, where we insert arrays ( lists ).

Sample URL: https://65196d46cc349ea4b149.appwrite.global/graph.png?x=1,2,3,4,5,6,7,8&y=1,2,3.5,4,2.1,1.2,2.5,3.2&x_type=num&y_type=num&x_label=X_label&y_label=Y_Label&title=Graph_titl

Sample 200 Response.

Graph

Sample 400 Response.

{
	"ok": false,
	"error": "ErrorMessage: --//--"
}

Sample 405 Response. Response when the request method was POST, PUT, PATCH, DELETE

{
	"ok": false,
	"message": "Try GET method and follow instruction -> https://github.com/MatusFercak/graph-generator"
}

⚙️ Configuration

Setting Value
Runtime Python (3.9)
Entrypoint src/main.py
Build Commands pip install -r requirements.txt
Permissions any
Timeout (Seconds) 15

🔒 Environment Variables

No environment variables required.

About

An example of using the Apwrite function to generate graphs in Python using a URL endpoint and parameters.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages