-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path24-2.1 Query ChemSpider online
1 lines (1 loc) · 7.22 KB
/
24-2.1 Query ChemSpider online
1
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"24-2.1 Query ChemSpider online","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyPhjIyRA3YdvMCCv3RUzP0V"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"id":"kXZimKPU3Wj9"},"source":["# Query ChemSpider online\n","# author: Gressling, T\n","# license: MIT License # code: github.com/gressling/examples\n","# activity: single example # index: 24-2 \n","# Obtain API Key here: https://developer.rsc.org/my-apps"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"6ueCajYc3i8t","executionInfo":{"status":"ok","timestamp":1605342491876,"user_tz":-60,"elapsed":6119,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}},"outputId":"ce7910ed-549b-4e11-84c7-f3f2e7c6818e","colab":{"base_uri":"https://localhost:8080/"}},"source":["!pip install ChemSpiPy"],"execution_count":1,"outputs":[{"output_type":"stream","text":["Collecting ChemSpiPy\n"," Downloading https://files.pythonhosted.org/packages/c8/15/0c10f41eda1036fbea0b30b5f211f6c8727f786cb54ffe0ea10eff776b33/ChemSpiPy-2.0.0.tar.gz\n","Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from ChemSpiPy) (2.23.0)\n","Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from ChemSpiPy) (1.15.0)\n","Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->ChemSpiPy) (3.0.4)\n","Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->ChemSpiPy) (2.10)\n","Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->ChemSpiPy) (1.24.3)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->ChemSpiPy) (2020.6.20)\n","Building wheels for collected packages: ChemSpiPy\n"," Building wheel for ChemSpiPy (setup.py) ... \u001b[?25l\u001b[?25hdone\n"," Created wheel for ChemSpiPy: filename=ChemSpiPy-2.0.0-cp36-none-any.whl size=15085 sha256=944f34a0d4703736a43d27318f53f90bddb8d82dc018633e16976e90d772caf3\n"," Stored in directory: /root/.cache/pip/wheels/41/51/17/e9688355ae4b11e545ded3ac86923fb35987b84ab2496a96db\n","Successfully built ChemSpiPy\n","Installing collected packages: ChemSpiPy\n","Successfully installed ChemSpiPy-2.0.0\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"TbNMCyZR4UXN","executionInfo":{"status":"ok","timestamp":1605342679143,"user_tz":-60,"elapsed":693,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}}},"source":["from chemspipy import ChemSpider"],"execution_count":2,"outputs":[]},{"cell_type":"code","metadata":{"id":"aZ5ttIYy4YDN","executionInfo":{"status":"ok","timestamp":1605342932148,"user_tz":-60,"elapsed":442,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}}},"source":["cs = ChemSpider('IAhxxxxxxxxTG5J9e')"],"execution_count":3,"outputs":[]},{"cell_type":"code","metadata":{"id":"4F2oT4cU3cFO","executionInfo":{"status":"ok","timestamp":1605342957296,"user_tz":-60,"elapsed":404,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}}},"source":["c1 = cs.get_compound(236) # Specify compound by ChemSpider ID\n","c2 = cs.search('benzene') # Search using name, SMILES, InChI, InChIKey, etc."],"execution_count":5,"outputs":[]},{"cell_type":"code","metadata":{"id":"FLfzsSDH5Z1k","executionInfo":{"status":"ok","timestamp":1605342964195,"user_tz":-60,"elapsed":671,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}},"outputId":"9f7c773f-f34f-4045-8223-6511d0fb620e","colab":{"base_uri":"https://localhost:8080/","height":167}},"source":["c1"],"execution_count":6,"outputs":[{"output_type":"execute_result","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAYDSURBVHhe7d0tTCtLHIdhICFBIhAoQjAQFJIQBDgcSFAgEQgkggRBwodCkmDAgUMiSTBIgkIiwSGRe+/v3F1uu2dmaUv/zMzu+yRNDj1tD6HvmZ2dlulABhggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggrA6dnJxkExMT2c7OTn4NqhDWN56enrL5+flsYGDg6zIzM5Pd39/nt4ALYXm8vb1l29vbbUGVL2tra9nr62t+D7QirJLPz8/s+Pg4Gx0dbYtocnIyOzw8zObm5tquHxkZyfb29rKPj4/8ESCE1eLu7u5PQK3hKDCFpuAK5+fn2fj4eNvt9LWux38I618vLy/ZyspKWyi66FCoQ6KLRiiNVBqxWu+jEe3x8TG/VXM1OizFsbu72xaGLpqsdxqH5liaa5UfY3193RtlEzQ2rL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F0aoI66L2YRX68QTrMVrvXzX6KejyPKrXoFPUmLDkp4ckzZEUo+ZJvvma5SE4JY0Kq+CbRP/kA55+66QhFY0Mq6DTftdH0nV72u9aFNXXlsscsWt0WKKAel2ojGFhNlaND6ugQ6DrpRXXy0O6re+lJM2xQFh/0eJmeRTSRZP+9/d356JoLC9+x4SwPFyLoENDQ21f6/AZ49t1YkBYFTT/co1QulS9pwqE1RHNqRYWFv4ENTU1FewtOSkhLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLJggLBjIsn8Ak6VtbdiC80gAAAAASUVORK5CYII=\n","text/plain":["Compound(236)"]},"metadata":{"tags":[]},"execution_count":6}]},{"cell_type":"code","metadata":{"id":"nPxIdFPd5fIU","executionInfo":{"status":"ok","timestamp":1605342993868,"user_tz":-60,"elapsed":1136,"user":{"displayName":"Dr. Thorsten Gressling","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14Gjsy54zs1Pd2tw4fMBrz3a7FsYlzNHgwHWDqLywqA=s64","userId":"08619859847936335393"}},"outputId":"d2df328d-c5dd-4353-a92a-c850d0d215af","colab":{"base_uri":"https://localhost:8080/","height":35}},"source":["c1.inchi"],"execution_count":7,"outputs":[{"output_type":"execute_result","data":{"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"},"text/plain":["'InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H'"]},"metadata":{"tags":[]},"execution_count":7}]}]}