The problem
Every API team ends up maintaining a Postman collection by hand, and every hand-made collection drifts. A field gets renamed, an endpoint gets a new filter, auth moves from sessions to JWT — and the collection the frontend, mobile and QA teams depend on quietly stops matching the server.
The usual fix is to generate an OpenAPI schema first and convert it. That means adding a schema library, decorating views and keeping annotations accurate — which is the same maintenance problem moved somewhere else. Plenty of working Django and Flask projects simply do not have a schema.
Approach
routeman reads the project the way the framework itself does. It imports the app from inside its own virtualenv and walks the real URL configuration — Django URLconfs and DRF routers, Flask's URL map and blueprints, FastAPI's built-in OpenAPI document — then reads serializers, forms, marshmallow schemas and Pydantic models for the request shape.
Where a view declares nothing, it reads the view's source for request.POST, request.GET, request.FILES or JSON access and infers the fields, marking those requests as inferred so nobody mistakes a guess for a contract.
It is deliberately read-only and offline: it never touches the database, never sends a request and never uploads code. It has no dependencies beyond tomli on Python older than 3.11.
What it generates
- Folders per Django app, Flask blueprint or FastAPI tag, with sub-folders per resource — admin and static routes excluded
- Request bodies as JSON, urlencoded or multipart with file pickers; example values respect choices, length and range limits, regex patterns and field names
- Auth detection for Bearer/JWT, DRF Token, Knox, Basic, API key and session, with a login script that saves access and refresh tokens
- Typed path variables plus pagination, search, ordering and filter parameters, optional ones disabled by default
- A not-5xx smoke test on every request, so Collection Runner or Newman can check the whole API in CI
- One environment file per server — local, staging, production — with secrets marked
- View docstrings and field tables in each request's description
- Stable IDs, so re-importing after a change replaces the collection instead of duplicating it
Shipping it
routeman is published on PyPI under the MIT licence and tested against Django 3.2 to 6, Django REST framework 3.12+, Flask 2.0 to 3.x and FastAPI 0.95+ with Pydantic v1 and v2, on Python 3.9 through 3.14.
Four commands cover the workflow: routeman generate writes the collection and environments, routeman routes lists what was discovered, routeman init saves settings to routeman.toml, and --stdout prints the collection for piping. Settings can also live under [tool.routeman] in pyproject.toml.