MetaXtractor is a Python class designed to extract metadata from various file formats including:
.h5
(HDF5).xrdml
(XRDML XML-based).dm4
(DigitalMicrograph).ibw
(Igor Binary Wave)
pip install -r requirements.txt
from materials.AFM.bandexcitation.h5 import H5
import json
from pprint import pprint
process_file = H5("path/to/file")
metadata = process_file.extract()
print(metadata)
pprint(metadata) # Pretty Print likewise
print(json.dumps(metadata, indent=4)) # Print metadata in JSON format
from materials.Xray.panalytical.xrdml import XRDML
import json
from pprint import pprint
process_file = XRDML("path/to/file")
metadata = process_file.extract()
print(metadata)
pprint(metadata) # Pretty Print likewise
print(json.dumps(metadata, indent=4)) # Print metadata in JSON format
from materials.EM.dm.dm4 import DM4
import json
from pprint import pprint
process_file = DM4("path/to/file")
metadata = process_file.extract()
print(metadata)
pprint(metadata) # Pretty Print likewise
print(json.dumps(metadata, indent=4)) # Print metadata in JSON format
from materials.AFM.oxfordAFM.ibw import IBW
import json
from pprint import pprint
process_file = IBW("path/to/file")
metadata = process_file.extract()
print(metadata)
pprint(metadata) # Pretty Print likewise
print(json.dumps(metadata, indent=4)) # Print metadata in JSON format