{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Show Attributes" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. note::\n", "\n", " The ``show_`` endpoints are meant to be used by admins to build functionality into their metacatalog deployment. These endpoints are not really helpful for the end-user." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Help" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. autofunction:: metacatalog.api.show_attributes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ ".. note::\n", "\n", " ``api.show_attribute`` is one of the very few api endpoints that don't need a session to connect to the database, as it is using the models to collect the information requested. Thus, you don't need actual database connection to use this function." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from metacatalog import api" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[('id', Integer()),\n", " ('first_name', String(length=128)),\n", " ('last_name', String(length=128)),\n", " ('affiliation', String(length=1024))]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "api.show_attributes(table_name='persons', add_type=True)" ] } ], "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 }