12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {
- "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
- }
|