def inspect_module():
    from flyers import database, spider
    from flyers.logs import get_rich_console_logger
    from rich import inspect
    from rich.console import Console
    from rich.text import Text
    from . import strs, files, dicts, lists, jsons, systems, texts, datetimes, concurrents, nets, assets, emails, logs
    import sys
    packages = {
        'assets': assets,
        'concurrents': concurrents,
        'datetimes': datetimes,
        'dicts': dicts,
        'emails': emails,
        'strs': strs,
        'files': files,
        'lists': lists,
        'jsons': jsons,
        'logs': logs,
        'systems': systems,
        'texts': texts,
        'nets': nets,
        'database.redisson': database.redisson,
        'spider.seleniums': spider.seleniums
    }

    console = Console()
    rich_logger = get_rich_console_logger('pkg')

    args = sys.argv
    if len(args) == 1:
        for k, v in packages.items():
            text = Text()
            text.append('{}   '.format(k), style='bold red')
            text.append(str(v), style='grey0')
            console.print(text)
    else:
        pn = args[1]
        if pn not in packages:
            rich_logger.error("The '{}' package is not present".format(pn))
            exit(-1)
        else:
            inspect(packages[pn], methods=True)


if __name__ == '__main__':
    inspect_module()
