aiida.tools.dbimporters.plugins package#

Module for plugins to import data from external databases into an AiiDA database.

Submodules#

“Implementation of DbImporter for the COD database.

class aiida.tools.dbimporters.plugins.cod.CodDbImporter(**kwargs)[源代码]#

基类:DbImporter

Database importer for Crystallography Open Database.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.cod'#
_angle_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying lattice angles.

_composition_clause(_, alias, values)[源代码]#

Returns SQL query predicate for querying elements in formula fields.

_connect_db()[源代码]#

Connects to the MySQL database for performing searches.

_disconnect_db()[源代码]#

Closes connection to the MySQL database.

_double_clause(key, alias, values, precision)[源代码]#

Returns SQL query predicate for querying double-valued fields.

_formula_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying formula fields.

_int_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying integer fields.

_keywords = {'a': ['a', <function CodDbImporter._length_clause>], 'alpha': ['alpha', <function CodDbImporter._angle_clause>], 'authors': ['authors', <function CodDbImporter._str_fuzzy_clause>], 'b': ['b', <function CodDbImporter._length_clause>], 'beta': ['beta', <function CodDbImporter._angle_clause>], 'c': ['c', <function CodDbImporter._length_clause>], 'chemical_name': ['chemname', <function CodDbImporter._str_fuzzy_clause>], 'determination_method': ['method', <function CodDbImporter._str_exact_or_none_clause>], 'diffraction_pressure': ['diffrpressure', <function CodDbImporter._pressure_clause>], 'diffraction_temp': ['diffrtemp', <function CodDbImporter._temperature_clause>], 'doi': ['doi', <function CodDbImporter._str_exact_clause>], 'element': ['element', <function CodDbImporter._composition_clause>], 'first_page': ['firstpage', <function CodDbImporter._str_exact_clause>], 'formula': ['formula', <function CodDbImporter._formula_clause>], 'gamma': ['gamma', <function CodDbImporter._angle_clause>], 'id': ['file', <function CodDbImporter._int_clause>], 'journal': ['journal', <function CodDbImporter._str_fuzzy_clause>], 'journal_issue': ['issue', <function CodDbImporter._str_exact_clause>], 'journal_volume': ['volume', <function CodDbImporter._int_clause>], 'last_page': ['lastpage', <function CodDbImporter._str_exact_clause>], 'measurement_pressure': ['cellpressure', <function CodDbImporter._pressure_clause>], 'measurement_temp': ['celltemp', <function CodDbImporter._temperature_clause>], 'mineral_name': ['mineral', <function CodDbImporter._str_fuzzy_clause>], 'number_of_elements': ['nel', <function CodDbImporter._int_clause>], 'spacegroup': ['sg', <function CodDbImporter._str_exact_clause>], 'spacegroup_hall': ['sgHall', <function CodDbImporter._str_exact_clause>], 'title': ['title', <function CodDbImporter._str_fuzzy_clause>], 'volume': ['vol', <function CodDbImporter._volume_clause>], 'year': ['year', <function CodDbImporter._int_clause>], 'z': ['Z', <function CodDbImporter._int_clause>]}#
_length_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying lattice vector lengths.

_pressure_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying pressure.

_str_exact_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying string fields.

_str_exact_or_none_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying string fields, allowing to use Python’s “None” in addition.

_str_fuzzy_clause(key, alias, values)[源代码]#

Returns SQL query predicate for fuzzy querying of string fields.

_temperature_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying temperature.

_volume_clause(key, alias, values)[源代码]#

Returns SQL query predicate for querying unit cell volume.

angle_precision = 0.001#
get_supported_keywords()[源代码]#

Returns the list of all supported query keywords.

返回:

list of strings

length_precision = 0.001#
pressure_precision = 1#
query(**kwargs)[源代码]#

Performs a query on the COD database using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.cod.CodSearchResults.

query_sql(**kwargs)[源代码]#

Forms a SQL query for querying the COD database using keyword = value pairs, specified in kwargs.

返回:

string containing a SQL statement.

setup_db(**kwargs)[源代码]#

Changes the database connection details.

temperature_precision = 0.001#
volume_precision = 0.001#
class aiida.tools.dbimporters.plugins.cod.CodEntry(uri, db_name='Crystallography Open Database', db_uri='http://www.crystallography.net/cod', **kwargs)[源代码]#

