sustainable-processes / pura

Clean chemical data quickly
MIT License
10 stars 3 forks source link

Search partial names #21

Closed marcosfelt closed 2 years ago

marcosfelt commented 2 years ago

This fixes #18 by enabling partial name searching via the autocomplete feature in PubChem. We can look into other services later.

An example:

  resolved = resolve_identifiers(
      ["Josiphos SL-J001-1", "Rh(NBD)2BF4", "DuPhos"],
      input_identifer_type=CompoundIdentifierType.NAME,
      output_identifier_type=CompoundIdentifierType.SMILES,
      backup_identifier_types=[
          CompoundIdentifierType.INCHI_KEY,
          CompoundIdentifierType.CAS_NUMBER,
      ],
      services=[PubChem(autocomplete=True), CIR(), CAS(), ChemSpider()],
      agreement=1,
      silent=True,
  )
  print(resolved)