Skip to main content

No project description provided

Project description

Data Documenter

A package to generate documentation from pandera schema using mkdocs material.

Installation

pip install data-documenter

Quick start

  1. Create schema using pandera
from pandera import DataFrameSchema, Column

schema = DataFrameSchema(
    title="Title of dataset",
    description="Description of dataset",
    columns={
        "COLUMN_NAME": Column(
            dtype="str",
            nullable=False,
            unique=True,
            description="Description of column",
            title="Column Name"
        ),
    },
)
  1. Create documentation using schema
from data_documenter.pandera_plugin import create_documentation

docs = create_documentation(
    schema, 
    docs_path = 'docs_folder', 
    title = 'page title',
    filename = 'index.md'
)
  1. Run server
docs.run()
  1. Stop server
docs.stop()

It is better to use mkdocs command instead of run, stop for better control of processes. See alternative usage.

cd path/to/folder
mkdocs serve
  1. Build and deploy documentation
    See mkdocs documentation.

Alternative usage

  1. Create pandera schema
from pandera import DataFrameSchema, Column

schema = DataFrameSchema(
    title="Title of dataset",
    description="Description of dataset",
    columns={
        "COLUMN_NAME": Column(
            dtype="str",
            nullable=False,
            unique=True,
            description="Description of column",
            title="Column Name"
        ),
    },
)
  1. Create new folder for documentation server.
from data_documenter.metadocs import MetaDocs

docs = MetaDocs(docs_path = 'my_docs')
docs.new()

This will simply run mkdocs new my_docs and replace mkdocs.yml file.

  1. Save documentation for schema in a markdown file.
from data_documenter.pandera_plugin import pandera_to_markdown
text_markdown = pandera_to_markdown(schema, title = 'Homepage')
docs.save_markdown(text_markdown, filename = 'index.md')
  1. See generated documentation.
cd my_docs
mkdocs serve
  1. Build and deploy
    See mkdocs documentation.

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

data_documenter-0.3.4.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

data_documenter-0.3.4-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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