{ "cells": [ { "cell_type": "markdown", "id": "5e2e1e06", "metadata": {}, "source": [ "# Properties download examples" ] }, { "cell_type": "markdown", "id": "5d346c74", "metadata": {}, "source": [ "This notebook shows how to retrieve a specific property on the server and save the property with all its curation\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "1bb65af0", "metadata": {}, "outputs": [], "source": [ "import morphonet\n", "import os" ] }, { "cell_type": "code", "execution_count": null, "id": "f43fe809", "metadata": {}, "outputs": [], "source": [ "mn_login=\"user\"\n", "mn_password=\"password\"\n", "mn=morphonet.Net(mn_login,mn_password)" ] }, { "cell_type": "markdown", "id": "f5102980", "metadata": {}, "source": [ "Select the dataset, mandatory to interact with properties. Here we select the dataset number 1.\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "9d439b1b", "metadata": {}, "outputs": [], "source": [ "mn.select_dataset_by_id(1)" ] }, { "cell_type": "markdown", "id": "b61ba17a", "metadata": {}, "source": [ "For the selected dataset, we get the property uploaded with id 15 + the list of curated value for the property\n" ] }, { "cell_type": "code", "execution_count": null, "id": "119946bd", "metadata": {}, "outputs": [], "source": [ "propertyAnnotated=mn.get_property_annotated_by_id(15)" ] }, { "cell_type": "markdown", "id": "b20c6fd7", "metadata": {}, "source": [ "We save the property on the hard drive\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "4ad1bc42", "metadata": {}, "outputs": [], "source": [ "f=open('property_15_dataset_1.txt','w')\n", "f.write(propertyAnnotated)\n", "f.close()\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }