Skip to main content

sphinx-autoschematics provides sphinx extenions for documenting schematics models

Project description

sphinx-autoschematics

Build Status CodeCov PyPI - Version PyPI - Python Version

This is a Sphinx extension to automatically document Schematics models.

How to use it

In your Sphinx configuration you will need to list autoschematics as an extension:

extensions = ["autoschematics", "sphinx.ext.autodoc"]

This will provide a new automodel directive that you can provide the full path of a model to:

.. automodel:: myproject.models.MyModel

The extension will inspect your model and generate documentation from the docstring and the different fields on the model.

Example

Given the following model:

from schematics import types
from schematics.models import Model
from schematics.types import compound


class MyModel(Model):
    """MyModel defines the structure of data when interacting with SomeService

    Just like in Sphinx .rst files you can use restructured text directives in the
    docstring to provide rich content in the generated docs.

    .. code-block:: yaml

        foo: Foo
        bar:
          - bar1
          - bar2
    """

    foo = types.StringType(
        required=True,
        metadata=dict(
            custom_value=True
        )
    )

    bar = compound.ListType(types.StringType, default=list)

Would produce documentation like:

models.MyModel

MyModel defines the structure of data when interacting with SomeService

Just like in Sphinx .rst files you can use restructured text directives in the docstring to provide rich content in the generated docs.

foo: Foo
bar:
  - bar1
  - bar2
foo StringType()
Required: True
Default: Undefined
Custom value: True
bar ListType(StringType())
Required: False
Default: Undefined

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

sphinx-autoschematics-0.1.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

sphinx_autoschematics-0.1.2-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sphinx-autoschematics-0.1.2.tar.gz.

File metadata

  • Download URL: sphinx-autoschematics-0.1.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for sphinx-autoschematics-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b90740277a13007faa95e9c79596e7e4c3f24b686fc39a40a9c74751d0f76223
MD5 b657526088ebdc366d5ee3c52f4348b0
BLAKE2b-256 9b36afec497671ee1a13eeae3e4ebdf601ee5b38792ec96d1a1d09eddcc11f0a

See more details on using hashes here.

File details

Details for the file sphinx_autoschematics-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: sphinx_autoschematics-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for sphinx_autoschematics-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 62ac4c69bd002c08de1a51814a44834afa9b9b62dba2214405798af619a044b6
MD5 91edb5765a2e8358b64e392be4ab3914
BLAKE2b-256 940f9a2db8b87f9625bf6a509e13982ed31554733eec083b8bde02863579c9fe

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