chemicalchecker.database.pubchem.Pubchem

class Pubchem(**kwargs)[source]

Bases: Base

Pubchem Table class.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Methods

add

Method to add a new row to the table.

add_bulk

Add lot of rows to the table.

get

Method to query table.

Attributes

cid

inchikey

inchikey_pubchem

metadata

name

registry

synonyms

static add(kwargs)[source]

Method to add a new row to the table.

Parameters:

kwargs (dict) – The data in dictionary format .

static add_bulk(data, chunk=1000)[source]

Add lot of rows to the table.

This method allows to load a big amound of rows in one instruction

Parameters:
  • data (list) – The data in list format. Each list member is a new row. The order is important.

  • chunk (int) – The size of the chunks to load data to the database.

static get(cid=None, inchikey_pubchem=None, inchikey=None, name=None, synonyms=None)[source]

Method to query table.

Parameters:
  • cid (int) – The cid that want to find

  • inchikey_pubchem (str) – The inchikey_pubchem to query

  • inchikey (str) – The inchikey to query