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.3.tar.gz (11.7 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.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apimatic-0.1.3.tar.gz
  • Upload date:
  • Size: 11.7 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.3.tar.gz
Algorithm Hash digest
SHA256 9dfbc32fcebe2ef01d381faa83092bfe4de447afe50300b5599da3d8e8d51b75
MD5 52d21e863319cf49eea30266b7254e52
BLAKE2b-256 7a3a28af2fce3e7b7839f508e3dfebe52ebe84c7c0ef9ca70d10da9ee35ea444

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apimatic-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 741b260b551861b39ad62157a0baa3c97ce90d0032fdde7aba143c5f5e129ad6
MD5 1dab6e4bd88888a435123b46a6ae1ef5
BLAKE2b-256 a7450ed360c01fd93b52a211b925f16d9ba3903d0c7ebde92aa0dfa169260040

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