{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Find Thesaurus" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Help" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. autofunction:: metacatalog.api.find_thesaurus" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from metacatalog import api\n", "from pprint import pprint\n", "\n", "session = api.connect_database()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'description': 'NASA Global Clime change Master Dictionary Science Keywords',\n", " 'id': 1,\n", " 'name': 'GCMD',\n", " 'organisation': 'NASA',\n", " 'title': 'NASA/GCMD Earth Science Keywords',\n", " 'url': 'https://gcmdservices.gsfc.nasa.gov/kms/concepts/concept_scheme/sciencekeywords/?format=xml',\n", " 'uuid': '2e54668d-8fae-429f-a511-efe529420b12'}\n" ] } ], "source": [ "gcmd = api.find_thesaurus(session, name='GCMD')[0]\n", "pprint(gcmd.to_dict())" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Associated Keywords found: 3206\n" ] } ], "source": [ "print('Associated Keywords found: %d' % len(gcmd.keywords))" ] } ], "metadata": { "celltoolbar": "Raw Cell Format", "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.7.7" } }, "nbformat": 4, "nbformat_minor": 4 }