Postman collections, generated from your API code.
routeman reads the routes, schemas and models your API already has, in Python or in JavaScript and TypeScript, then writes a complete Postman collection: request bodies, authentication, environments and a login request that saves the token. One command. No OpenAPI schema.
$ 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/ 🔒
- 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
$ npx routeman-cli
✓ express: 12 requests (5 POST, 4 GET, 1 PUT, 1 DELETE, 1 PATCH)
✓ auth: bearer (login: POST /api/v1/auth/login)
✓ wrote postman/shop-api.postman_collection.json
✓ wrote postman/shop-api.local.postman_environment.json
done in 0.08s - import the files in Postman (File → Import)
$ npx routeman-cli routes | head -4
POST /api/v1/auth/login json: email, password
POST /api/v1/auth/register json: email, password, name
GET /api/v1/orders 🔒
POST /api/v1/orders 🔒 json: productId, quantity, couponCode
- Auth
- POSTLogin saves token
- POSTRegister
- Products
- GETList products ?page&search
- POSTCreate product zod body
- GETGet product
- PUTUpdate product
- DELDelete product
- POSTCreate image form-data
01 How it works
From codebase to collection in under a minute.
No annotations, no spec to maintain, no documentation library. The Python edition loads your app the way your server does. The Node.js edition reads your source files and never runs them.
Install
Python: add routeman to your project's virtualenv. Node.js, Bun or Deno: run it with npx, nothing to install. Neither has dependencies.
$ pip install routeman # Python
$ npx routeman-cli # Node.js
Generate
The framework, entry point, auth scheme and login route are detected automatically, and .env is read for you.
$ cd your-project
$ routeman generate
Import & send
In Postman, choose File → Import, drop both files, select the environment and send Login. They open in Swastik Codes too.
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
Every route across all files, routers and mounts, with prefixes and versions applied. One folder per app, blueprint, tag or resource. Admin, static and catch-all 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, Passport, NestJS guards, Basic, API key or session. The login request stores access_token and refresh_token for every other request.
Path & query parameters
{{product_id}} or {{productId}} variables, typed from your models, pipes and schemas, plus pagination, search 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 or JSDoc comment 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. The Node.js edition doesn't even run it. 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 handler declares nothing, it reads the handler's source, for example request.data.get('email') or const { email } = req.body, and still builds the body.
Python
pip install routeman · imports your app read-only| Framework | Routes from | Bodies & parameters from |
|---|---|---|
| Django REST framework | URLconf: routers, ViewSets, @action, APIViews, @api_view | Serializers (nested, many=True, relations, choices, files), pagination, SearchFilter, OrderingFilter, django-filter, permission and authentication classes |
| Django | URLconf: path, re_path, include, CBVs and FBVs | form_class, ModelForms, require_http_methods, request.POST/GET/FILES, json.loads(request.body) |
| Flask | app.url_map: blueprints, MethodView, Flask-RESTful | request.json, get_json(), form, args, files, marshmallow, flask-smorest, Pydantic, @jwt_required, @login_required, Flask-HTTPAuth |
| FastAPI | FastAPI's built-in OpenAPI plus include_in_schema=False routes | Pydantic models, Query, Form, File, Header, Depends() security (OAuth2, HTTP Bearer, API key) |
JavaScript & TypeScript
npx routeman-cli · static analysis, never runs your code| Framework | Routes from | Bodies & parameters from |
|---|---|---|
| Express 4 / 5 | Router(), app.use(prefix, router), router.route(), sub-apps, router factories, routes registered in loops | zod, Joi / celebrate, yup, express-validator, TypeScript types, req.body / req.query usage, multer uploads |
| NestJS | Controllers, global prefix, URI versioning, RouterModule | class-validator DTOs, @ApiProperty, PartialType/PickType/OmitType, pipes, FileInterceptor, guards incl. APP_GUARD + @Public() |
| Fastify 4 / 5 | register(plugin, {prefix}), @fastify/autoload, fastify-plugin, route({...}) | JSON Schema and TypeBox, addHook / decorate auth, schema.summary |
| Next.js, Nuxt, SvelteKit, Astro, Remix | File routing: App Router route.ts, pages/api, server/api, +server.ts, resource routes | request.json(), formData(), searchParams, readBody, getQuery, zod and valibot schemas |
| Hono, Koa, Elysia, Hapi, AdonisJS + more | Sub-apps, basePath(), @koa/router, group, plugins with prefixes, resource().apiOnly() | @hono/zod-validator, Elysia t.*, Joi validate, VineJS, Mongoose / Prisma / Sequelize / TypeORM models |
Also Restify, Polka, tinyhttp, hyper-express, ultimate-express, itty-router, h3, Feathers, Oak, routing-controllers, tsoa, inversify-express-utils, LoopBack 4, Bun.serve, Deno.serve and plain node:http. See every framework →
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 →
| routeman | OpenAPI → Postman import | Hand-written | |
|---|---|---|---|
| Needs a schema library (drf-spectacular, flasgger, swagger-jsdoc, @nestjs/swagger…) | No | Yes, for most frameworks | No |
| Bodies from serializers, DTOs, zod / Joi schemas or handler code | Yes | Only what the schema declares | Typed by hand |
| Login request that stores the token | Yes | No | Written by hand |
| Environments per server | Yes | Partly (from servers) | By hand |
| Smoke test on every request | Yes | No | By hand |
| Stays in sync with code | Re-run one command | Re-export and re-import | Manual upkeep |
05 Who it's for
Built for teams that ship Python and Node.js 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 the back-end 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.
06 Journal
Guides from the blog.
Practical walkthroughs for DRF, Django, FastAPI, Flask, Express and NestJS, plus Postman auth and Newman in CI. All articles →
routeman for Node.js: Postman collections from Express, NestJS, Fastify and Next.js
routeman is now on npm as routeman-cli. Run npx routeman-cli in an Express, NestJS, Fastify, Next.js, Hono or Koa project and get a complete Postman collection, without running your code.
Express API to Postman collection without Swagger
Export every route of an Express app to a Postman collection, with zod bodies, multer uploads and JWT login, without swagger-jsdoc or a running server. Real output included.
NestJS to Postman without @nestjs/swagger
Generate a Postman collection from a NestJS app's controllers and class-validator DTOs, with global prefix, URI versioning and APP_GUARD auth handled. No Swagger decorators, no running app. Real output included.
How to generate a Postman collection from Django REST framework
Step-by-step: turn a Django REST framework API into a ready-to-use Postman collection with bodies, JWT login and environments, without drf-spectacular or drf-yasg.
How do I generate a Postman collection from my API code?
Python (Django, DRF, Flask, FastAPI): install routeman in the virtualenv your project runs in, then run pip install routeman and routeman generate from the project folder. Node.js, Bun or Deno (Express, NestJS, Fastify, Next.js and more): run npx routeman-cli in the project folder. Both write 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 @nestjs/swagger?
No. routeman reads your application's real routes and its serializers, DTOs, schemas and models directly. You don't need an OpenAPI schema or any documentation library: no drf-spectacular, drf-yasg, flasgger, swagger-jsdoc or @nestjs/swagger. 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. If you do have a spec, routeman-cli --openapi can build from it.
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 and on npm as routeman-cli.
Does routeman send requests to my API or touch my database?
No. The Python edition imports your app to read its URL configuration, the same way manage.py or your WSGI/ASGI server does. The Node.js edition doesn't run your code at all: it parses the source files. Neither runs queries or migrations or sends HTTP requests. The output is JSON files on disk.
Which frameworks and versions are supported?
Python (routeman, Python 3.9+): 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. Node.js (routeman-cli, Node.js 18.3+, Bun or Deno): Express 4/5, Fastify 4/5, NestJS, Koa, Hono, Elysia, Hapi, AdonisJS 6, Next.js, Nuxt/Nitro, SvelteKit, Astro, Remix, routing-controllers, tsoa, LoopBack 4 and more. See all frameworks.
Does routeman work with Express, NestJS, Fastify or Next.js?
Yes, through routeman-cli on npm. Run npx routeman-cli in the project folder (or pnpm dlx, yarn dlx, bunx, deno run -A npm:routeman-cli). It follows routers, mounts, plugins, controllers and file-based routes, and reads zod, Joi, yup, TypeBox, class-validator and other schemas. See the Express, NestJS, Fastify and Next.js guides.
How does routeman handle authentication like JWT or DRF tokens?
It detects the scheme from your code: Bearer/JWT (SimpleJWT, flask-jwt-extended, FastAPI OAuth2, jwt.verify, Passport, @fastify/jwt, NestJS guards), 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.
Run one command, import the result. Your whole API is ready to send requests within a minute, whether it's written in Python or TypeScript.