Module pandas_profiling.report.presentation.flavours.html.sequence

Expand source code
from pandas_profiling.config import config

from pandas_profiling.report.presentation.core.sequence import Sequence
from pandas_profiling.report.presentation.flavours.html import templates


class HTMLSequence(Sequence):
    def render(self):
        if self.sequence_type in ["list", "accordion"]:
            return templates.template("sequence/list.html").render(
                anchor_id=self.content["anchor_id"], items=self.content["items"]
            )
        elif self.sequence_type == "tabs":
            return templates.template("sequence/tabs.html").render(
                tabs=self.content["items"], anchor_id=self.content["anchor_id"]
            )
        elif self.sequence_type == "sections":
            return templates.template("sequence/sections.html").render(
                sections=self.content["items"],
                full_width=config["html"]["style"]["full_width"].get(bool),
            )
        elif self.sequence_type == "grid":
            return templates.template("sequence/grid.html").render(
                items=self.content["items"]
            )

        raise ValueError("Template not understood", self.sequence_type)

Classes

class HTMLSequence (items, sequence_type, **kwargs)

Helper class that provides a standard way to create an ABC using inheritance.

Expand source code
class HTMLSequence(Sequence):
    def render(self):
        if self.sequence_type in ["list", "accordion"]:
            return templates.template("sequence/list.html").render(
                anchor_id=self.content["anchor_id"], items=self.content["items"]
            )
        elif self.sequence_type == "tabs":
            return templates.template("sequence/tabs.html").render(
                tabs=self.content["items"], anchor_id=self.content["anchor_id"]
            )
        elif self.sequence_type == "sections":
            return templates.template("sequence/sections.html").render(
                sections=self.content["items"],
                full_width=config["html"]["style"]["full_width"].get(bool),
            )
        elif self.sequence_type == "grid":
            return templates.template("sequence/grid.html").render(
                items=self.content["items"]
            )

        raise ValueError("Template not understood", self.sequence_type)

Ancestors

Methods

def render(self)
Expand source code
def render(self):
    if self.sequence_type in ["list", "accordion"]:
        return templates.template("sequence/list.html").render(
            anchor_id=self.content["anchor_id"], items=self.content["items"]
        )
    elif self.sequence_type == "tabs":
        return templates.template("sequence/tabs.html").render(
            tabs=self.content["items"], anchor_id=self.content["anchor_id"]
        )
    elif self.sequence_type == "sections":
        return templates.template("sequence/sections.html").render(
            sections=self.content["items"],
            full_width=config["html"]["style"]["full_width"].get(bool),
        )
    elif self.sequence_type == "grid":
        return templates.template("sequence/grid.html").render(
            items=self.content["items"]
        )

    raise ValueError("Template not understood", self.sequence_type)