| @@ -0,0 +1,97 @@ | |||
| { | |||
| "cells": [ | |||
| { | |||
| "cell_type": "code", | |||
| "execution_count": 1, | |||
| "metadata": {}, | |||
| "outputs": [], | |||
| "source": [ | |||
| "import requests" | |||
| ] | |||
| }, | |||
| { | |||
| "cell_type": "code", | |||
| "execution_count": 11, | |||
| "metadata": {}, | |||
| "outputs": [], | |||
| "source": [ | |||
| "\n", | |||
| "url = 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/vioxx/property/CanonicalSMILES/TXT'\n", | |||
| "data = '''{\n", | |||
| " \"query\": {\n", | |||
| " \"bool\": {\n", | |||
| " \"must\": [\n", | |||
| " {\n", | |||
| " \"text\": {\n", | |||
| " \"record.document\": \"SOME_JOURNAL\"\n", | |||
| " }\n", | |||
| " },\n", | |||
| " {\n", | |||
| " \"text\": {\n", | |||
| " \"record.articleTitle\": \"farmers\"\n", | |||
| " }\n", | |||
| " }\n", | |||
| " ],\n", | |||
| " \"must_not\": [],\n", | |||
| " \"should\": []\n", | |||
| " }\n", | |||
| " },\n", | |||
| " \"from\": 0,\n", | |||
| " \"size\": 50,\n", | |||
| " \"sort\": [],\n", | |||
| " \"facets\": {}\n", | |||
| "}'''\n", | |||
| "response = requests.post(url, data=data)" | |||
| ] | |||
| }, | |||
| { | |||
| "cell_type": "code", | |||
| "execution_count": 12, | |||
| "metadata": {}, | |||
| "outputs": [ | |||
| { | |||
| "name": "stdout", | |||
| "output_type": "stream", | |||
| "text": [ | |||
| "200\n", | |||
| "CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3\n", | |||
| "\n" | |||
| ] | |||
| } | |||
| ], | |||
| "source": [ | |||
| "print(response.status_code)\n", | |||
| "print(response.text)" | |||
| ] | |||
| }, | |||
| { | |||
| "cell_type": "code", | |||
| "execution_count": null, | |||
| "metadata": {}, | |||
| "outputs": [], | |||
| "source": [] | |||
| } | |||
| ], | |||
| "metadata": { | |||
| "kernelspec": { | |||
| "display_name": "base", | |||
| "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" | |||
| }, | |||
| "orig_nbformat": 4 | |||
| }, | |||
| "nbformat": 4, | |||
| "nbformat_minor": 2 | |||
| } | |||