jarvis.db.restapi ================= .. py:module:: jarvis.db.restapi .. autoapi-nested-parse:: Module to access or upload data in JARVIS-API. Classes ------- .. autoapisummary:: jarvis.db.restapi.Api Functions --------- .. autoapisummary:: jarvis.db.restapi.jarvisdft_optimade Module Contents --------------- .. py:function:: jarvisdft_optimade(prefix='https://jarvis.nist.gov/optimade/jarvisdft/v1/structures/?filter=', query='elements HAS ALL C,Si') .. py:class:: Api(base_url='https://jarvis.nist.gov', user_info_file_path='/users/knc6/myinfo') Bases: :py:obj:`object` Class for handling functions for JARVIS-API. .. py:attribute:: base_url :value: 'https://jarvis.nist.gov' .. py:attribute:: username .. py:attribute:: password .. py:method:: get_data_by_hash_id(id='') Gat data file info for a hash_id. .. py:method:: send_keyword_query(data={'query': 'JVASP-1002.xml', 'title': 'JVASP-1002.xml'}) Post general query to API. .. py:method:: get_global_workspace_id() Get workspace ID. .. py:method:: upload_xml_file(filename='', workspace_id='5df7b6defb7e53000c4652aa', template_id='') Upload file using path of the file and schema/template id. .. py:method:: delete_file_by_hash_id(id='') Delete files for a hash id. .. py:method:: get_all_template_ids(title=None, only_user=False) Get templates for a user or global templates/schema/xsd. .. py:method:: get_all_xmls() Get all XML data. Used for deleting. .. py:method:: delete_chunks(array=[]) Delete a list of records. .. py:method:: get_data_by_template_id(id='5f6162b4ece4b00034e4fe19', query='.xml', max_record=5) Get data by template IDs. For template IDs see: https://jarvis.nist.gov/rest/template-version-manager/global/ and is_disabled=False .. py:method:: delete_all_records(query='.xml') Delete all XML files. .. py:method:: send_query(query='JVASP-1002.xml') Send query to API. .. py:method:: upload_blob(filepath='') Upload binary blob files. .. py:method:: get_all_blobs() Download binary blob files. .. py:method:: download_blob(save_file=True, bid='5f6a4bb7ece4b0002de4fb60') Download a binary blob file. .. py:method:: delete_blob(bid='') Delete a blob by id. .. py:method:: delete_all_blobs() Delete binary blob files. .. py:method:: upload_jarvisff_xmls(files='/rk2/knc6/DB/XMLs/LAMMPS/*.xml', template_id='5f6162b4ece4b00034e4fe19', json_name='jarvisff_xmls.json') Upload JARVIS-FF XML files. .. py:method:: upload_jarvisdft_xmls(files='/rk2/knc6/DB/XMLs/VASPDASK/*.xml', template_id='5f626925ece4b00035e5277f', json_name='jarvisdft_xmls.json') Upload JARVIS-DFT XML files.