INNER CODE UNIT · Python

main

pybel/pybel · src/pybel/cli.py:157

def main(ctx, connection):
    """Command line interface for PyBEL."""
    ctx.obj = Manager(connection=connection)
    ctx.obj.bind()  # add the engine to the metadata and query property to the session


@main.command()
@click.argument("text")
@click.option("--pprint", is_flag=True)
def parse(text: str, pprint: bool):
    """Parse a single BEL statement and pring JSON output."""
    from .parser.parse_bel import parse as _parse

    click.echo(json.dumps(_parse(text), indent=2 if pprint else None))


@main.command()
@click.argument("path")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…