Skip to main content

Universal API documentation generator

Project description

Apimatic

Universal API docs generator that scans your codebase (Flask, FastAPI, Django, Express) and produces API_Docs.md or openapi.yaml. Optionally enriches with a local LLM via Ollama.

Install (Python)

pip install -e .
# or once published
# pip install Apimatic
CLI
Apimatic --src . --format markdown
# auto-detect frameworks from requirements.txt / pyproject.toml / package.json

Apimatic --src api --framework flask fastapi --format openapi --output openapi.yaml

Apimatic --src server --framework express --use-ollama --model llama3:instruct

Output

  • API_Docs.md — human-friendly Markdown
  • openapi.yaml — machine-readable OpenAPI 3.1

Ollama (optional) Install Ollama, pull a model and run with --use-ollama. ollama pull llama3:instruct

GitHub Action (optional) Use the provided workflow to regenerate docs on push and commit.

.github/workflows/api-docs.yml

npm wrapper (optional) Publish npm-wrapper/ as a small CLI that invokes the Python module, so Node users can:

npm i -g Apimatic
Apimatic --src . --framework express

Roadmap

  • Parsers: NestJS, Koa, Hapi, DRF viewsets, Spring Boot
  • Deeper AST parsing for params/body schemas
  • Test suite + fixtures for each framework
  • OpenAPI components & schema inference

🤖 .github/workflows/api-docs.yml

name: Generate API Docs

on:
  push:
    branches: [ "main" ]

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install Apimatic
        run: |
          pip install .
      
      - name: Generate Markdown
        run: |
          Apimatic --src . --format markdown --output API_Docs.md || true

      - name: Generate OpenAPI
        run: |
          python -c "import yaml" 2>/dev/null || pip install pyyaml
          Apimatic --src . --format openapi --output openapi.yaml || true

      - name: Commit changes
        run: |
          git config user.name "github-actions"
          git config user.email "actions@github.com"
          git add API_Docs.md openapi.yaml || true
          git diff --cached --quiet && echo "No changes" || git commit -m "chore(docs): update API docs [auto]"
          git push || true
________________________________________
📦 npm-wrapper/package.json
{
  "name": "Apimatic",
  "version": "0.1.0",
  "description": "Node CLI wrapper for Apimatic (Python)",
  "bin": {
    "Apimatic": "index.js"
  },
  "author": "Matrixxboy",
  "license": "MIT"
}

▶️ npm-wrapper/index.js

//!/usr/bin/env node
const { spawn } = require("child_process");

const args = process.argv.slice(2);
const proc = spawn(process.env.PYTHON || "python3", ["-m", "Apimatic", ...args], {
  stdio: "inherit",
});
proc.on("close", code => process.exit(code));

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

apimatic-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

apimatic-0.1.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file apimatic-0.1.1.tar.gz.

File metadata

  • Download URL: apimatic-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for apimatic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2cc4972db8b2407bb3b3294f5ebd94d21040156ef1c1b70629aba867a7f117a
MD5 4dc90a49016dc6d442ce39a6de26f69e
BLAKE2b-256 3d4de34161f4cb941d5187aba1c91e3b09586ed3df8c5134b1273013d06ae51b

See more details on using hashes here.

File details

Details for the file apimatic-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: apimatic-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for apimatic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 afb97b64f571ae29c198f12b3be8e022266393ca62601297ff750ea9b77e1d4b
MD5 d5e620c5f95edcd3885ced0d3560f4c9
BLAKE2b-256 fa60e43419fbb6aceeb98d775ea3207db5a9e0ba409d4f5e699660665c2f8fef

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