In [1]:
from mdf_forge.forge import Forge
In [2]:
mdf = Forge()
If you want to access the raw data underlying entries in MDF, you can use globus_download() and provide the results from search() or aggregate(). You can customize how the data files are delivered by specifying a destination path to dest (default local directory) and/or setting preserve_dir=True if you want to recreate the directory structure of the original data.
In order to use globus_download() to download to your computer, you must be running Globus Connect Personal . If you want to download to a different computer (which must be a Globus Endpoint), you have to specify dest_ep=ID_of_destination_endpoint.
Please note that while almost all data in MDF is accessible through a Globus Endpoint, there may be some entries that are not. A few datasets may be hosted elsewhere and only accessible through HTTP (see http_download()) or hosted elsewhere in a custom, non-programmatic configuration.
In [ ]:
# NBVAL_SKIP
# Running this example will save a file in the current directory.
res = mdf.search("dft.converged:true AND mdf.resource_type:record", limit=10)
mdf.globus_download(res)
In [4]:
# NBVAL_SKIP
# Running this example will save a file in the current directory.
res = mdf.search("mdf.source_name:oqmd* AND mdf.resource_type:record", limit=1)
mdf.http_download(res)
Out[4]:
In [5]:
# NBVAL_SKIP
res = mdf.search("Al", limit=1)
raw_data = mdf.http_stream(res)
next(raw_data)
Out[5]:
In [ ]: