{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import gdrivefs\n", "# use this the first time you run\n", "token = 'browser'\n", "# use this on subsequent attempts\n", "#token = 'cache'\n", "\n", "# shareable link to folder generated with\n", "# https://drive.google.com/open?id=1FQzXM2E28WF6fV7vy1K7HdxNV-w6z_Wx\n", "root_file_id = '1FQzXM2E28WF6fV7vy1K7HdxNV-w6z_Wx'\n", "\n", "gdfs = gdrivefs.GoogleDriveFileSystem(token=token, root_file_id='1FQzXM2E28WF6fV7vy1K7HdxNV-w6z_Wx')\n", "gdfs" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "gdfs.ls(\"\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "gdfs.ls(\"woa_t_an.zarr/\", detail=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mapper = gdfs.get_mapper('/woa_t_an.zarr/')\n", "mapper" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "ds = xr.open_zarr(mapper, consolidated=True, decode_times=False, chunks=False)\n", "ds" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%time dsl = ds.compute()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dsl.nbytes / 1e6" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:gdrive-fsspec]", "language": "python", "name": "conda-env-gdrive-fsspec-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 4 }