Skip to main content

Convert API flows (curl commands or DSL) into Mermaid diagrams in Markdown

Project description

flowmd

Convert API flows into Mermaid diagrams in Markdown. Zero config.

Paste real curl commands or write a simple DSL — get a .md file you can drop into GitHub, Notion, Confluence, or any Markdown-based doc tool.

Install

pip install flowmd

Usage

From a DSL file

Create a .flow file:

user -> auth-service: POST /login
  body: { email, password }
  response: 200 { token }

user -> api-gateway: GET /profile
  headers: Authorization: Bearer {token}
  response: 200 { name, email }

api-gateway -> user-service: GET /users/{id}
  response: 200 { name, email }

Run:

flowmd api.flow

Output (flow.md):

sequenceDiagram
    participant user
    participant auth-service
    participant api-gateway
    participant user-service
    user->>auth-service: POST /login { email, password }
    auth-service-->>user: 200 { token }
    user->>api-gateway: GET /profile
    api-gateway-->>user: 200 { name, email }
    api-gateway->>user-service: GET /users/{id}
    user-service-->>api-gateway: 200 { name, email }

From curl commands

cat requests.txt | flowmd
# or
flowmd requests.txt

Flow graph format

flowmd api.flow --format graph

Output:

graph LR
    user -->|POST /login| auth-service
    user -->|GET /profile| api-gateway
    api-gateway -->|GET /users/id| user-service

Options

Flag Description
-o, --output Output file path (default: flow.md)
--format sequence (default) or graph

DSL Reference

<from> -> <to>: <METHOD> <path>
  body: <anything>           # optional
  headers: <anything>        # optional
  response: <status> <body>  # optional

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowmd-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flowmd-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file flowmd-0.1.0.tar.gz.

File metadata

  • Download URL: flowmd-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for flowmd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5ce491a07cd66341f98d3f074f999e6d27f286138b29a01e50a079923a40921
MD5 3b7317fecc442e8a5d44194c1f8a331a
BLAKE2b-256 047ca2ba317dfef4746e08d27b215922100fee49c725b51f5c92fd54de3d9401

See more details on using hashes here.

File details

Details for the file flowmd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flowmd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for flowmd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f76874b470a0dd3b775cd31b8ae0970edfa4df0531fa5039728a047a6e2e9b0
MD5 930f27d23d838f1d9a0893591478d8d3
BLAKE2b-256 8e93c0cbc2b4a38a0f2fe283723e8e7c3749bff9ead1c627df7717aebf259eb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page