Request preprocessor for flask requests
Project description
FLASK REQUEST PRE PROCESSOR
Library to preprocess Flask app request generically with vanilla flask or with any other flask packages eg:flask_restful
Removes the need boilerplate code for extracting and type validating and type cast of request payload from rest api endpoint so that the endpoint can purely focus on the core logic implementation
All the extracted, validated, type casted, and/or aliased parameters will be passed to the endpoint as keyword arguments
Installation
pip install Flask-RequestPreProcessor
Dependencies
python>=3.6
Flask>=1.1.*
funcargpreprocessor==0.9.*
Usage
Simple GET request
from flask_requestpreprocessor import parse_request_query_param, DateArg
@parse_request_query_param(
{
'pageNo':{'data_type':int, 'alias':'page_no', 'min_val':1 }
,'count':{'data_type':int, 'value_list':[10,20,30,50,100] }
, 'signedUpDate':{'data_type':DateArg('%Y-%m-%d'), 'alias':'signed_up_date'}
, 'filterCondition2':{....}
.....
}
)
def get_user_list(page_no=1, count=10, signed_up_date=None, **other_filter_conditions):
pass
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
Close
Hashes for Flask-RequestPreProcessor-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f033929f19acd04191d120fd99b9991a875c6e235693a0329d80c8a30051785d |
|
MD5 | 73c3cc8c90222d71cebf1ecf189d986b |
|
BLAKE2b-256 | 544f55fd40f8d1fdbc26651b855045db6c42bf1edae162896ccd612b0a69117c |
Close
Hashes for Flask_RequestPreProcessor-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3b1242957a581b09fb2febfda3d267f8fea5793f8c38e65b206e86da4960e1c |
|
MD5 | a0a96e8b28f25fca7d6936aa77db4f98 |
|
BLAKE2b-256 | 6a44a847164d143f0b9dde6de44d8de41da05b16f79d6dfb97ad9ac708105009 |