Skip to main content

A python package which converts apidoc comments in various languages to OpenApi Spec .json files.

Project description

Apidoc to Openapi Converter   guide

Apidoc syntax is very easy and lightweight, whereas Openapi aka Swagger syntax is very verbose and not noob friendly. The goal of this project is to make documenting api endpoints so easy that developers won't mind spending the time to do it, instead of just ignoring documentation.

Apidoc conversion coverage

Convertable Annotations:

@api
@apiName
@apiGroup
@apiParam
@apiSuccess

Feel free to PR in any other annotations you need.

Installing

pip install apidoc-to-openapi
usage: apidoc_to_openapi [-h] -i path [-o path] [--yaml]

optional arguments:
  -h, --help  show this help message and exit
  -o path     File output (default: stdout)
  --yaml      Convert output to yaml format

Required:
  -i path     File or directory containing apidoc annotations

Example

apidoc-to-openapi -i ./my/path/ -o ./my/path/swagger.yaml --yaml

Running the tests

Used pytest for testing. Test coverage isn't near where I want it to be.

Coding Style

Using black formatter and pylint

Authors

  • Graham Thomas - Initial work

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • I have no friends

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

apidoc_to_openapi-0.0.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

apidoc_to_openapi-0.0.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file apidoc_to_openapi-0.0.2.tar.gz.

File metadata

  • Download URL: apidoc_to_openapi-0.0.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for apidoc_to_openapi-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1d0ea0fbe11e25147e87b77bcac866a1983f31bd69c42c014eb8a5ab10d52c14
MD5 a27891c38927290cee985a0c6c8a10ac
BLAKE2b-256 29e47b3f2bf1b62b746578fc91d6b53f2dfdc54a2e3c40db9eee16b7f62830a3

See more details on using hashes here.

File details

Details for the file apidoc_to_openapi-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: apidoc_to_openapi-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for apidoc_to_openapi-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a8d41504038caec0644a1c8f13db8fa4d33a03c4ace3c144482158beb5f80eb
MD5 3069ef8af499e77a7907560242b8eaec
BLAKE2b-256 4840521616ff2cf831d035ad8ea3317d9bd78d71e62784de1ab6612a1ec9a779

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