ReQBodyMan to easily manage body data received with Request
Project description
Project Description
ReQBodyMan is a package that you can use to manage the validations of body data coming with Request more effectively.
Installation
1 Install to Package
For Windows
pip install ReQBodyMan
For Linux/MacOs
pip3 install ReQBodyMan
2 Dependencies Package
flask
Usage
1 Import The Package
from ReQBodyMan.ReQBodyMan import ReQBodyMan
2 Get Form Data
If the data comes from the request with a form, you can get the data as follows.
Data : string, int, float, boolean, list, dict,
Parameters : contextName, variableType, booleanType=NoneRequired
booleanType default = "int"
Return: data
data = self.ReQBodyMans.form("data_name", "str")
data = self.ReQBodyMans.form("data_name", "int")
data = self.ReQBodyMans.form("data_name", "float")
data = self.ReQBodyMans.form("data_name", "bool", booleanType="bool")
data = self.ReQBodyMans.form("data_name", "bool", booleanType="int" )
data = self.ReQBodyMans.form("data_name", "list")
data = self.ReQBodyMans.form("data_name", "dict")
If Variable Type is sent outside the specified format, return None.
3 Get Json Data
Data : string, int, float, boolean, list, dict,
Parameters : contextName, variableType, booleanType=NoneRequired
booleanType default = "int"
Return : Data
data = self.ReQBodyMans.json("data_name", "str")
data = self.ReQBodyMans.json("data_name", "int")
data = self.ReQBodyMans.json("data_name", "float")
data = self.ReQBodyMans.json("data_name", "bool", booleanType="bool")
data = self.ReQBodyMans.json("data_name", "bool", booleanType="int")
data = self.ReQBodyMans.json("data_name", "list")
data = self.ReQBodyMans.json("data_name", "dict")
If Variable Type is sent outside the specified format, return None.
4 Get File
Data : file
Parameters : fileName
Return: file
file = self.ReQBodyMans.file("fileName")
If FileName is not in request.file, the value "The {fileName} is not in request.files" is returned.
5 Get Params
Data : string, int, float, boolean, list,
Parameters : variableName, variableType, booleanType=NoneRequired
booleanType default = "int"
Return : data
data = self.ReQBodyMans.params("data_name", "str")
data = self.ReQBodyMans.params("data_name", "int")
data = self.ReQBodyMans.params("data_name", "float")
data = self.ReQBodyMans.params("data_name", "bool", booleanType="bool")
data = self.ReQBodyMans.params("data_name", "bool", booleanType="int")
data = self.ReQBodyMans.params("data_name", "list")
If Variable Type is sent outside the specified format, return None.
Release Note
v.1.1.0
- Added dict property to Params.
- Added dict property to Json
- The return value for bool type has been added to return int or bool type according to the value to be given with booleanType.
- Code refactor.
v.1.0.1
- ReadMe file updated
v.1.0.0
- Project published.
ReQBodyMan is a BrainyTech Product.
Developer : Murat Bilginer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ReQBodyMan-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c34d2069a3ed605c7a1789b0d3ea225e4b34c0284438b880a56c016e207c445 |
|
MD5 | 54ea03347bf2317ebb523b979f447ced |
|
BLAKE2b-256 | 47176eda13530c492be139ee8ce48133beedf84dc4cb5b797f9a32b230100e08 |