In the name of God, the Most Gracious, the Most Merciful.
PF-Flask-Swagger
PF Flask Swagger is created from produce Swagger API Documentation very quickly and easily.
pip install Flask
- Install PF Flask Swagger
pip install -U PF-Flask-Swagger
- Create file called quickstart.py and add below codes
from flask import Flask, redirect
from marshmallow import fields
from pf_flask_swagger.swagger.pf_swagger_decorator import post_request, post_upload_request
from pf_flask_swagger.flask.pf_flask_swagger import PFFlaskSwagger
from pf_flask_rest_com.api_def import FileField, APIDef
app = Flask(__name__)
flask_swagger = PFFlaskSwagger(app)
class PersonDTO(APIDef):
first_name = fields.String(required=True, error_messages={"required": "Please enter first name"})
last_name = fields.String(allow_none=None)
email = fields.Email(required=True, error_messages={"required": "Please enter email."})
income = fields.Float(allow_none=None)
image = FileField(allow_none=None)
@app.route('/')
def bismillah():
return redirect("/pf-flask-swagger-ui")
@app.route('/post-request')
@post_request(request_obj=PersonDTO, response_list=PersonDTO)
def post_request_endpoint():
return "PF Flask Swagger POST Request"
@app.route('/post-upload-request')
@post_upload_request(request_obj=PersonDTO)
def post_upload_request():
return "PF Flask Swagger File Upload Request"
if __name__ == '__main__':
app.run()
- Now run the Flask application.
Documentation
Install and update using pip:
pip install -U PF-Flask-Swagger
Please find the Documentation with example from hmtmcse.com
Donate
Problem Fighter develops and supports PF-Flask-Swagger and the libraries it uses. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects.
Contributing
For guidance on setting up a development environment and how to make a contribution to PF-Flask-Swagger, see the contributing guidelines.
Links
- Changes : https://opensource.problemfighter.org/flask/pf-flask-swagger
- PyPI Releases : https://pypi.org/project/pf-flask-swagger
- Source Code : https://github.com/problemfighter/pf-flask-swagger
- Issue Tracker : https://github.com/problemfighter/pf-flask-swagger/issues
- Website : https://www.problemfighter.com/open-source
Metadata
Release files for PF-Flask-Swagger 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| PF-Flask-Swagger-1.0.2.tar.gz | 14.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PF_Flask_Swagger-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 484.2 kB
Release files / PF-Flask-Swagger-1.0.2.tar.gz
| Download URL | PF-Flask-Swagger-1.0.2.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
395b38dd52e77138f8287f36f596db09a96402572eb9e6fc5a5e487754f9e718
|
|
BLAKE2b-256 checksum How to use checksums |
cfd66eae22dc9a0633eb4e4e3ec9bb85f2d0480e4c485b290884db4a7b01f819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Release files / PF_Flask_Swagger-1.0.2-py3-none-any.whl
| Download URL | PF_Flask_Swagger-1.0.2-py3-none-any.whl |
|---|---|
| Size | 470.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85bbe96792eedbfc877a2343a7a8410030c75ae6dd37b24d1121deacbc5b5181
|
|
BLAKE2b-256 checksum How to use checksums |
57b4e862c0f34699d5e3c9cb461571f4ac414e48fc33e80bb25942b5c8f57bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Security for PF-Flask-Swagger 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.