Skip to main content

Universal API documentation generator

Project description

Apimatic 🚀

Matrixxboy PyPI version Downloads Python Version License

A tool to automatically generate beautiful and comprehensive API documentation (Markdown/OpenAPI) from your source code.
Supports Flask, FastAPI, and more frameworks with optional AI-powered enhancements via Ollama.


📦 Installation

pip install apimatic

Upgrade to the latest version:

pip install --upgrade apimatic

⚡ Usage

Apimatic [-h] [--src SRC] [--framework [FRAMEWORK ...]] [--format {markdown,openapi}] 
         [--output OUTPUT] [--use-ollama] [--model MODEL]

🔑 Options

Option Description
-h, --help Show help message and exit
--src SRC Root directory of the project to scan (Default: current directory)
--framework [FRAMEWORK ...] Force a specific framework (flask, fastapi, etc.). If omitted, auto-detected
--format {markdown,openapi} Output format (markdown or openapi) – Default: markdown
--output OUTPUT Path for the generated output file (Default: API_Docs.md or openapi.yaml)
--use-ollama Enhance generated docs with descriptions from a local Ollama model
--model MODEL Ollama model for enhancement (e.g., llama3:instruct). Requires --use-ollama

📝 Examples

Generate Markdown docs from the current project:

Apimatic --src . --format markdown --output API_Docs.md

Generate OpenAPI spec:

Apimatic --src . --format openapi --output openapi.yaml

Force framework detection (Flask):

Apimatic --src ./my_flask_app --framework flask

Enhance documentation with AI (Ollama model):

Apimatic --src . --use-ollama --model llama3.2:1b

🤖 Recommended Ollama Models (1–2 GB)

When using --use-ollama, you can choose a local model for API explanations. Here are lightweight models that run well (1–2 GB range):

Model Size Why Use It
llama3.2:1b ~1.3GB Fast, nimble, and great for generating clear API explanations (recommended)
gemma2:2b ~1.6GB Slightly larger, richer outputs, good balance of quality and size
dolphin-phi ~1.6GB Alternative small model with solid reasoning ability
orca-mini ~1.9GB Bigger (3B params) but still under 2GB; more context-aware
moondream2 ~0.8GB Ultra-light, very fast, but less detailed

👉 Recommended Default: llama3.2:1b – best speed + clarity tradeoff.

Example:

Apimatic --src . --use-ollama --model llama3.2:1b

🤝 Contributing

Contributions are welcome! Please fork the repo, make your changes, and submit a PR.


📄 License

This project is licensed under the MIT License.

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.4.tar.gz (11.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.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apimatic-0.1.4.tar.gz
  • Upload date:
  • Size: 11.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.4.tar.gz
Algorithm Hash digest
SHA256 b45c31be14eccf0c2b20d66f79b5db12546008766703e4163f339eeb2c1d7fa1
MD5 52ad73305cf2c4d821206e96db05e2c5
BLAKE2b-256 44b36a55e629cab1b500214025fe03acc24c1a6e9ad85eaaac65b2b01e68d5ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apimatic-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9a05141307026ccc9bd60991f68746944317f0b64181870c05a24a6571ee45
MD5 c4c36787944472280f5fab0aa1b65489
BLAKE2b-256 298b12a22966033fbc3b7ae436c216a07206278caa4e875fcf3bfde0c5a6ca95

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