"""
PandaView
=========

Small, composable extensions around pandas that can be reused across projects.

Usage
-----
Once the package is installed, any DataFrame gets a ``see`` accessor::

    import pandas as pd
    import pandaview

    df = pd.DataFrame({"a": [1, 2, None]})
    df.see()
"""

from __future__ import annotations

import pandas as pd

from pandaview.see import see


@pd.api.extensions.register_dataframe_accessor("see")
class PandaViewAccessor:
    """Custom accessor exposed as ``df.see`` to provide convenience helpers.

    Access pattern
    --------------
    ``df.see`` returns an accessor object, which is callable::

        df.see()        # uses default number of rows
        df.see(rows=5)  # custom preview size
    """

    def __init__(self, df: pd.DataFrame) -> None:
        self._df = df

    def __call__(self, rows: int = 2) -> None:
        """Display a styled preview of the DataFrame."""
        see(self._df, rows)


__all__ = ["PandaViewAccessor", "see"]


