Debian Codegraph @

docs/index.md

raw
1 # PubChemPy documentation
2
3 PubChemPy provides a way to interact with the PubChem database in Python, via the PUG REST API. PubChem is a comprehensive chemical information resource that contains millions of chemical structures and their associated biological, physical, and toxicological data.
4
5 This package handles the complexity of the PubChem PUG REST API, providing a simple Pythonic interface for chemical informatics workflows. It allows retrieval of chemical structures, properties, and experimental data, including molecular descriptors, fingerprints, 3D conformer data, and biological assay results. It also enables chemical searches by name, substructure and similarity, conversion between different chemical formats, chemical standardization, and depiction.
6
7 Here's a quick example showing how to get calculated properties for a specific compound:
8
9 ```pycon
10 >>> import pubchempy as pcp
11 >>> compound = pcp.Compound.from_cid(2244) # Aspirin
12 >>> print(compound.molecular_formula)
13 C9H8O4
14 >>> print(compound.iupac_name)
15 2-acetyloxybenzoic acid
16 >>> print(compound.molecular_weight)
17 180.16
18 >>> print(compound.xlogp)
19 1.2
20 ```
21
22 Here's how to search for a compound by name:
23
24 ```pycon
25 >>> for compound in pcp.get_compounds("glucose", "name"):
26 ... print(compound.cid)
27 ... print(compound.smiles)
28 ...
29 5793
30 C([C@@H]1[C@H]([C@@H]([C@H](C(O1)O)O)O)O)O
31 ```
32
33 All the heavy lifting is done by PubChem's servers, using their database and chemical toolkits.
34
35 ## Features
36
37 - Search PubChem Substance and Compound databases by name, SMILES, InChI and SDF.
38 - Retrieve the standardised Compound record for a given input structure.
39 - Convert between SDF, SMILES, InChI, PubChem CID and more.
40 - Retrieve calculated properties, fingerprints and descriptors.
41 - Generate 2D and 3D coordinates.
42 - Get IUPAC systematic names, trade names and all known synonyms for a given Compound.
43 - Download compound records as XML, ASNT/B, JSON, SDF and depiction as a PNG image.
44 - Construct property tables using *pandas* DataFrames.
45 - A complete Python wrapper around the [PubChem PUG REST web service].
46 - Supports Python versions 3.9+.
47
48 ## Useful links
49
50 - Source code is available on [GitHub].
51 - Ask a question or report a bug on the [Issue Tracker].
52 - PUG REST API [tutorial] and [documentation].
53
54 ## User guide
55
56 A step-by-step guide to getting started with PubChemPy.
57
58 ```{toctree}
59 :maxdepth: 2
60
61 guide/introduction
62 guide/install
63 guide/gettingstarted
64 guide/searching
65 guide/compound
66 guide/substance
67 guide/properties
68 guide/pandas
69 guide/download
70 guide/advanced
71 guide/pugrest
72 guide/contribute
73 ```
74
75 ## API documentation
76
77 Comprehensive API documentation with information on every function, class and method.
78
79 ```{toctree}
80 :maxdepth: 2
81
82 api
83 ```
84
85 [documentation]: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest
86 [GitHub]: https://github.com/mcs07/PubChemPy
87 [Issue Tracker]: https://github.com/mcs07/PubChemPy/issues
88 [PubChem PUG REST web service]: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest
89 [tutorial]: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest-tutorial