aiida.tools.dbimporters package#
Module for plugins to import data from external databases into an AiiDA database.
Subpackages#
- aiida.tools.dbimporters.plugins package
- Submodules
CodDbImporter
CodDbImporter.__annotations__
CodDbImporter.__init__()
CodDbImporter.__module__
CodDbImporter._angle_clause()
CodDbImporter._composition_clause()
CodDbImporter._connect_db()
CodDbImporter._disconnect_db()
CodDbImporter._double_clause()
CodDbImporter._formula_clause()
CodDbImporter._int_clause()
CodDbImporter._keywords
CodDbImporter._length_clause()
CodDbImporter._pressure_clause()
CodDbImporter._str_exact_clause()
CodDbImporter._str_exact_or_none_clause()
CodDbImporter._str_fuzzy_clause()
CodDbImporter._temperature_clause()
CodDbImporter._volume_clause()
CodDbImporter.angle_precision
CodDbImporter.get_supported_keywords()
CodDbImporter.length_precision
CodDbImporter.pressure_precision
CodDbImporter.query()
CodDbImporter.query_sql()
CodDbImporter.setup_db()
CodDbImporter.temperature_precision
CodDbImporter.volume_precision
CodEntry
CodSearchResults
CifFileErrorExp
IcsdDbImporter
IcsdDbImporter.__annotations__
IcsdDbImporter.__init__()
IcsdDbImporter.__module__
IcsdDbImporter._angle_clause()
IcsdDbImporter._composition_clause()
IcsdDbImporter._crystal_system_clause()
IcsdDbImporter._density_clause()
IcsdDbImporter._double_clause()
IcsdDbImporter._formula_clause()
IcsdDbImporter._int_clause()
IcsdDbImporter._length_clause()
IcsdDbImporter._parse_all()
IcsdDbImporter._parse_mineral()
IcsdDbImporter._parse_number()
IcsdDbImporter._parse_system()
IcsdDbImporter._parse_volume()
IcsdDbImporter._pressure_clause()
IcsdDbImporter._query_sql_db()
IcsdDbImporter._queryweb()
IcsdDbImporter._str_exact_clause()
IcsdDbImporter._str_fuzzy_clause()
IcsdDbImporter._temperature_clause()
IcsdDbImporter._volume_clause()
IcsdDbImporter.angle_precision
IcsdDbImporter.density_precision
IcsdDbImporter.get_supported_keywords()
IcsdDbImporter.keywords
IcsdDbImporter.keywords_db
IcsdDbImporter.length_precision
IcsdDbImporter.pressure_precision
IcsdDbImporter.query()
IcsdDbImporter.setup_db()
IcsdDbImporter.temperature_precision
IcsdDbImporter.volume_precision
IcsdEntry
IcsdImporterExp
IcsdSearchResults
IcsdSearchResults.__annotations__
IcsdSearchResults.__init__()
IcsdSearchResults.__module__
IcsdSearchResults._connect_db()
IcsdSearchResults._disconnect_db()
IcsdSearchResults.at()
IcsdSearchResults.cif_url
IcsdSearchResults.db_name
IcsdSearchResults.next()
IcsdSearchResults.query_db_version()
IcsdSearchResults.query_page()
IcsdSearchResults.results
NoResultsWebExp
correct_cif()
MaterialsProjectCifEntry
MaterialsProjectImporter
MaterialsProjectImporter.__annotations__
MaterialsProjectImporter.__init__()
MaterialsProjectImporter.__module__
MaterialsProjectImporter._find()
MaterialsProjectImporter._properties
MaterialsProjectImporter._supported_keywords
MaterialsProjectImporter._verify_api_key()
MaterialsProjectImporter.api_key
MaterialsProjectImporter.get_supported_keywords()
MaterialsProjectImporter.properties
MaterialsProjectImporter.query()
MaterialsProjectImporter.setup_db()
MaterialsProjectSearchResults
MaterialsProjectSearchResults.__annotations__
MaterialsProjectSearchResults.__init__()
MaterialsProjectSearchResults.__module__
MaterialsProjectSearchResults._db_name
MaterialsProjectSearchResults._db_uri
MaterialsProjectSearchResults._get_source_dict()
MaterialsProjectSearchResults._get_url()
MaterialsProjectSearchResults._material_base_url
MaterialsProjectSearchResults._version
ApiFormat
MpdsCifEntry
MpdsDbImporter
MpdsDbImporter.__annotations__
MpdsDbImporter.__init__()
MpdsDbImporter.__module__
MpdsDbImporter._api_key
MpdsDbImporter._collection
MpdsDbImporter._pagesize
MpdsDbImporter._supported_keywords
MpdsDbImporter._url
MpdsDbImporter.api_key
MpdsDbImporter.collection
MpdsDbImporter.find()
MpdsDbImporter.get()
MpdsDbImporter.get_id_from_cif()
MpdsDbImporter.get_response_content()
MpdsDbImporter.get_supported_keywords
MpdsDbImporter.pagesize
MpdsDbImporter.query()
MpdsDbImporter.setup_db()
MpdsDbImporter.structures
MpdsDbImporter.url
MpdsEntry
MpdsSearchResults
StructuresCollection
MpodDbImporter
MpodEntry
MpodSearchResults
NnincDbImporter
NnincEntry
NnincSearchResults
OqmdDbImporter
OqmdEntry
OqmdSearchResults
PcodDbImporter
PcodEntry
PcodSearchResults
TcodDbImporter
TcodEntry
TcodSearchResults
- Submodules
Submodules#
Base class implementation for an external database importer.
- class aiida.tools.dbimporters.baseclasses.CifEntry(db_name=None, db_uri=None, id=None, version=None, extras=None, uri=None)[source]#
Bases:
DbEntry
Represents an entry from the structure database (COD, ICSD, …).
- __annotations__ = {}#
- __module__ = 'aiida.tools.dbimporters.baseclasses'#
- property cif#
Returns raw contents of a CIF file as string.
- get_aiida_structure(converter='pymatgen', store=False, **kwargs)[source]#
- Returns:
AiiDA structure corresponding to the CIF file.
- get_ase_structure()[source]#
Returns ASE representation of the CIF.
Note
To be removed, as it is duplicated in
aiida.orm.nodes.data.cif.CifData
.
- get_cif_node(store=False, parse_policy='lazy')[source]#
Creates a CIF node, that can be used in AiiDA workflow.
- Returns:
- class aiida.tools.dbimporters.baseclasses.DbEntry(db_name=None, db_uri=None, id=None, version=None, extras=None, uri=None)[source]#
Bases:
object
Represents an entry from external database.
- __annotations__ = {'_license': typing.Optional[str]}#
- __dict__ = mappingproxy({'__module__': 'aiida.tools.dbimporters.baseclasses', '__annotations__': {'_license': typing.Optional[str]}, '__doc__': 'Represents an entry from external database.', '_license': None, '__init__': <function DbEntry.__init__>, '__repr__': <function DbEntry.__repr__>, 'contents': <property object>, '__dict__': <attribute '__dict__' of 'DbEntry' objects>, '__weakref__': <attribute '__weakref__' of 'DbEntry' objects>})#
- __init__(db_name=None, db_uri=None, id=None, version=None, extras=None, uri=None)[source]#
Sets the basic parameters for the database entry:
- Parameters:
db_name – name of the source database
db_uri – URI of the source database
id – structure identifyer in the database
version – version of the database
extras – a dictionary with some extra parameters (e.g. database ID number)
uri – URI of the structure (should be permanent)
- __module__ = 'aiida.tools.dbimporters.baseclasses'#
- __weakref__#
list of weak references to the object
- property contents#
Returns raw contents of a file as string.
- class aiida.tools.dbimporters.baseclasses.DbImporter[source]#
Bases:
object
Base class implementation for an external database importer.
- __dict__ = mappingproxy({'__module__': 'aiida.tools.dbimporters.baseclasses', '__doc__': 'Base class implementation for an external database importer.', 'query': <function DbImporter.query>, 'setup_db': <function DbImporter.setup_db>, 'get_supported_keywords': <function DbImporter.get_supported_keywords>, '__dict__': <attribute '__dict__' of 'DbImporter' objects>, '__weakref__': <attribute '__weakref__' of 'DbImporter' objects>, '__annotations__': {}})#
- __module__ = 'aiida.tools.dbimporters.baseclasses'#
- __weakref__#
list of weak references to the object
- get_supported_keywords()[source]#
Returns the list of all supported query keywords.
- Returns:
list of strings
- query(**kwargs)[source]#
Method to query the database.
- Parameters:
id – database-specific entry identificator
element – element name from periodic table of elements
number_of_elements – number of different elements
mineral_name – name of mineral
chemical_name – chemical name of substance
formula – chemical formula
volume – volume of the unit cell in cubic angstroms
spacegroup – symmetry space group symbol in Hermann-Mauguin notation
spacegroup_hall – symmetry space group symbol in Hall notation
a – length of lattice vector in angstroms
b – length of lattice vector in angstroms
c – length of lattice vector in angstroms
alpha – angles between lattice vectors in degrees
beta – angles between lattice vectors in degrees
gamma – angles between lattice vectors in degrees
z – number of the formula units in the unit cell
measurement_temp – temperature in kelvins at which the unit-cell parameters were measured
measurement_pressure – pressure in kPa at which the unit-cell parameters were measured
diffraction_temp – mean temperature in kelvins at which the intensities were measured
diffraction_pressure – mean pressure in kPa at which the intensities were measured
authors – authors of the publication
journal – name of the journal
title – title of the publication
year – year of the publication
journal_volume – journal volume of the publication
journal_issue – journal issue of the publication
first_page – first page of the publication
last_page – last page of the publication
doi – digital object identifyer (DOI), refering to the publication
- Raises:
NotImplementedError – if search using given keyword is not implemented.
- class aiida.tools.dbimporters.baseclasses.DbSearchResults(results)[source]#
Bases:
object
Base class for database results.
All classes, inheriting this one and overriding
at()
, are able to benefit from having functions__iter__
,__len__
and__getitem__
.- class DbSearchResultsIterator(results, increment=1)[source]#
Bases:
object
Iterator for search results.
- __dict__ = mappingproxy({'__module__': 'aiida.tools.dbimporters.baseclasses', '__doc__': 'Iterator for search results.', '__init__': <function DbSearchResults.DbSearchResultsIterator.__init__>, '__next__': <function DbSearchResults.DbSearchResultsIterator.__next__>, '__dict__': <attribute '__dict__' of 'DbSearchResultsIterator' objects>, '__weakref__': <attribute '__weakref__' of 'DbSearchResultsIterator' objects>, '__annotations__': {}})#
- __module__ = 'aiida.tools.dbimporters.baseclasses'#
- __weakref__#
list of weak references to the object
- __annotations__ = {'_return_class': <class 'type'>}#
- __dict__ = mappingproxy({'__module__': 'aiida.tools.dbimporters.baseclasses', '__annotations__': {'_return_class': <class 'type'>}, '__doc__': 'Base class for database results.\n\n All classes, inheriting this one and overriding ``at()``, are able to\n benefit from having functions ``__iter__``, ``__len__`` and\n ``__getitem__``.\n ', '__init__': <function DbSearchResults.__init__>, 'DbSearchResultsIterator': <class 'aiida.tools.dbimporters.baseclasses.DbSearchResults.DbSearchResultsIterator'>, '__iter__': <function DbSearchResults.__iter__>, '__len__': <function DbSearchResults.__len__>, '__getitem__': <function DbSearchResults.__getitem__>, 'fetch_all': <function DbSearchResults.fetch_all>, 'next': <function DbSearchResults.next>, 'at': <function DbSearchResults.at>, '_get_source_dict': <function DbSearchResults._get_source_dict>, '_get_url': <function DbSearchResults._get_url>, '__dict__': <attribute '__dict__' of 'DbSearchResults' objects>, '__weakref__': <attribute '__weakref__' of 'DbSearchResults' objects>})#
- __iter__()[source]#
Instances of
aiida.tools.dbimporters.baseclasses.DbSearchResults
can be used as iterators.
- __module__ = 'aiida.tools.dbimporters.baseclasses'#
- __weakref__#
list of weak references to the object
- _get_source_dict(result_dict)[source]#
Returns a dictionary, which is passed as kwargs to the created DbEntry instance, describing the source of the entry.
- Parameters:
result_dict – dictionary, describing an entry in the results.
- _get_url(result_dict)[source]#
Returns an URL of an entry CIF file.
- Parameters:
result_dict – dictionary, describing an entry in the results.
- at(position)[source]#
Returns
position
-th result asaiida.tools.dbimporters.baseclasses.DbEntry
.- Parameters:
position – zero-based index of a result.
- Raises:
IndexError – if
position
is out of bounds.
- fetch_all()[source]#
Returns all query results as an array of
aiida.tools.dbimporters.baseclasses.DbEntry
.
- next()[source]#
Returns the next result of the query (instance of
aiida.tools.dbimporters.baseclasses.DbEntry
).- Raises:
StopIteration – when the end of result array is reached.
- class aiida.tools.dbimporters.baseclasses.UpfEntry(db_name=None, db_uri=None, id=None, version=None, extras=None, uri=None)[source]#
Bases:
DbEntry
Represents an entry from the pseudopotential database.
- __annotations__ = {}#
- __module__ = 'aiida.tools.dbimporters.baseclasses'#