Generate a Postman collection from your Flask application
Project description
A tool that creates a Postman collection from a Flask application.
Install
$ pip install flask2postman
Example
We have a Flask project called “example”, (see example.py
), and we want
to generate a Postman collection out of it.
We just need to tell flask2postman
how to import the Flask instance, and
optionally give a name to the collection:
$ flask2postman example.app --name "Example Collection" --folders > example.json
This will generate the JSON configuration, and write it into the
example.json
file.
Then we just have to import this file into Postman (“Import Collection” button), and profit:
On a side note, you can see that endpoint’s docstrings are automatically imported as descriptions.
Usage
usage: flask2postman [-h] [-n NAME] [-b BASE_URL] [-a] [-i] [-f]
flask_instance
positional arguments:
flask_instance
optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Postman collection name (default: current directory
name)
-b BASE_URL, --base_url BASE_URL
the base of every URL (default: {{base_url}})
-a, --all also generate OPTIONS/HEAD methods
-i, --indent indent the output
-f, --folders add Postman folders for blueprints
License
MIT
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.