基类:CifEntry

Represents an entry from COD.

__annotations__ = {}#
__init__(uri, db_name='Crystallography Open Database', db_uri='http://www.crystallography.net/cod', **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.cod.CodEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.cod'#
_license: str | None = 'CC0'#
class aiida.tools.dbimporters.plugins.cod.CodSearchResults(results)[源代码]#

基类:DbSearchResults

Results of the search, performed on COD.

__annotations__ = {}#
__init__(results)[源代码]#
__len__()[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.cod'#
_base_url = 'http://www.crystallography.net/cod/'#
_get_source_dict(result_dict)[源代码]#

Returns a dictionary, which is passed as kwargs to the created DbEntry instance, describing the source of the entry.

参数:

result_dict – dictionary, describing an entry in the results.

_get_url(result_dict)[源代码]#

Returns an URL of an entry CIF file.

参数:

result_dict – dictionary, describing an entry in the results.

Implementation of DbImporter for the ICSD database.

Note: The implementation in this file is not compatible with the recent versions of ICSD, which are built with Apache Lucene and Tomcat. Older ICSD versions are supported, which included a MySQL database and a php-based web interface. The last confirmed compatible version was released in 2020.

exception aiida.tools.dbimporters.plugins.icsd.CifFileErrorExp[源代码]#

基类:IcsdImporterExp

Raised when the author loop is missing in a CIF file.

__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
class aiida.tools.dbimporters.plugins.icsd.IcsdDbImporter(**kwargs)[源代码]#

基类:DbImporter

Importer for the Inorganic Crystal Structure Database, short ICSD, provided by FIZ Karlsruhe. It allows to run queries and analyse all the results.

参数:
  • server

    Server URL, the web page of the database. It is required in order to have access to the full database. I t should contain both the protocol and the domain name and end with a slash, as in:

    server = "http://ICSDSERVER.com/"
    

  • urladd – part of URL which is added between query and and the server URL (default: index.php?). only needed for web page query

  • querydb – boolean, decides whether the mysql database is queried (default: True). If False, the query results are obtained through the web page query, which is restricted to a maximum of 1000 results per query.

  • dl_db – icsd comes with a full (default: icsd) and a demo database (icsdd). This parameter allows the user to switch to the demo database for testing purposes, if the access rights to the full database are not granted.

  • host

    MySQL database host. If the MySQL database is hosted on a different machine, use “127.0.0.1” as host, and open a SSH tunnel to the host using:

    ssh -L 3306:localhost:3306 username@hostname.com
    

    or (if e.g. you get an URLError with Errno 111 (Connection refused) upon querying):

    ssh -L 3306:localhost:3306 -L 8010:localhost:80 username@hostname.com
    

  • user – mysql database username (default: dba)

  • passwd – mysql database password (default: sql)

  • db – name of the database (default: icsd)

  • port – Port to access the mysql database (default: 3306)

__annotations__ = {}#
__init__(**kwargs)[源代码]#

Construct a new instance.

__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
_angle_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying lattice angles.

_composition_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying elements in formula fields.

_crystal_system_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying crystal_system.

_density_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying density.

_double_clause(key, alias, values, precision)[源代码]#

Return SQL query predicate for querying double-valued fields.

_formula_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying formula fields.

_int_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying integer fields :param key: Database keyword :param alias: Query parameter name :param values: Corresponding values from query :return: SQL query predicate

_length_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying lattice vector lengths.

static _parse_all(key, values)[源代码]#

Convert numbers, strings, lists into strings. :param key: query parameter :param values: corresponding values :return retval: string

static _parse_mineral(key, values)[源代码]#

Convert mineral_name and chemical_name into right format. :param key: query parameter :param values: corresponding values :return retval: string

static _parse_number(key, values)[源代码]#

Convert int into string. :param key: query parameter :param values: corresponding values :return retval: string

static _parse_system(key, values)[源代码]#

Return crystal system in the right format. :param key: query parameter :param values: corresponding values :return retval: string

static _parse_volume(key, values)[源代码]#

Convert volume, cell parameter and angle queries into right format. :param key: query parameter :param values: corresponding values :return retval: string

_pressure_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying pressure.

_query_sql_db(**kwargs)[源代码]#

Perform a query on Icsd mysql database using keyword = value pairs, specified in kwargs. Returns an instance of IcsdSearchResults. :param kwargs: A list of keyword = [values] pairs :return: IcsdSearchResults

_queryweb(**kwargs)[源代码]#

Perform a query on the Icsd web database using keyword = value pairs, specified in kwargs. Returns an instance of IcsdSearchResults. :note: Web search has a maximum result number fixed at 1000. :param kwargs: A list of keyword = [values] pairs :return: IcsdSearchResults

_str_exact_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying string fields.

_str_fuzzy_clause(key, alias, values)[源代码]#

Return SQL query predicate for fuzzy querying of string fields.

_temperature_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying temperature.

_volume_clause(key, alias, values)[源代码]#

Return SQL query predicate for querying unit cell volume.

angle_precision = 0.001#
density_precision = 0.001#
get_supported_keywords()[源代码]#
返回:

List of all supported query keywords.

keywords = {'a': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'alpha': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'authors': ('authors', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'b': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'beta': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'c': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'chemical_name': ('mineral', <staticmethod(<function IcsdDbImporter._parse_mineral>)>), 'crystal_system': ('system', <staticmethod(<function IcsdDbImporter._parse_system>)>), 'element': ('elements', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'formula': ('formula', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'gamma': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'id': ('authors', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'journal': ('journal', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'mineral_name': ('mineral', <staticmethod(<function IcsdDbImporter._parse_mineral>)>), 'number_of_elements': ('elementc', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'spacegroup': ('spaceg', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'title': ('title', <staticmethod(<function IcsdDbImporter._parse_all>)>), 'volume': ('volume', <staticmethod(<function IcsdDbImporter._parse_volume>)>), 'year': ('year', <staticmethod(<function IcsdDbImporter._parse_all>)>)}#
keywords_db = {'a': ['A_LEN', <function IcsdDbImporter._length_clause>], 'alpha': ['ALPHA', <function IcsdDbImporter._angle_clause>], 'authors': ['AUTHORS_TEXT', <function IcsdDbImporter._str_fuzzy_clause>], 'b': ['B_LEN', <function IcsdDbImporter._length_clause>], 'beta': ['BETA', <function IcsdDbImporter._angle_clause>], 'c': ['C_LEN', <function IcsdDbImporter._length_clause>], 'chemical_name': ['CHEM_NAME', <function IcsdDbImporter._str_fuzzy_clause>], 'crystal_system': ['CRYST_SYS_CODE', <function IcsdDbImporter._crystal_system_clause>], 'density': ['DENSITY_CALC', <function IcsdDbImporter._density_clause>], 'element': ['SUM_FORM;', <function IcsdDbImporter._composition_clause>], 'formula': ['SUM_FORM', <function IcsdDbImporter._formula_clause>], 'gamma': ['GAMMA', <function IcsdDbImporter._angle_clause>], 'id': ['COLL_CODE', <function IcsdDbImporter._int_clause>], 'journal': ['journal', <function IcsdDbImporter._str_fuzzy_clause>], 'measurement_temp': ['TEMPERATURE', <function IcsdDbImporter._temperature_clause>], 'molar_mass': ['MOL_MASS', <function IcsdDbImporter._density_clause>], 'number_of_elements': ['EL_COUNT', <function IcsdDbImporter._int_clause>], 'pdf_num': ['PDF_NUM', <function IcsdDbImporter._str_exact_clause>], 'spacegroup': ['SGR', <function IcsdDbImporter._str_exact_clause>], 'title': ['AU_TITLE', <function IcsdDbImporter._str_fuzzy_clause>], 'volume': ['C_VOL', <function IcsdDbImporter._volume_clause>], 'wyckoff': ['WYCK', <function IcsdDbImporter._str_exact_clause>], 'year': ['MPY', <function IcsdDbImporter._int_clause>], 'z': ['Z', <function IcsdDbImporter._int_clause>]}#
length_precision = 0.001#
pressure_precision = 1#
query(**kwargs)[源代码]#

Depending on the db_parameters, the mysql database or the web page are queried. Valid parameters are found using IcsdDbImporter.get_supported_keywords().

参数:

kwargs – A list of ‘’keyword = [values]’’ pairs.

setup_db(**kwargs)[源代码]#

Change the database connection details. At least the host server has to be defined.

参数:

kwargs – db_parameters for the mysql database connection (host, user, passwd, db, port)

temperature_precision = 0.001#
volume_precision = 0.001#
class aiida.tools.dbimporters.plugins.icsd.IcsdEntry(uri, **kwargs)[源代码]#

基类:CifEntry

Represent an entry from Icsd.

Note:
  • Before July 2nd 2015, source[‘id’] contained icsd.IDNUM (internal icsd id number) and source[‘extras’][‘cif_nr’] the cif number (icsd.COLL_CODE).

  • After July 2nd 2015, source[‘id’] has been replaced by the cif number and source[‘extras’][‘idnum’] is icsd.IDNUM .

__annotations__ = {}#
__init__(uri, **kwargs)[源代码]#

Create an instance of IcsdEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
_license: str | None = 'ICSD'#
property contents#

Returns raw contents of a file as string. This overrides the DbEntry implementation because the ICSD php backend returns the contents of the CIF in ISO-8859-1 encoding. However, the PyCifRW library (and most other sensible applications), expects UTF-8. Therefore, we decode the original CIF data to unicode and encode it in the UTF-8 format

get_ase_structure()[源代码]#
返回:

ASE structure corresponding to the cif file.

exception aiida.tools.dbimporters.plugins.icsd.IcsdImporterExp[源代码]#

基类:Exception

Base class for ICSD exceptions.

__annotations__ = {}#
__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
__weakref__#

list of weak references to the object (if defined)

class aiida.tools.dbimporters.plugins.icsd.IcsdSearchResults(query, db_parameters)[源代码]#

基类:DbSearchResults

Result manager for the query performed on ICSD.

参数:
  • query – mysql query or webpage query

  • db_parameters – database parameter setup during the initialisation of the IcsdDbImporter.

__annotations__ = {}#
__init__(query, db_parameters)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
_connect_db()[源代码]#

Connect to the MySQL database for performing searches.

_disconnect_db()[源代码]#

Close connection to the MySQL database.

at(position)[源代码]#

Return position-th result as IcsdEntry.

cif_url = '/index.php?format=cif&action=Export&id%5B%5D={}'#
db_name = 'Icsd'#
next()[源代码]#

Return next result as IcsdEntry.

query_db_version()[源代码]#

Query the version of the icsd database (last row of RELEASE_TAGS).

query_page()[源代码]#

Query the mysql or web page database, depending on the db_parameters. Store the number_of_results, cif file number and the corresponding icsd number.

Additionally, for the mysql case, determine if the origin of the structure is theoretical. This information is stored in the icsd_remarks mysql table. If the crystal has either “THE” or “ZTHE” tags, then it’s classified as theoretical.

Note:

Icsd uses its own number system, different from the CIF file numbers.

property results#

Return the list of results

exception aiida.tools.dbimporters.plugins.icsd.NoResultsWebExp[源代码]#

基类:IcsdImporterExp

Raised when a webpage query returns no results.

__annotations__ = {}#
__module__ = 'aiida.tools.dbimporters.plugins.icsd'#
aiida.tools.dbimporters.plugins.icsd.correct_cif(cif)[源代码]#

Correct the format of the CIF files. At the moment, it only fixes missing quotes in the authors field (ase.read.io only works if the author names are quoted, if not an AssertionError is raised).

参数:

cif – A string containing the content of the CIF file.

返回:

a string containing the corrected CIF file.

“Implementation of DbImporter for the Materials Project database.

class aiida.tools.dbimporters.plugins.materialsproject.MaterialsProjectCifEntry(url, **kwargs)[源代码]#

基类:CifEntry

A Materials Project entry class which extends the DbEntry class with a CifEntry class.

__annotations__ = {}#
__init__(url, **kwargs)[源代码]#

The DbSearchResults base class instantiates a new DbEntry by explicitly passing the url of the entry as an argument. In this case it is the same as the ‘uri’ value that is already contained in the source dictionary so we just copy it

__module__ = 'aiida.tools.dbimporters.plugins.materialsproject'#
_license: str | None = 'Materials Project'#
class aiida.tools.dbimporters.plugins.materialsproject.MaterialsProjectImporter(**kwargs)[源代码]#

基类:DbImporter

Database importer for the Materials Project.

__annotations__ = {}#
__init__(**kwargs)[源代码]#

Instantiate the MaterialsProjectImporter by setting up the Materials API (MAPI) connection details.

__module__ = 'aiida.tools.dbimporters.plugins.materialsproject'#
_find(query, properties)[源代码]#

Query the database with a given dictionary of query parameters

参数:

query – a dictionary with the query parameters

_properties = 'structure'#
_supported_keywords = None#
_verify_api_key()[源代码]#

Verify the supplied API key by issuing a request to Materials Project.

property api_key#

Return the API key configured for the importer

get_supported_keywords()[源代码]#

Returns the list of all supported query keywords

返回:

list of strings

property properties#

Return the properties that will be queried

query(**kwargs)[源代码]#

Query the database with a given dictionary of query parameters for a given properties

参数:
  • query – a dictionary with the query parameters

  • properties – the properties to query

setup_db(**kwargs)[源代码]#

Setup the required parameters to the REST API

class aiida.tools.dbimporters.plugins.materialsproject.MaterialsProjectSearchResults(results, return_class)[源代码]#

基类:DbSearchResults

A collection of MaterialsProjectEntry query result entries.

参数:

results – query result entry dictionary

Return_class:

the class associated with each

__annotations__ = {}#
__init__(results, return_class)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.materialsproject'#
_db_name = 'Materials Project'#
_db_uri = 'https://materialsproject.org'#
_get_source_dict(result_dict)[源代码]#

Return the source information dictionary of an Materials Project query result entry

参数:

result_dict – query result entry dictionary

_get_url(result_dict)[源代码]#

Return the permanent URI of the result entry

参数:

result_dict – query result entry dictionary

_material_base_url = 'https://materialsproject.org/materials/'#
_version = '2024-04-23 09:46:33.320995'#

“Implementation of DbImporter for the MPDS database.

class aiida.tools.dbimporters.plugins.mpds.ApiFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[源代码]#

基类:Enum

CIF = 'cif'#
JSON = 'json'#
__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
class aiida.tools.dbimporters.plugins.mpds.MpdsCifEntry(url, **kwargs)[源代码]#

基类:CifEntry, MpdsEntry

An extension of the MpdsEntry class with the CifEntry class, which will treat the contents property through the URI as a cif file

__annotations__ = {}#
__init__(url, **kwargs)[源代码]#

The DbSearchResults base class instantiates a new DbEntry by explicitly passing the url of the entry as an argument. In this case it is the same as the ‘uri’ value that is already contained in the source dictionary so we just copy it

__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
class aiida.tools.dbimporters.plugins.mpds.MpdsDbImporter(url=None, api_key=None)[源代码]#

基类:DbImporter

Database importer for the Materials Platform for Data Science (MPDS)

__annotations__ = {}#
__init__(url=None, api_key=None)[源代码]#

Instantiate the MpdsDbImporter by setting up the API connection details

参数:
  • url – the full base url of the REST API endpoint

  • api_key – the API key to be used for HTTP requests

__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
_api_key = None#
_collection = 'structures'#
_pagesize = 1000#
_supported_keywords = ['props', 'elements', 'classes', 'lattices', 'formulae', 'sgs', 'protos', 'aeatoms', 'aetype', 'authors', 'codens', 'years']#
_url = 'https://api.mpds.io/v0/download/facet'#
property api_key#

Return the API key configured for the importer

property collection#

Return the collection that will be queried

find(query, fmt=ApiFormat.JSON)[源代码]#

Query the database with a given dictionary of query parameters

参数:

query – a dictionary with the query parameters

get(fmt=ApiFormat.JSON, **kwargs)[源代码]#

Perform a GET request to the REST API using the kwargs as request parameters The url and API key will be used that were set upon construction

参数:
  • fmt – the format of the response, ‘cif’ or json’ (default)

  • kwargs – parameters for the GET request

static get_id_from_cif(cif)[源代码]#

Extract the entry id from the string formatted cif response of the MPDS API

参数:

cif – string representation of the cif file

返回:

entry id of the cif file or None if could not be found

static get_response_content(response, fmt=ApiFormat.JSON)[源代码]#

Analyze the response of an HTTP GET request, verify that the response code is OK and return the json loaded response text

参数:

response – HTTP response

抛出:
property get_supported_keywords#

Returns the list of all supported query keywords

返回:

list of strings

property pagesize#

Return the pagesize set for the importer

query(query, collection=None)[源代码]#

Query the database with a given dictionary of query parameters for a given collection

参数:
  • query – a dictionary with the query parameters

  • collection – the collection to query

setup_db(url=None, api_key=None, collection=None)[源代码]#

Setup the required parameters for HTTP requests to the REST API

参数:
  • url – the full base url of the REST API endpoint

  • api_key – the API key to be used for HTTP requests

property structures#

Access the structures collection in the MPDS

property url#

Return the base url configured for the importer

class aiida.tools.dbimporters.plugins.mpds.MpdsEntry(_, **kwargs)[源代码]#

基类:DbEntry

Represents an MPDS database entry

__annotations__ = {}#
__init__(_, **kwargs)[源代码]#

Set the class license from the source dictionary

__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
class aiida.tools.dbimporters.plugins.mpds.MpdsSearchResults(results, return_class=None)[源代码]#

基类:DbSearchResults

Collection of MpdsEntry query result entries.

__annotations__ = {}#
__init__(results, return_class=None)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
_db_name = 'Materials Platform for Data Science'#
_db_uri = 'https://mpds.io/'#
_get_source_dict(result_dict)[源代码]#

Return the source information dictionary of an MPDS query result entry

参数:

result_dict – query result entry dictionary

_get_url(result_dict)[源代码]#

Return the permanent URI of the result entry

参数:

result_dict – query result entry dictionary

_return_class#

MpdsEntry 的别名

class aiida.tools.dbimporters.plugins.mpds.StructuresCollection(engine)[源代码]#

基类:object

Collection of structures.

__dict__ = mappingproxy({'__module__': 'aiida.tools.dbimporters.plugins.mpds', '__doc__': 'Collection of structures.', '__init__': <function StructuresCollection.__init__>, 'engine': <property object>, 'find': <function StructuresCollection.find>, '__dict__': <attribute '__dict__' of 'StructuresCollection' objects>, '__weakref__': <attribute '__weakref__' of 'StructuresCollection' objects>, '__annotations__': {}})#
__init__(engine)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.mpds'#
__weakref__#

list of weak references to the object (if defined)

property engine#

Return the query engine

find(query, fmt=ApiFormat.JSON)[源代码]#

Query the structures collection with a given dictionary of query parameters

参数:

query – a dictionary with the query parameters

“Implementation of DbImporter for the MPOD database.

class aiida.tools.dbimporters.plugins.mpod.MpodDbImporter(**kwargs)[源代码]#

基类:DbImporter

Database importer for Material Properties Open Database.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.mpod'#
_keywords = {'authors': ['publ_author', <function MpodDbImporter._str_clause>], 'cod_id': ['cod_code', <function MpodDbImporter._str_clause>], 'element': ['element', None], 'formula': ['formula', <function MpodDbImporter._str_clause>], 'phase_name': ['phase_name', <function MpodDbImporter._str_clause>]}#
_str_clause(key, alias, values)[源代码]#

Returns part of HTTP GET query for querying string fields.

get_supported_keywords()[源代码]#

Returns the list of all supported query keywords.

返回:

list of strings

query(**kwargs)[源代码]#

Performs a query on the MPOD database using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.mpod.MpodSearchResults.

query_get(**kwargs)[源代码]#

Forms a HTTP GET query for querying the MPOD database. May return more than one query in case an intersection is needed.

返回:

a list containing strings for HTTP GET statement.

setup_db(query_url=None, **kwargs)[源代码]#

Changes the database connection details.

class aiida.tools.dbimporters.plugins.mpod.MpodEntry(uri, **kwargs)[源代码]#

基类:CifEntry

Represents an entry from MPOD.

__annotations__ = {}#
__init__(uri, **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.mpod.MpodEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.mpod'#
class aiida.tools.dbimporters.plugins.mpod.MpodSearchResults(results)[源代码]#

基类:DbSearchResults

Results of the search, performed on MPOD.

__annotations__ = {}#
__init__(results)[源代码]#
__len__()[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.mpod'#
_base_url = 'http://mpod.cimav.edu.mx/datafiles/'#
_get_source_dict(result_dict)[源代码]#

Returns a dictionary, which is passed as kwargs to the created DbEntry instance, describing the source of the entry.

参数:

result_dict – dictionary, describing an entry in the results.

_get_url(result_dict)[源代码]#

Returns an URL of an entry CIF file.

参数:

result_dict – dictionary, describing an entry in the results.

“Implementation of DbImporter for the NNIN/C database.

class aiida.tools.dbimporters.plugins.nninc.NnincDbImporter(**kwargs)[源代码]#

基类:DbImporter

Database importer for NNIN/C Pseudopotential Virtual Vault.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.nninc'#
_keywords = {'element': ['element', None], 'pseudopotential_class': ['frmspclass', <function NnincDbImporter._str_clause>], 'xc_approximation': ['frmxcprox', <function NnincDbImporter._str_clause>], 'xc_type': ['frmxctype', <function NnincDbImporter._str_clause>]}#
_str_clause(key, alias, values)[源代码]#

Returns part of HTTP GET query for querying string fields.

get_supported_keywords()[源代码]#

Returns the list of all supported query keywords.

返回:

list of strings

query(**kwargs)[源代码]#

Performs a query on the NNIN/C Pseudopotential Virtual Vault using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.nninc.NnincSearchResults.

query_get(**kwargs)[源代码]#

Forms a HTTP GET query for querying the NNIN/C Pseudopotential Virtual Vault.

返回:

a string with HTTP GET statement.

setup_db(query_url=None, **kwargs)[源代码]#

Changes the database connection details.

class aiida.tools.dbimporters.plugins.nninc.NnincEntry(uri, **kwargs)[源代码]#

基类:UpfEntry

Represents an entry from NNIN/C Pseudopotential Virtual Vault.

__annotations__ = {}#
__init__(uri, **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.nninc.NnincEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.nninc'#
class aiida.tools.dbimporters.plugins.nninc.NnincSearchResults(results)[源代码]#

基类:DbSearchResults

Results of the search, performed on NNIN/C Pseudopotential Virtual Vault.

__annotations__ = {}#
__init__(results)[源代码]#
__len__()[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.nninc'#
_base_url = 'http://nninc.cnf.cornell.edu/psp_files/'#
_get_source_dict(result_dict)[源代码]#

Returns a dictionary, which is passed as kwargs to the created DbEntry instance, describing the source of the entry.

参数:

result_dict – dictionary, describing an entry in the results.

_get_url(result_dict)[源代码]#

Returns an URL of an entry CIF file.

参数:

result_dict – dictionary, describing an entry in the results.

“Implementation of DbImporter for the OQMD database.

class aiida.tools.dbimporters.plugins.oqmd.OqmdDbImporter(**kwargs)[源代码]#

基类:DbImporter

Database importer for Open Quantum Materials Database.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.oqmd'#
_keywords = {'element': ['element', None]}#
_str_clause(key, alias, values)[源代码]#

Returns part of HTTP GET query for querying string fields.

get_supported_keywords()[源代码]#

Returns the list of all supported query keywords.

返回:

list of strings

query(**kwargs)[源代码]#

Performs a query on the OQMD database using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.oqmd.OqmdSearchResults.

query_get(**kwargs)[源代码]#

Forms a HTTP GET query for querying the OQMD database.

返回:

a strings for HTTP GET statement.

setup_db(query_url=None, **kwargs)[源代码]#

Changes the database connection details.

class aiida.tools.dbimporters.plugins.oqmd.OqmdEntry(uri, **kwargs)[源代码]#

基类:CifEntry

Represents an entry from OQMD.

__annotations__ = {}#
__init__(uri, **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.oqmd.OqmdEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.oqmd'#
class aiida.tools.dbimporters.plugins.oqmd.OqmdSearchResults(results)[源代码]#

基类:DbSearchResults

Results of the search, performed on OQMD.

__annotations__ = {}#
__init__(results)[源代码]#
__len__()[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.oqmd'#
_base_url = 'http://oqmd.org/materials/export/conventional/cif/'#
_get_source_dict(result_dict)[源代码]#

Returns a dictionary, which is passed as kwargs to the created DbEntry instance, describing the source of the entry.

参数:

result_dict – dictionary, describing an entry in the results.

_get_url(result_dict)[源代码]#

Returns an URL of an entry CIF file.

参数:

result_dict – dictionary, describing an entry in the results.

“Implementation of DbImporter for the PCOD database.

class aiida.tools.dbimporters.plugins.pcod.PcodDbImporter(**kwargs)[源代码]#

基类:CodDbImporter

Database importer for Predicted Crystallography Open Database.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.pcod'#
_keywords = {'a': ['a', <function CodDbImporter._length_clause>], 'alpha': ['alpha', <function CodDbImporter._angle_clause>], 'b': ['b', <function CodDbImporter._length_clause>], 'beta': ['beta', <function CodDbImporter._angle_clause>], 'c': ['c', <function CodDbImporter._length_clause>], 'element': ['element', <function CodDbImporter._composition_clause>], 'formula': ['formula', <function CodDbImporter._formula_clause>], 'gamma': ['gamma', <function CodDbImporter._angle_clause>], 'id': ['file', <function CodDbImporter._int_clause>], 'number_of_elements': ['nel', <function CodDbImporter._int_clause>], 'spacegroup': ['sg', <function CodDbImporter._str_exact_clause>], 'text': ['text', <function CodDbImporter._str_fuzzy_clause>], 'volume': ['vol', <function CodDbImporter._volume_clause>]}#
query(**kwargs)[源代码]#

Performs a query on the PCOD database using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.pcod.PcodSearchResults.

query_sql(**kwargs)[源代码]#

Forms a SQL query for querying the PCOD database using keyword = value pairs, specified in kwargs.

返回:

string containing a SQL statement.

class aiida.tools.dbimporters.plugins.pcod.PcodEntry(uri, db_name='Predicted Crystallography Open Database', db_uri='http://www.crystallography.net/pcod', **kwargs)[源代码]#

基类:CodEntry

Represents an entry from PCOD.

__annotations__ = {}#
__init__(uri, db_name='Predicted Crystallography Open Database', db_uri='http://www.crystallography.net/pcod', **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.pcod.PcodEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.pcod'#
_license: str | None = 'CC0'#
class aiida.tools.dbimporters.plugins.pcod.PcodSearchResults(results)[源代码]#

基类:CodSearchResults

Results of the search, performed on PCOD.

__annotations__ = {}#
__init__(results)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.pcod'#
_base_url = 'http://www.crystallography.net/pcod/cif/'#
_get_url(result_dict)[源代码]#

Returns an URL of an entry CIF file.

参数:

result_dict – dictionary, describing an entry in the results.

“Implementation of DbImporter for the TCOD database.

class aiida.tools.dbimporters.plugins.tcod.TcodDbImporter(**kwargs)[源代码]#

基类:CodDbImporter

Database importer for Theoretical Crystallography Open Database.

__annotations__ = {}#
__init__(**kwargs)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.tcod'#
query(**kwargs)[源代码]#

Performs a query on the TCOD database using keyword = value pairs, specified in kwargs.

返回:

an instance of aiida.tools.dbimporters.plugins.tcod.TcodSearchResults.

class aiida.tools.dbimporters.plugins.tcod.TcodEntry(uri, db_name='Theoretical Crystallography Open Database', db_uri='http://www.crystallography.net/tcod', **kwargs)[源代码]#

基类:CodEntry

Represents an entry from TCOD.

__annotations__ = {}#
__init__(uri, db_name='Theoretical Crystallography Open Database', db_uri='http://www.crystallography.net/tcod', **kwargs)[源代码]#

Creates an instance of aiida.tools.dbimporters.plugins.tcod.TcodEntry, related to the supplied URI.

__module__ = 'aiida.tools.dbimporters.plugins.tcod'#
_license: str | None = 'CC0'#
class aiida.tools.dbimporters.plugins.tcod.TcodSearchResults(results)[源代码]#

基类:CodSearchResults

Results of the search, performed on TCOD.

__annotations__ = {}#
__init__(results)[源代码]#
__module__ = 'aiida.tools.dbimporters.plugins.tcod'#
_base_url = 'http://www.crystallography.net/tcod/'#