chemicalchecker.database.molecule.Molecule
- class Molecule(**kwargs)[source]
Bases:
Base
Molecule Table class.
- Parameters:
inchikey (str) – primary key, simple unique name for the Datasource.
inchi (str) – the download link.
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
Method to add a new row to the table.
Add lot of rows to the table.
Add data to the table if not already present.
Method to query table.
get_inchikey_inchi_mapping
get_missing_from_set
Attributes
inchi
inchikey
metadata
registry
- 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, on_conflict_do_nothing=True)[source]
Add lot of rows to the table.
This method allows to load a big amount 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.