1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
(download)=
# Download
The {func}`~pubchempy.download` function is for saving a file to disk. The following formats are available: XML, ASNT/B, JSON, SDF, CSV, PNG, TXT. Beware that not all formats are available for all types of information. SDF and PNG are only available for full Compound and Substance records, and CSV is best suited to tables of properties and identifiers.
Examples:
```python
pcp.download("PNG", "asp.png", "Aspirin", "name")
pcp.download("CSV", "s.csv", [1,2,3], operation="property/ConnectivitySMILES,SMILES")
```
For PNG images, the `image_size` argument can be used to specify `large`, `small`
or `<width>x<height>`.
|