INNER CODE UNIT · Python
insert
pybel/pybel · src/pybel/cli.py:455
def insert(manager: Manager, url: str):
"""Add a namespace by URL."""
manager.get_or_create_namespace(url)
def _ls(manager: Manager, model_cls, model_id: int):
if model_id:
n = manager.session.query(model_cls).get(model_id)
_page(n.entries)
else:
for n in manager.session.query(model_cls).order_by(model_cls.uploaded.desc()):
click.echo("\t".join(map(str, (n.id, n.keyword, n.version, n.url))))
@namespaces.command()
@click.option("-u", "--url", help="Specific resource URL to list")
@click.option("-i", "--namespace-id", type=int, help="Specific resource URL to list")