Skip to main content

Generate a Postman collection from your Flask application

Project description

https://img.shields.io/pypi/v/flask2postman.svg https://img.shields.io/pypi/status/flask2postman.svg https://img.shields.io/pypi/dw/flask2postman.svg

A tool that creates a Postman collection from a Flask application.

Install

$ pip install flask2postman

Example

Let’s say that you have a Flask project called “example” (see example.py), and you want to generate a Postman collection out of it.

You just need to tell flask2postman how to import the Flask instance, and optionally give a name to the Postman collection:

$ flask2postman example.app --name "Example Collection" --folders > example.json

If you don’t have a global Flask instance but rather use a function to initialize your application, that works too:

$ flask2postman example.create_app --name "Example Collection" --folders > example.json

This will generate the JSON configuration, and write it into the example.json file. You can then import this file into Postman (“Import Collection” button), and profit:

Postman screenshot

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask2postman-1.3.0.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file flask2postman-1.3.0.tar.gz.

File metadata

File hashes

Hashes for flask2postman-1.3.0.tar.gz
Algorithm Hash digest
SHA256 c16f54c32e4b6c9d18864783f673a66e3818146332e6f172963147bb8d030e72
MD5 ed09b5734e84c106ced47d48860d11b9
BLAKE2b-256 ddda785076d414daf35fd54d51ad4f2296a45d97b79f23fb078ed0ed420a4f9b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page