@view_config(context=APIPackageFileResource, request_method='POST',
             subpath=(), renderer='json', permission='write')
@argify
def upload_package(context, request, content):
    """ Upload a package """
    try:
        return request.db.upload(content.filename, content.file,
                                 name=context.name)
    except __HOLE__ as e:  # pragma: no cover
        return HTTPBadRequest(*e.args)
dataset/ETHPy150Open mathcamp/pypicloud/pypicloud/views/api.py/upload_package