{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Get started\n", "Fill in your host name and get started exploring your catalog with the `datapath` API." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from deriva.core import ErmrestCatalog, get_credential" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fill in your desired scheme, hostname and catalog number." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "scheme = 'https'\n", "hostname = None\n", "catalog_number = 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use DERIVA-Auth to get a `credential` or use `None` if your catalog allows anonymous access." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "credential = None\n", "#credential = get_credential(hostname)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, connect to your catalog and the `pathbuilder` interface for the catalog." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "assert scheme == 'http' or scheme == 'https', \"Invalid http scheme used.\"\n", "assert isinstance(hostname, str), \"Hostname not set.\"\n", "assert isinstance(catalog_number, int), \"Invalid catalog number\"\n", "catalog = ErmrestCatalog(scheme, hostname, catalog_number, credential)\n", "pb = catalog.getPathBuilder()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start using the pathbuilder, like this to get a list of your catalog's schema names." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "list(pb.schemas)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.6.2" } }, "nbformat": 4, "nbformat_minor": 2 }