def status(): P = os.getcwd() repo = Repository(path=P) click.echo(repo.status())
from sanic import Sanic from sanic_cors import CORS from sanic.response import json from hangar import Repository from PIL import Image import base64 from io import BytesIO parser = argparse.ArgumentParser() parser.add_argument('--path', type=str, help='Path to a hangar repo') args = parser.parse_args() repo = Repository(path=args.path) co = repo.checkout() try: repo.status() except AttributeError: # raise RuntimeError('Repository not initialized') pass # TODO do this check dtypenummap = {2: 'uint8', 7: 'int64'} def get_dset_info(): dset2frontend = [] for k, v in co.datasets.items(): each = {} each['name'] = v._dsetn each['is_var'] = v._schema_variable each['max_shape'] = str(v._schema_max_shape)