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, OpenAI, Google Gemini, and Groq.


📦 Installation

pip install Apimatic

Upgrade to the latest version:

pip install --upgrade Apimatic

⚡ Usage

Apimatic now uses commands to separate actions.

1. Generate Documentation:

apimatic generate [OPTIONS]

2. Configure API Keys:

apimatic config [OPTIONS]

🔑 Configuration

To use AI enhancements from providers like OpenAI, Google Gemini, or Groq, you must set an API key.

# Set your OpenAI API key
apimatic config --set-openai-key YOUR_API_KEY

# Set your Google Gemini API key
apimatic config --set-gemini-key YOUR_API_KEY

# Set your Groq API key
apimatic config --set-groq-key YOUR_API_KEY

The key will be stored securely in your home directory.


⚙️ Generation 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} Output format (Default: markdown)
--output OUTPUT Path for the generated output file (Default: API_Docs.md)
--use-ollama Enhance with a local Ollama model
--ollama-model MODEL Ollama model to use (e.g., phi3:mini)
--use-openai Enhance with an OpenAI model
--openai-model MODEL OpenAI model to use (e.g., gpt-4o-mini)
--use-google-gemini Enhance with a Google Gemini model
--google-gemini-model MODEL Gemini model to use (e.g., gemini-1.5-flash)
--use-groq Enhance with a Groq model
--groq-model MODEL Groq model to use (e.g., llama3-8b-8192)

📝 Examples

Basic Generation:

# Generate Markdown docs from the current project
apimatic generate --src . --output API_Docs.md

Force Framework:

# Force detection for a Flask app
apimatic generate --src ./my_flask_app --framework flask

AI-Enhanced Documentation:

First, set your key:

apimatic config --set-openai-key sk-xxxxxxxx

Then, generate with enhancement:

# Use OpenAI's gpt-4o-mini model
apimatic generate --src . --use-openai --openai-model gpt-4o-mini

# Use Google Gemini
apimatic generate --src . --use-google-gemini

# Use Groq's fast Mixtral model
apimatic generate --src . --use-groq

# Use a local Ollama model
apimatic generate --src . --use-ollama --ollama-model phi3:mini

🤖 Recommended AI Models

Provider Recommended Model Notes
Ollama (Local) phi3:mini, llama3:8b Fast, free, and runs on your machine. Great for privacy.
OpenAI gpt-4o-mini Excellent balance of cost, speed, and intelligence.
Google Gemini gemini-1.5-flash Fast and cost-effective model from Google.
Groq llama3-8b-8192 Incredibly fast inference speeds.

🤝 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.6.tar.gz (14.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.6-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for apimatic-0.1.6.tar.gz
Algorithm Hash digest
SHA256 07cb7a46b5553fc863a06651034727af00018403e48bf12b7dfad61083fe2897
MD5 9c0a17435d77b657b91e26304af37838
BLAKE2b-256 b726487dffe9e5cff838e8ccd0d4db8ea660efec5ee250b7c67be20c91ba13ab

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for apimatic-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3c61516be938b88f07998a7e043a4ecb6fcd16ea63ca946fd79b8f45c37ae89f
MD5 8b072036e60ebeab5220e840d3a904d7
BLAKE2b-256 b38dce6f54da41572412ec6d7a74f6316050119df049ac7bc50358d591a54ab2

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