ReQBodyMan to easily manage body data received with Request
Project description
ReQBodyMan
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
Usege
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ReQBodyMan-1.1.0.tar.gz.
File metadata
- Download URL: ReQBodyMan-1.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cbfc9e4fc078f2db287381c7e330911c16273fd83e73c28534725e6e18c176f
|
|
| MD5 |
05062e2fc3709b98dddfbc20e02b7d6b
|
|
| BLAKE2b-256 |
c3e91f89f1fcc82b22d9a5370c201f2e45392c0f27a2b1850501c31fdce2669f
|
File details
Details for the file ReQBodyMan-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ReQBodyMan-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
148afd5037367a76e5434cfb3f139b7e0f223581f1b76d62a3b5e5ec32641249
|
|
| MD5 |
d22924a433ae01f3c6dec38e632f463d
|
|
| BLAKE2b-256 |
2b263bdfd973dbba21d2e02a13d6dc1b2b3cd026ebc436c2caaf5acdef6b01fa
|