# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/10_attr.ipynb.

# %% auto 0
__all__ = ['hasshape', 'hascolumns', 'hasindex', 'hasdf', 'hasidx', 'hasloc', 'hasiloc', 'hasicat']

# %% ../nbs/10_attr.ipynb 4
from typing import TypeGuard
from typing import Callable

# %% ../nbs/10_attr.ipynb 5
from atyp import IndexLike, DataFrame
from nlit import SHAPE, COLUMNS, INDEX, DF, IDX, LOC, ILOC, ICAT
from chck import isdf

# %% ../nbs/10_attr.ipynb 6
from .core import make

# %% ../nbs/10_attr.ipynb 9
@make(SHAPE)
def hasshape(obj) -> TypeGuard[object]: '''Checks if `obj.shape` exists'''

@make(COLUMNS)
def hascolumns(obj) -> TypeGuard[object]: '''Checks if `obj.columns` exists'''


@make(INDEX)
def hasindex(obj) -> TypeGuard[object]: '''Checks if `obj.index` exists'''

# %% ../nbs/10_attr.ipynb 12
@make(DF)
def hasdf(obj) -> TypeGuard[DataFrame]: '''Checks if `obj.df` exists'''

# %% ../nbs/10_attr.ipynb 13
@make(IDX)
def hasidx(x, default = None) -> TypeGuard[IndexLike] | None: ...

@make(INDEX)
def hasindex(x, default = None) -> TypeGuard[IndexLike] | None: ...

# %% ../nbs/10_attr.ipynb 14
@make(LOC, otype=isdf)
def hasloc(x, default = None) -> TypeGuard[IndexLike] | None: ...

@make(ILOC, otype=isdf)
def hasiloc(x, default = None) -> TypeGuard[IndexLike] | None: ...

@make(ICAT, otype=isdf)
def hasicat(x, default = None) -> TypeGuard[IndexLike] | None: ...
