src/bio2bel/cli.py
def summarize(connection, skip):
    """Summarize all."""
    for idx, name, manager in _iterate_managers(connection, skip):
        click.secho(name, fg='cyan', bold=True)
        if not manager.is_populated():
            click.echo('👎 unpopulated')
            continue

        if isinstance(manager, BELNamespaceManagerMixin):
            click.secho(f'Terms: {manager._count_model(manager.namespace_model)}', fg='green')

        if isinstance(manager, BELManagerMixin):
            try:
                click.secho(f'Relations: {manager.count_relations()}', fg='green')
            except TypeError as e:
                click.secho(str(e), fg='red')
        for field_name, count in sorted(manager.summarize().items()):
            click.echo(
                click.style('=> ', fg='white', bold=True) + f"{field_name.replace('_', ' ').capitalize()}: {count}"
            )
def summarize(connection, skip):
    """Summarize all."""
    for idx, name, manager in _iterate_managers(connection, skip):
        click.secho(name, fg='cyan', bold=True)
        if not manager.is_populated():
            click.echo('👎 unpopulated')
            continue

        if isinstance(manager, BELNamespaceManagerMixin):
            click.secho(f'Terms: {manager._count_model(manager.namespace_model)}', fg='green')

        if isinstance(manager, BELManagerMixin):
            try:
                click.secho(f'Relations: {manager.count_relations()}', fg='green')
            except TypeError as e:
                click.secho(str(e), fg='red')
        for field_name, count in sorted(manager.summarize().items()):
            click.echo(
                click.style('=> ', fg='white', bold=True) + f"{field_name.replace('_', ' ').capitalize()}: {count}"
            )
Summarize all.