Skip to main content

Flask ApiDoc Extend

Flask ApiDoc Extend is a Flask extension which adds support for the ApiDoc.

Features

  • Host apidoc's files, by default they are hosted in http://localhost:5000/apidoc
  • Export apidoc's files to Markdown. apidoc.md will be generated into output folder.Bydefault it's under /static/docs.

Installation

You need to install apidoc first.

$ npm install apidoc -g

Then you can install flask-apidoc via Python Package Index (PyPI)

$ pip install flask-apidoc-extend

Usage

  • Creates a apidoc.json file under your project.

yourproject/apidoc.json

like this:

{
  "name": "Flask REST API Doc",
  "version": "1.0.0",
  "description": "A Flask REST API Doc example",
  "title": "A Flask REST API Doc example",
  "url" : "http://localhost:5000"

}
  • Initalizes Apidoc and pass your flask app to it.

ApiDoc param.

:param Input_path:   source dirname. Location of your project files.
:param output_path:  Output dirname. Location where to put to generated documentation.default is 'static/docs'
:param template_path:Use template for output files. You can create and use your own template.
:param app:          your flask instence         
:param mount:        register blueprint of the apidoc files to your flask application.then you can access 
:param url_path:     The url path for the apidoc files.default is 'apidoc'
:param private       Include private APIs in output.

example:

from flask_apidoc_extend import ApiDoc

app = Flask(__name__)
ApiDoc(app=app)
  • Add some apidoc comments anywhere in your source code:
"""
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User

@apiParam {Number} id User's unique ID.

@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname  Lastname of the User.
"""
  • generate apidoc files

$ cd yourproject/

$ flask apidoc

$ flask run

Now you can access your apidoc files by http://127.0.0.1:5000/apipdoc

  • Export to Markdown (version>=0.1.6)

This command will export apidoc files to markdown(apidoc.md).

$flask apidoc --export

Bydefault,you can find markdown file under /static/docs.

note : your apidoc.json file must be set under yourproject/ and you should run command at the same path.

Feedback

apidocer@163.com

Metadata

Release files for Flask-Apidoc-Extend 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Apidoc-Extend 0.1.8
File Size Uploaded
Flask-Apidoc-Extend-0.1.8.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Apidoc-Extend 0.1.8
File Interpreter ABI Platform
Flask_Apidoc_Extend-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / Flask-Apidoc-Extend-0.1.8.tar.gz

Download URL Flask-Apidoc-Extend-0.1.8.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
214a463d666a8cfabf033b2263ae51f380172a7d9ade9aec0de15d1d22832410
BLAKE2b-256 checksum
How to use checksums
f74e6ab4c89136508519afc529281aeea5a208c0ce842c8e3c72a8f0ab5541c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.1

Release files / Flask_Apidoc_Extend-0.1.8-py3-none-any.whl

Download URL Flask_Apidoc_Extend-0.1.8-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a99b62db2f8c3d287558b2339631b5970e743febe6171413294a01bd71abf3b
BLAKE2b-256 checksum
How to use checksums
8ea606a2083cc56c5841ffede4bdd580af984e0a4e6bec577a823a2ddcb7ea66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.1

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

1 release file

0.1.6

1 release file

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page