chemistry_tools.pubchem.images
Attention
This package has the following additional requirements:
cawdrey>=0.1.7 mathematical>=0.1.13 pillow>=7.0.0 pyparsing>=2.4.6 tabulate>=0.8.9
These can be installed as follows:
python -m pip install chemistry-tools[pubchem]
Functions for handling images.
Functions:
|
Returns an image of the structure of the compound with the given name. |
-
get_structure_image(identifier, namespace=<PubChemNamespace.Name: 'name'>, width=300, height=300)[source] Returns an image of the structure of the compound with the given name.
- Parameters
identifier (
Union[str,int,Sequence[Union[str,int]]]) – Identifiers (e.g. name, CID) for the compound to look up. When using the CID namespace data for multiple compounds can be retrieved at once by supplying either a comma-separated string or a list.namespace (
Union[PubChemNamespace,str]) – The type of identifier to look up. Valid values are inPubChemNamespace. Default<PubChemNamespace.Name: 'name'>.width (
int) – The image width in pixels. Default300.height (
int) – The image height in pixels. Default300.
- Return type
Image- Returns
Pillow Image data