A simple Python wrapper around the PubChem PUG REST API.
Project description
PubChemPy
PubChemPy provides a way to interact with PubChem in Python. It allows chemical searches by name, substructure and similarity, chemical standardization, conversion between chemical file formats, depiction and retrieval of chemical properties.
Installation
Install PubChemPy with pip:
pip install pubchempy
Or with conda:
conda install -c conda-forge pubchempy
For detailed instructions, see the installation guide.
Example usage
Retrieve a compound by its PubChem Compound Identifier (CID) and print its SMILES and IUPAC name:
>>> import pubchempy as pcp
>>> comp = pcp.Compound.from_cid(1423)
>>> print(comp.smiles)
CCCCCCCNC1CCCC1CCCCCCC(=O)O
>>> print(comp.iupac_name)
7-[2-(heptylamino)cyclopentyl]heptanoic acid
Search compounds by name and print the SMILES and molecular weight of the first result:
>>> results = pcp.get_compounds("Aspirin", "name")
>>> print(results[0].smiles)
CC(=O)OC1=CC=CC=C1C(=O)O
>>> print(results[0].molecular_weight)
180.16
Documentation
Full documentation is available at https://docs.pubchempy.org.
This includes a step-by-step guide on how to use PubChemPy, as well as a complete API reference.
Contributing
- Feature ideas and bug reports are welcome on the Issue Tracker.
- Fork the source code on GitHub, make changes and file a pull request.
License
PubChemPy is licensed under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pubchempy-1.0.5.tar.gz.
File metadata
- Download URL: pubchempy-1.0.5.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08f0b2a82a5caa5d61e14935d655da554602d7b5686fe661ab584c882ffff623
|
|
| MD5 |
34e4b6b52a1380d1d3fb51260e193b18
|
|
| BLAKE2b-256 |
30a11b63d717a315b5fdc281e312bd02e9069e22ed8aa63a56d79f8dae95a1f2
|
Provenance
The following attestation bundles were made for pubchempy-1.0.5.tar.gz:
Publisher:
release.yml on mcs07/PubChemPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pubchempy-1.0.5.tar.gz -
Subject digest:
08f0b2a82a5caa5d61e14935d655da554602d7b5686fe661ab584c882ffff623 - Sigstore transparency entry: 485643446
- Sigstore integration time:
-
Permalink:
mcs07/PubChemPy@9935a14e7fdb4a88d27a99fedce69ca99f004698 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/mcs07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9935a14e7fdb4a88d27a99fedce69ca99f004698 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pubchempy-1.0.5-py3-none-any.whl.
File metadata
- Download URL: pubchempy-1.0.5-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e936cfed31fa194042ad463be3c803dde5b12ef2f795caf336e3114127c34fa0
|
|
| MD5 |
2ed5571a15adfb0098f85a003d438480
|
|
| BLAKE2b-256 |
6be32c887645f21b94d992a16775bcf81cdf6dcc36cf1606782cb2a3c86e9a35
|
Provenance
The following attestation bundles were made for pubchempy-1.0.5-py3-none-any.whl:
Publisher:
release.yml on mcs07/PubChemPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pubchempy-1.0.5-py3-none-any.whl -
Subject digest:
e936cfed31fa194042ad463be3c803dde5b12ef2f795caf336e3114127c34fa0 - Sigstore transparency entry: 485643459
- Sigstore integration time:
-
Permalink:
mcs07/PubChemPy@9935a14e7fdb4a88d27a99fedce69ca99f004698 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/mcs07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9935a14e7fdb4a88d27a99fedce69ca99f004698 -
Trigger Event:
push
-
Statement type: