Postman collections, generated from your code.
routeman reads the routes, serializers and models already in your Django, Django REST framework, Flask or FastAPI project and writes a ready-to-import Postman collection — with auth, example bodies and environments. No OpenAPI schema required.
pip install routeman
$ pip install routeman
$ routeman generate
# detects framework, app, auth scheme and login route
# writes:
✓ postman/shop-api.postman_collection.json
✓ postman/shop-api.local.postman_environment.json
# Postman → File → Import → both files
# pick the environment, send "Login", you're in.
Three steps, about a minute
routeman works from the code you already have. There is no decorator to add, no schema library to install and nothing to keep in sync by hand.
Add it to your virtualenv
Run pip install routeman in the environment your project already uses. It imports your app to read the routes, so it needs your dependencies.
Run one command
From the project folder, run routeman generate. It detects the framework, the app, the auth scheme and the login route, and loads .env if present.
Open it in Postman
File → Import both files from postman/, select the environment and send the Login request. The token is saved and sent with everything else.
A collection you can use straight away
Not a list of bare URLs. Every request arrives with the body, parameters and auth it needs to work.
Organised folders
One folder per Django app, Flask blueprint or FastAPI tag, with sub-folders per resource. Admin and static routes are left out.
Real request bodies
JSON, urlencoded or multipart with file pickers. Example values respect choices, length and range limits, regex patterns and field names.
Auth that works
Detects Bearer/JWT, DRF Token, Knox, Basic, API key and session auth. The login request saves access and refresh tokens to the environment.
Typed parameters
Path variables are typed from your models. Pagination, search, ordering and filters are added, with optional ones disabled by default.
Built-in smoke tests
Every request checks that the response is not a 5xx, so Collection Runner or Newman can exercise the whole API in CI.
One file per server
Separate environments for local, staging and production, with secrets marked so they are not shared by accident.
Docs in every request
View docstrings and field tables — type, required, allowed values — appear in each request's description. WebSocket routes are listed too.
Stable IDs
Regenerate after an API change and re-import: the previous collection is replaced, not duplicated next to the old one.
Reads each framework the way it is written
If a view declares no serializer, form or schema, routeman infers fields from the view's source and marks those requests as inferred.
Django REST framework
3.12+Routers, ViewSets, @action, APIViews and @api_view. Bodies come from serializers; parameters from pagination, search, ordering and django-filter.
Django
3.2 – 6path, re_path and include. Fields come from forms, ModelForms and view code reading request.POST, GET, FILES or JSON.
Flask
2.0 – 3.xThe URL map, blueprints, MethodView and Flask-RESTful. Parameters from marshmallow, flask-smorest, Pydantic models and auth decorators.
FastAPI
0.95+The built-in OpenAPI document, plus routes marked include_in_schema=False. Pydantic v1 and v2, Query/Form/File/Header and Depends-based security.
Four commands, sensible defaults
routeman generate # collection + environments → postman/
routeman generate --stdout # print the collection instead
routeman routes # method, path, auth, body fields
routeman init # save settings to routeman.toml
routeman --version
routeman.toml or under [tool.routeman] in pyproject.toml. Command-line flags override both.csrftoken into the X-CSRFToken header.tomli on Python below 3.11. Tested on Python 3.9 through 3.14.| Flag | Purpose |
|---|---|
-C, --project DIR | Project folder (default: current folder) |
-f, --framework | django, flask or fastapi |
-a, --app | Django settings module, or Flask/FastAPI app such as main:app |
-n, --name | Collection name |
-o, --output DIR | Output folder (default postman) |
-b, --base-url URL | Base URL of the local environment |
-e, --env NAME=URL | Add an environment (repeatable) |
-x, --exclude REGEX | Exclude matching paths (repeatable) |
--auth TYPE | Force none, bearer, token, basic, apikey or session |
--login PATH | The POST route whose response contains the token |
--env-file FILE | Environment variables for settings (default .env) |
Everyone who touches the API
Backend engineers
Ship an up-to-date collection with every pull request instead of maintaining one by hand.
Frontend & mobile
Get example bodies and working auth without reading the server code or waiting on a backend developer.
QA testers
Start exploratory or regression testing on day one, with every endpoint already in place.
DevOps
Run the collection through Newman after each deploy as a quick check for 5xx errors.
Read-only and offline
routeman imports your app to read its routes, then writes two JSON files. That is all it does.
Questions or a framework we missed?
routeman is built and maintained by the Swastik engineering team. Tell us what your project uses and we will help you get a working collection.
Visit the routeman site