Skip to main content

DocAPI is a Python package that automatically generates API documentation using LLM.

Project description

image

GitHub Code License GitHub last commit PyPI GitHub pull request

docapi是一个用大模型自动生成API文档的python包,会自动扫描API的路由结构,生成或更新API文档。

安装

pip install docapi

或

pip install docapi -i https://pypi.org/simple

使用方法

注意

使用docapi时必须在api项目的环境中。*

方法一

export OPENAI_API_KEY=your_key

docapi generate server.py

docapi update server.py

方法二

docapi init

编辑config.yaml文件

openai_api_key: xxx

openai_base_url: 'http://ip:port:v1'

openai_model: 'qwen-plus'
docapi generate server.py ./docs --lang zh --config config.yaml

docapi update server.py./docs --lang zh --config config.yaml

支持模型

  • OpenAI

  • AzureOpenAI

  • 通义千问

支持API框架

  • Flask

TODO

  • 支持文心一言、智普AI等大模型

  • 支持fastapi、django等框架

  • 支持文档在线web页面展示

  • 支持自定义文档模版

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

docapi-0.0.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

docapi-0.0.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file docapi-0.0.1.tar.gz.

File metadata

  • Download URL: docapi-0.0.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for docapi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eb8ced0109a059359a55d006235013152299ac21fd7d3fcf22161cb0c0c58852
MD5 154811dfa0288e05dfa674f1151d9fa3
BLAKE2b-256 e2723fc8c63e4c5b417a69454eef7821c04f83f0aede0c0f3bb460fcdadbb9bc

See more details on using hashes here.

File details

Details for the file docapi-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: docapi-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for docapi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a5764e4494250c7ac52e09f696551c7e744e5c1568d72c417fd556e5363dbc1
MD5 bbd54f90df8cfdb16d051c228c0fba79
BLAKE2b-256 70b348d3f4b8c889e48af9f630f713fb89b932884a5140091fbf97825e3f1dbd

See more details on using hashes here.

Supported by

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