jarvis.db.restapi

Module to access or upload data in JARVIS-API.

Module Contents

Classes

Api

Class for handling functions for JARVIS-API.

class jarvis.db.restapi.Api(base_url='https://jarvis.nist.gov', user_info_file_path='/users/knc6/myinfo')[source]

Bases: object

Class for handling functions for JARVIS-API.

get_data_by_hash_id(self, id='')[source]

Gat data file info for a hash_id.

send_keyword_query(self, data={'query': 'JVASP-1002.xml', 'title': 'JVASP-1002.xml'})[source]

Post general query to API.

get_global_workspace_id(self)[source]

Get workspace ID.

upload_xml_file(self, filename='', workspace_id='5df7b6defb7e53000c4652aa', template_id='')[source]

Upload file using path of the file and schema/template id.

delete_file_by_hash_id(self, id='')[source]

Delete files for a hash id.

get_all_template_ids(self, title=None, only_user=False)[source]

Get templates for a user or global templates/schema/xsd.

get_all_xmls(self)[source]

Get all XML data. Used for deleting.

delete_chunks(self, array=[])[source]

Delete a list of records.

get_data_by_template_id(self, id='5f6162b4ece4b00034e4fe19', query='.xml', max_record=5)[source]

Get data by template IDs.

For template IDs see: https://jarvis.nist.gov/rest/template-version-manager/global/ and is_disabled=False

delete_all_records(self, query='.xml')[source]

Delete all XML files.

send_query(self, query='JVASP-1002.xml')[source]

Send query to API.

upload_blob(self, filepath='')[source]

Upload binary blob files.

get_all_blobs(self)[source]

Download binary blob files.

download_blob(self, save_file=True, bid='5f6a4bb7ece4b0002de4fb60')[source]

Download a binary blob file.

delete_blob(self, bid='')[source]

Delete a blob by id.

delete_all_blobs(self)[source]

Delete binary blob files.

upload_jarvisff_xmls(self, files='/rk2/knc6/DB/XMLs/LAMMPS/*.xml', template_id='5f6162b4ece4b00034e4fe19', json_name='jarvisff_xmls.json')[source]

Upload JARVIS-FF XML files.

upload_jarvisdft_xmls(self, files='/rk2/knc6/DB/XMLs/VASPDASK/*.xml', template_id='5f626925ece4b00035e5277f', json_name='jarvisdft_xmls.json')[source]

Upload JARVIS-DFT XML files.