Skip to content

OffedulDev/session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔑 Session Manager | Flask

📀 Last Update: 12/23/2021, 2:34 PM GMT+1

Session is a Session Managment Plugin to improve your Session Managment in Flask, to set it up you just have to initialize it with a token and assign it to the default session object in flask, here's an example:

import sessionOffedul
from flask import Flask, session

app = Flask(name)

@app.route("/")
def init():
sessionOffedul.InitializeSession("your token goes here")
session['session'] = sessionOffedul.GetSession()

✅ Installation

pip install sessionOffedul==0.4

👘 Create Object

sessionOffedul.CreateObject("selection", "top", str)
sessionOffedul.CreateObject("selection", ["top", "left", "right"], list)
sessionOffedul.CreateObject("selection", 43, int)
sessionOffedul.CreateObject("selection", {"faces": ['top': false, 'right': false]}, tuple)

👘 Update Session

Once you add an object to the session you must remember to update the session, to do so follow the following example:

sessionOffedul.UpdateSession()
session['session'] = sessionOffedul.GetSession()

👘 Print on file or convert Json to Session Object

With PrintContentOnFile function you can write on a file the prettified json on a file, oh did I mention it? This plugin supports json! You can load objects with a json format, to do so, follow the example:

jsonExample = {
"name": "selection",
"value": "top",
"type": "String"
}



obj = sessionOffedul.ConvertJsonToObject(jsonExample)
sessionOffedul.AddJson(obj)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages