PubChemPy
  • Introduction
    • How PubChemPy works
    • The PUG REST web service
    • PubChemPy license
  • Installation
    • Option 1: Use pip (recommended)
    • Option 2: Download the latest release
    • Option 3: Clone the repository
  • Getting started
    • Retrieving a Compound
    • Searching
  • Search
    • 2D and 3D coordinates
    • Advanced search types
  • Compound
  • Substance
  • Properties
    • Synonyms
    • Identifiers
  • pandas integration
  • Download
  • Advanced
    • Avoiding TimeoutError
    • Logging
    • Custom requests
  • Contribute
    • Contributors
  • API documentation
    • Search functions
    • Compound, Substance and Assay
    • pandas functions
    • Exceptions
    • Changes
 
PubChemPy
  • Docs »
  • Search
  • Edit on GitHub

Search¶

2D and 3D coordinates¶

By default, compounds are returned with 2D coordinates. Use the record_type keyword argument to specify otherwise:

pcp.get_compounds('Aspirin', 'name', record_type='3d')

Advanced search types¶

By default, requests look for an exact match with the input. Alternatively, you can specify substructure, superstructure, similarity and identity searches using the searchtype keyword argument:

pcp.get_compounds('CC', searchtype='superstructure', listkey_count=3)

The listkey_count and listkey_start arguments can be used for pagination. Each searchtype has its own options that can be specified as keyword arguments. For example, similarity searches have a Threshold, and super/substructure searches have MatchIsotopes. A full list of options is available in the PUG REST Specification.

Note: These types of search are slow.

Next Previous

© Copyright 2014, Matt Swain.

Sphinx theme provided by Read the Docs