# API Reference


## Classes


Main classes provided by the package


[exceptions.ChemicalConversionError](exceptions.ChemicalConversionError.md#smartclass.exceptions.ChemicalConversionError)  
Error during chemical format conversion.

[exceptions.ClassificationError](exceptions.ClassificationError.md#smartclass.exceptions.ClassificationError)  
Error during chemical classification.

[exceptions.ConfigurationError](exceptions.ConfigurationError.md#smartclass.exceptions.ConfigurationError)  
Error in configuration settings.

[exceptions.DataExportError](exceptions.DataExportError.md#smartclass.exceptions.DataExportError)  
Error exporting data to a file.

[exceptions.DataLoadingError](exceptions.DataLoadingError.md#smartclass.exceptions.DataLoadingError)  
Error loading data from a file or URL.

[exceptions.InChIError](exceptions.InChIError.md#smartclass.exceptions.InChIError)  
Error parsing an InChI string.

[exceptions.InvalidInputError](exceptions.InvalidInputError.md#smartclass.exceptions.InvalidInputError)  
Error for invalid user input.

[exceptions.MoleculeParsingError](exceptions.MoleculeParsingError.md#smartclass.exceptions.MoleculeParsingError)  
Error parsing a molecule representation.

[exceptions.NetworkError](exceptions.NetworkError.md#smartclass.exceptions.NetworkError)  
Error during network operations.

[exceptions.SMARTSError](exceptions.SMARTSError.md#smartclass.exceptions.SMARTSError)  
Error parsing a SMARTS pattern.

[exceptions.SMILESError](exceptions.SMILESError.md#smartclass.exceptions.SMILESError)  
Error parsing a SMILES string.


## Exceptions


Exception classes


[SmartclassError](SmartclassError.md#smartclass.SmartclassError)  
Base exception for all smartclass errors.


## Functions


Utility functions


[bfs_search_classes_generator.tqdm_bfs_search_classes_generator()](bfs_search_classes_generator.tqdm_bfs_search_classes_generator.md#smartclass.bfs_search_classes_generator.tqdm_bfs_search_classes_generator)  
BFS search with tqdm progress bar.

[calculate_mcs()](calculate_mcs.md#smartclass.calculate_mcs)  
Calculate Maximum Common Substructure (MCS) for a list of molecules.

[check_missing_stereochemistry()](check_missing_stereochemistry.md#smartclass.check_missing_stereochemistry)  
Check stereochemistry.

[check_smiles_contains_no_dot()](check_smiles_contains_no_dot.md#smartclass.check_smiles_contains_no_dot)  
Checks if SMILES contains no dot.

[check_smiles_contains_no_isotope()](check_smiles_contains_no_isotope.md#smartclass.check_smiles_contains_no_isotope)  
Checks if SMILES contains no isotope.

[check_smiles_isomeric()](check_smiles_isomeric.md#smartclass.check_smiles_isomeric)  
Check isomeric smiles.

[combine_csv_files()](combine_csv_files.md#smartclass.combine_csv_files)  
Combine multiple CSV files into a single CSV file.

[configure_logging()](configure_logging.md#smartclass.configure_logging)  
Configure logging for the smartclass package.

[convert_chemical_formula()](convert_chemical_formula.md#smartclass.convert_chemical_formula)  
Convert chemical formula.

[convert_classyfire_dict()](convert_classyfire_dict.md#smartclass.convert_classyfire_dict)  
Converts the classyfire json into a CHEMONTID dictionary.

[convert_inchi_to_inchikey()](convert_inchi_to_inchikey.md#smartclass.convert_inchi_to_inchikey)  
Convert a structure InChI to InChIKey.

[convert_inchi_to_mass()](convert_inchi_to_mass.md#smartclass.convert_inchi_to_mass)  
Convert a structure InChI to mass.

[convert_inchi_to_mol()](convert_inchi_to_mol.md#smartclass.convert_inchi_to_mol)  
Convert a structure InChI to MOL.

[convert_inchi_to_smiles()](convert_inchi_to_smiles.md#smartclass.convert_inchi_to_smiles)  
Convert a structure InChI to SMILES.

[convert_list_of_dict()](convert_list_of_dict.md#smartclass.convert_list_of_dict)  
Convert a list of dictionaries to a dictionary with possible inversion.

[convert_mol_to_cxsmiles()](convert_mol_to_cxsmiles.md#smartclass.convert_mol_to_cxsmiles)  
Convert a structure MOL to CXSMILES.

[convert_mol_to_inchi()](convert_mol_to_inchi.md#smartclass.convert_mol_to_inchi)  
Convert a structure MOL to InChI.

[convert_mol_to_inchikey()](convert_mol_to_inchikey.md#smartclass.convert_mol_to_inchikey)  
Convert an RDKit Mol object to an InChIKey.

[convert_mol_to_smarts()](convert_mol_to_smarts.md#smartclass.convert_mol_to_smarts)  
Convert a structure MOL to SMARTS.

[convert_mol_to_smiles()](convert_mol_to_smiles.md#smartclass.convert_mol_to_smiles)  
Convert a structure MOL to SMILES.

[convert_molblock_to_mol()](convert_molblock_to_mol.md#smartclass.convert_molblock_to_mol)  
Convert a structure MOLBlock to MOL.

[convert_smarts_to_mol()](convert_smarts_to_mol.md#smartclass.convert_smarts_to_mol)  
Convert a structure SMARTS to MOL.

[convert_smiles_to_canonical_smiles()](convert_smiles_to_canonical_smiles.md#smartclass.convert_smiles_to_canonical_smiles)  
Convert a structure SMILES to canonical SMILES.

[convert_smiles_to_formula()](convert_smiles_to_formula.md#smartclass.convert_smiles_to_formula)  
Convert a structure SMILES to a molecular formula.

[convert_smiles_to_inchi()](convert_smiles_to_inchi.md#smartclass.convert_smiles_to_inchi)  
Convert a structure SMILES to InChI.

[convert_smiles_to_mass()](convert_smiles_to_mass.md#smartclass.convert_smiles_to_mass)  
Convert a structure SMILES to an exact mass.

[convert_smiles_to_mol()](convert_smiles_to_mol.md#smartclass.convert_smiles_to_mol)  
Convert a SMILES string to an RDKit Mol object.

[download_file_if_not_exists()](download_file_if_not_exists.md#smartclass.download_file_if_not_exists)  
Downloads a file from the specified URL if it does not exist.

[enumerate_structures()](enumerate_structures.md#smartclass.enumerate_structures)  
Enumerate structural variants of a molecule.

[export_dict_to_json()](export_dict_to_json.md#smartclass.export_dict_to_json)  
Export dict to json.

[export_results()](export_results.md#smartclass.export_results)  
Export a list of dictionaries to a CSV or TSV file.

[fix_inchi_tautomerization()](fix_inchi_tautomerization.md#smartclass.fix_inchi_tautomerization)  
Fix InChI tautomerization.

[get_config()](get_config.md#smartclass.get_config)  
Get the global configuration instance.

[get_logger()](get_logger.md#smartclass.get_logger)  
Get a logger for the given module name.

[get_num_atoms_bonds()](get_num_atoms_bonds.md#smartclass.get_num_atoms_bonds)  
Get number of atoms and bonds.

[get_num_matched_atoms_bonds()](get_num_matched_atoms_bonds.md#smartclass.get_num_matched_atoms_bonds)  
Get number of matched atoms and bonds.

[get_request()](get_request.md#smartclass.get_request)  
Send a GET request to a SPARQL endpoint and retrieve JSON data.

[load_csv_from_path()](load_csv_from_path.md#smartclass.load_csv_from_path)  
Load csv from path.

[load_external_classes_file()](load_external_classes_file.md#smartclass.load_external_classes_file)  
Load a Polars DataFrame from an external tsv file with chemical classes.

[load_json_from_path()](load_json_from_path.md#smartclass.load_json_from_path)  
Load json from path.

[load_json_from_url()](load_json_from_url.md#smartclass.load_json_from_url)  
Load JSON from URL.

[load_json_from_url_or_path()](load_json_from_url_or_path.md#smartclass.load_json_from_url_or_path)  
Load json from URL or path.

[load_pkg_bitter_smiles()](load_pkg_bitter_smiles.md#smartclass.load_pkg_bitter_smiles)  
Load bitter SMILES data from the package file into a Polars DataFrame.

[load_pkg_chemical_hierarchy()](load_pkg_chemical_hierarchy.md#smartclass.load_pkg_chemical_hierarchy)  
Load chemical class hierarchy from a TSV file.

[load_pkg_classes()](load_pkg_classes.md#smartclass.load_pkg_classes)  
Load chemical classes data from the package file into a Polars DataFrame.

[load_pkg_data()](load_pkg_data.md#smartclass.load_pkg_data)  
Load the package data.

[load_pkg_file()](load_pkg_file.md#smartclass.load_pkg_file)  
Load data from a package-bundled file into a Polars DataFrame.

[load_pkg_mappings()](load_pkg_mappings.md#smartclass.load_pkg_mappings)  
Load chemont\_\_wd mappings data from the package file into a Polars DataFrame.

[load_pkg_mia()](load_pkg_mia.md#smartclass.load_pkg_mia)  
Load Mono Indole Alkaloids (MIA) data from the package file into a Polars DataFrame.

[load_smiles()](load_smiles.md#smartclass.load_smiles)  
Load unique SMILES strings from a CSV or TSV file.

[load_tsv_from_path()](load_tsv_from_path.md#smartclass.load_tsv_from_path)  
Load tsv from path.

[read_query()](read_query.md#smartclass.read_query)  
Read a SPARQL query from a file path or URL.

[resources.extract_chebi()](resources.extract_chebi.md#smartclass.resources.extract_chebi)  
Extract CHEBI.

[resources.get_chebi()](resources.get_chebi.md#smartclass.resources.get_chebi)  
Get CHEBI.

[sample_list()](sample_list.md#smartclass.sample_list)  
Randomly sample items from a list.

[search_class.build_filter_catalog()](search_class.build_filter_catalog.md#smartclass.search_class.build_filter_catalog)  
Build a FilterCatalog from SMARTS patterns.

[search_classes.tqdm_bfs_search_classes_generator()](search_classes.tqdm_bfs_search_classes_generator.md#smartclass.search_classes.tqdm_bfs_search_classes_generator)  
BFS search with tqdm progress bar.

[split_csv()](split_csv.md#smartclass.split_csv)  
Split a CSV file into multiple smaller CSV files.

[standardize()](standardize.md#smartclass.standardize)  
Standardize.


## Constants


Module-level constants and data


[bfs_search_classes_generator.ClassDict](bfs_search_classes_generator.ClassDict.md#smartclass.bfs_search_classes_generator.ClassDict)  

[bfs_search_classes_generator.ClassHierarchy](bfs_search_classes_generator.ClassHierarchy.md#smartclass.bfs_search_classes_generator.ClassHierarchy)  

[bfs_search_classes_generator.MatchResult](bfs_search_classes_generator.MatchResult.md#smartclass.bfs_search_classes_generator.MatchResult)  

[bfs_search_classes_generator.c](bfs_search_classes_generator.c.md#smartclass.bfs_search_classes_generator.c)  

[bfs_search_classes_generator.class_hierarchy](bfs_search_classes_generator.class_hierarchy.md#smartclass.bfs_search_classes_generator.class_hierarchy)  

[bfs_search_classes_generator.classes](bfs_search_classes_generator.classes.md#smartclass.bfs_search_classes_generator.classes)  

[bfs_search_classes_generator.logger](bfs_search_classes_generator.logger.md#smartclass.bfs_search_classes_generator.logger)  

[bfs_search_classes_generator.params](bfs_search_classes_generator.params.md#smartclass.bfs_search_classes_generator.params)  

[bfs_search_classes_generator.results_bfs](bfs_search_classes_generator.results_bfs.md#smartclass.bfs_search_classes_generator.results_bfs)  

[bfs_search_classes_generator.structures](bfs_search_classes_generator.structures.md#smartclass.bfs_search_classes_generator.structures)  

[search_class.logger](search_class.logger.md#smartclass.search_class.logger)  

[search_classes.RESULT_FIELDS](search_classes.RESULT_FIELDS.md#smartclass.search_classes.RESULT_FIELDS)  

[search_classes.logger](search_classes.logger.md#smartclass.search_classes.logger)  


## Other


Additional exports


[api](api.md#smartclass.api)  
SMARTCLASS API TODO.

[chebi](chebi.md#smartclass.chebi)  
Smartclass classifies structures using SMARTS.resources.chebi.

[chem.convert_inchi_to_inchikey()](chem.convert_inchi_to_inchikey.md#smartclass.chem.convert_inchi_to_inchikey)  
Convert a structure InChI to InChIKey.

[chem.convert_inchi_to_mass()](chem.convert_inchi_to_mass.md#smartclass.chem.convert_inchi_to_mass)  
Convert a structure InChI to mass.

[chem.convert_inchi_to_mol()](chem.convert_inchi_to_mol.md#smartclass.chem.convert_inchi_to_mol)  
Convert a structure InChI to MOL.

[chem.convert_inchi_to_smiles()](chem.convert_inchi_to_smiles.md#smartclass.chem.convert_inchi_to_smiles)  
Convert a structure InChI to SMILES.

[chem.convert_mol_to_cxsmiles()](chem.convert_mol_to_cxsmiles.md#smartclass.chem.convert_mol_to_cxsmiles)  
Convert a structure MOL to CXSMILES.

[chem.convert_mol_to_inchi()](chem.convert_mol_to_inchi.md#smartclass.chem.convert_mol_to_inchi)  
Convert a structure MOL to InChI.

[chem.convert_mol_to_inchikey()](chem.convert_mol_to_inchikey.md#smartclass.chem.convert_mol_to_inchikey)  
Convert an RDKit Mol object to an InChIKey.

[chem.convert_mol_to_smarts()](chem.convert_mol_to_smarts.md#smartclass.chem.convert_mol_to_smarts)  
Convert a structure MOL to SMARTS.

[chem.convert_mol_to_smiles()](chem.convert_mol_to_smiles.md#smartclass.chem.convert_mol_to_smiles)  
Convert a structure MOL to SMILES.

[chem.convert_molblock_to_mol()](chem.convert_molblock_to_mol.md#smartclass.chem.convert_molblock_to_mol)  
Convert a structure MOLBlock to MOL.

[chem.convert_smarts_to_mol()](chem.convert_smarts_to_mol.md#smartclass.chem.convert_smarts_to_mol)  
Convert a structure SMARTS to MOL.

[chem.convert_smiles_to_canonical_smiles()](chem.convert_smiles_to_canonical_smiles.md#smartclass.chem.convert_smiles_to_canonical_smiles)  
Convert a structure SMILES to canonical SMILES.

[chem.convert_smiles_to_formula()](chem.convert_smiles_to_formula.md#smartclass.chem.convert_smiles_to_formula)  
Convert a structure SMILES to a molecular formula.

[chem.convert_smiles_to_inchi()](chem.convert_smiles_to_inchi.md#smartclass.chem.convert_smiles_to_inchi)  
Convert a structure SMILES to InChI.

[chem.convert_smiles_to_mass()](chem.convert_smiles_to_mass.md#smartclass.chem.convert_smiles_to_mass)  
Convert a structure SMILES to an exact mass.

[chem.convert_smiles_to_mol()](chem.convert_smiles_to_mol.md#smartclass.chem.convert_smiles_to_mol)  
Convert a SMILES string to an RDKit Mol object.

[chem.check_missing_stereochemistry()](chem.check_missing_stereochemistry.md#smartclass.chem.check_missing_stereochemistry)  
Check stereochemistry.

[chem.enumerate_structures()](chem.enumerate_structures.md#smartclass.chem.enumerate_structures)  
Enumerate structural variants of a molecule.

[chem.fix_inchi_tautomerization()](chem.fix_inchi_tautomerization.md#smartclass.chem.fix_inchi_tautomerization)  
Fix InChI tautomerization.

[chem.get_num_atoms_bonds()](chem.get_num_atoms_bonds.md#smartclass.chem.get_num_atoms_bonds)  
Get number of atoms and bonds.

[chem.get_num_matched_atoms_bonds()](chem.get_num_matched_atoms_bonds.md#smartclass.chem.get_num_matched_atoms_bonds)  
Get number of matched atoms and bonds.

[chem.standardize()](chem.standardize.md#smartclass.chem.standardize)  
Standardize.

[chem.calculate_mcs()](chem.calculate_mcs.md#smartclass.chem.calculate_mcs)  
Calculate Maximum Common Substructure (MCS) for a list of molecules.

[chembl](chembl.md#smartclass.chembl)  
Smartclass classifies structures using SMARTS.resources.chembl.

[chemont](chemont.md#smartclass.chemont)  
Smartclass classifies structures using SMARTS.resources.chemont.

[examples](examples.md#smartclass.examples)  
Smartclass classifies structures using SMARTS.examples.

[get_class_structures.get_class_structures()](get_class_structures.get_class_structures.md#smartclass.get_class_structures.get_class_structures)  
Build a mapping from class IDs to their SMARTS structures.

[io](io.md#smartclass.io)  
Smartclass classifies structures using SMARTS.io.

[schema](schema.md#smartclass.schema)  
Smartclass classifies structures using SMARTS.schema.

[testing](testing.md#smartclass.testing)  
Smartclass classifies structures using SMARTS.testing.

[wikidata](wikidata.md#smartclass.wikidata)  
Smartclass classifies structures using SMARTS.resources.wikidata.
