v0.1.0 Now on PyPI Read the announcement →

Postman collections, generated from your Django, Flask & FastAPI code.

routeman reads the routes, serializers and models your Python API already has, then writes a complete Postman collection: request bodies, authentication, environments and a login request that saves the token. One command. No OpenAPI schema.

Get started →
$ pip install routeman
  • Free & MIT licensed
  • Python 3.9+
  • Zero dependencies
  • Runs locally, read-only
~/shop-apizsh
Terminal0.26s
$ pip install routeman
$ routeman generate
✓ django: 10 requests (4 POST, 3 GET, 1 PUT, 1 PATCH, 1 DELETE)
✓ auth: bearer (login: POST /api/v1/auth/token/)
✓ wrote postman/shop-api.postman_collection.json
✓ wrote postman/shop-api.local.postman_environment.json
  done in 0.26s - import the files in Postman (File → Import)

$ routeman routes | head -4
GET     /api/v1/                        🔒
POST    /api/v1/auth/token/               json: username, password
POST    /api/v1/auth/token/refresh/       json: refresh
GET     /api/v1/products/               🔒
shop-api.postman_collection.jsonv2.1
  • Auth
  • POSTToken obtain pair saves token
  • POSTToken refresh
  • Shop
  • GETList products ?page&search
  • POSTCreate product form-data
  • GETGet product
  • PUTUpdate product
  • PATCHPartially update product
  • DELDelete product
  • POSTPublish

01 How it works

From codebase to collection in under a minute.

No annotations, no spec to maintain, no documentation library. routeman runs in the virtualenv your project already uses and loads the app the way your server does.

01

Install

Add routeman to your project's virtualenv. It has no dependencies, apart from tomli on Python < 3.11.

$ pip install routeman
02

Generate

The framework, app, auth scheme and login route are detected automatically, and .env is loaded for you.

$ cd your-project
$ routeman generate
03

Import & send

In Postman, choose File → Import, drop both files, select the environment and send Login.

postman/
├─ shop-api.postman_collection.json
└─ shop-api.local.postman_environment.json

02 The output

A collection you can actually send requests with.

Most generated collections are a list of URLs. routeman fills in everything you would otherwise type by hand, so the first Send works.

Every route, organised

One folder per Django app, Flask blueprint or FastAPI tag, with sub-folders per resource. Admin and static routes are left out.

Bodies that pass validation

JSON, form-urlencoded or multipart with file pickers. Example values respect choices, ranges, lengths, patterns and field names, so an email field gets user@example.com.

Auth detected, login automated

Bearer/JWT, DRF Token, Knox, Basic, API key or session. The login request stores access_token and refresh_token for every other request.

Path & query parameters

{{product_id}}-style variables typed from your models, plus pagination, search, ordering and filters. Optional parameters are added but switched off.

Smoke tests built in

Every request asserts the response is not a 5xx, so the Collection Runner or Newman can check your whole API in CI.

Environments per server

One file each for local, staging and production, with tokens and passwords marked as secrets.

Docs inside every request

The view's docstring and a field table (type, required, allowed values) appear in each request's description.

Stable ids, clean re-imports

Regenerate whenever the API changes. Ids don't change, so re-importing replaces the collection instead of duplicating it.

Read-only and offline

routeman never touches your database, never sends requests and never uploads your code. It writes two JSON files.

03 Under the hood

It reads your code, not a schema.

routeman works from what your code already declares. When a view declares nothing, it reads the view's source, for example request.data.get('email'), and marks the request as inferred.

FrameworkRoutes fromBodies & parameters from
Django REST frameworkURLconf: routers, ViewSets, @action, APIViews, @api_viewSerializers (nested, many=True, relations, choices, files), pagination, SearchFilter, OrderingFilter, django-filter, permission and authentication classes
DjangoURLconf: path, re_path, include, CBVs and FBVsform_class, ModelForms, require_http_methods, request.POST/GET/FILES, json.loads(request.body)
Flaskapp.url_map: blueprints, MethodView, Flask-RESTfulrequest.json, get_json(), form, args, files, marshmallow, flask-smorest, Pydantic, @jwt_required, @login_required, Flask-HTTPAuth
FastAPIFastAPI's built-in OpenAPI plus include_in_schema=False routesPydantic models, Query, Form, File, Header, Depends() security (OAuth2, HTTP Bearer, API key)

04 Why routeman

Compared with the usual ways.

Hand-written requests drift from the code. An OpenAPI import needs a working schema setup first. routeman starts from the code you already have. Read the full comparison →

routemanOpenAPI → Postman importHand-written
Needs a schema library (drf-spectacular, flasgger…)NoYes, for Django/FlaskNo
Bodies from serializers / forms / view codeYesOnly what the schema declaresTyped by hand
Login request that stores the tokenYesNoWritten by hand
Environments per serverYesPartly (from servers)By hand
Smoke test on every requestYesNoBy hand
Stays in sync with codeRe-run one commandRe-export and re-importManual upkeep

05 Who it's for

Built for teams that ship Python APIs.

One generated collection serves everyone who touches the API, from the engineer who wrote the view to the pipeline that deploys it.

Backend engineers

Ship a complete, working collection with every pull request instead of a list of URLs in a chat message.

Frontend & mobile

Get example bodies, auth and environment switching without reading Django or Flask code.

QA & testers

Start exploratory and regression testing straight away, then build on the generated tests.

DevOps & CI

Generate in the pipeline and run with Newman as a 5xx smoke test after every deploy.

07 FAQ

Questions, answered.

Something else? Email routeman@swastik.ai or call +91 76545 31678.

All questions →

How do I generate a Postman collection from a Django, Flask or FastAPI project?

Install routeman in the virtualenv your project runs in and run one command from the project folder: pip install routeman then routeman generate. It writes postman/<name>.postman_collection.json and a local environment file. Import both in Postman with File → Import.

Do I need OpenAPI, Swagger, drf-spectacular or drf-yasg?

No. routeman reads your application's real routes and its serializers, forms and models directly. You don't need an OpenAPI schema or any documentation library. For FastAPI it uses the OpenAPI document that FastAPI already builds in memory, and it also picks up routes hidden with include_in_schema=False.

Is routeman free?

Yes. routeman is open source under the MIT licence and free for personal and commercial use. It is published on PyPI as routeman.

Does routeman send requests to my API or touch my database?

No. routeman imports your app to read its URL configuration, the same way manage.py or your WSGI/ASGI server does. It never runs queries, migrations or HTTP requests. The output is two JSON files on disk.

Which frameworks and versions are supported?

Django 3.2 to 6, Django REST framework 3.12+, Flask 2.0 to 3.x (including blueprints, MethodView, Flask-RESTful and flask-smorest) and FastAPI 0.95+ with Pydantic v1 or v2. routeman itself needs Python 3.9 or newer.

How does routeman handle authentication like JWT or DRF tokens?

It detects the scheme from your code: Bearer/JWT (SimpleJWT, flask-jwt-extended, OAuth2 in FastAPI), DRF Token and Knox, Basic, API key headers and session auth. It sets collection-level auth, marks public endpoints as No Auth and adds a test script to the login request that saves access_token and refresh_token into the environment automatically.

Stop writing Postman requests by hand.

Install routeman, run one command, import the result. Your whole API is ready to send requests within a minute.