Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numberly/flask2postman
:rocket: Generate a Postman collection from your Flask application
https://github.com/numberly/flask2postman
flask postman python python3
Last synced: 5 days ago
JSON representation
:rocket: Generate a Postman collection from your Flask application
- Host: GitHub
- URL: https://github.com/numberly/flask2postman
- Owner: numberly
- License: mit
- Created: 2015-08-28T11:12:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-15T20:25:29.000Z (over 2 years ago)
- Last Synced: 2025-01-06T12:10:34.502Z (6 days ago)
- Topics: flask, postman, python, python3
- Language: Python
- Homepage:
- Size: 152 KB
- Stars: 146
- Watchers: 10
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-flask - flask2postman - Generate a Postman collection from your Flask application (Development (Debugging/Testing/Documentation))
- awesome-flask - flask2postman - Generate a Postman collection from your Flask application (Development (Debugging/Testing/Documentation))
- awesome-flask - flask2postman - Generate a Postman collection from your Flask application (Development (Debugging/Testing/Documentation))
- jimsghstars - numberly/flask2postman - :rocket: Generate a Postman collection from your Flask application (Python)
README
.. _Postman: https://www.postman.com/
.. _Flask: http://flask.pocoo.org/=============
flask2postman
=============.. image:: https://img.shields.io/pypi/v/flask2postman.svg
:target: https://pypi.python.org/pypi/flask2postman
.. image:: https://img.shields.io/github/license/numberly/flask2postman.svg
:target: https://github.com/numberly/flask2postman/blob/master/LICENSE|
A tool that creates a Postman_ collection from a Flask_ application.
Install
=======.. code-block:: sh
$ pip install flask2postman
Example
=======Let's say that you have a Flask project called "example" (see
:code:`example.py`), and you want to generate a Postman collection out of it.You just need to tell :code:`flask2postman` how to import the Flask instance,
and optionally give a name to the Postman collection:.. code-block:: sh
$ 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:.. code-block:: sh
$ flask2postman example.create_app --name "Example Collection" --folders > example.json
This will generate the JSON configuration, and write it into the
:code:`example.json` file. You can then import this file into Postman ("Import
Collection" button), and profit:.. image:: https://raw.githubusercontent.com/1000mercis/flask2postman/42d20fe89d9d1f831bbfbe6275471e624d40c488/img/screenshot.jpg
:alt: Postman screenshotOn a side note, you can see that endpoint's docstrings are automatically
imported as descriptions.Usage
=====.. code-block:: sh
usage: flask2postman [-h] [-n NAME] [-b BASE_URL] [-a] [-i] [-f]
flask_instancepositional arguments:
flask_instanceoptional 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
-s, --static also generate /static/{{filename}} (Flask internal)
-i, --indent indent the output
-f, --folders add Postman folders for blueprintsLicense
=======MIT