Python to JCAMP converter. Inspired by PyToJCAMP.
Some tools work well with the JCAMP format. This package allows converting Python data structures to JCAMP, this can make it easier for Python based web services to interact with the ELN.
To get the latest development version from the head use
pip install git+https://github.com/cheminfo-py/pytojcamp.git
to install the latest stable release use
pip install pytojcamp
See the example notebooks, which you can try out on Binder.
For simple x/y data you can use
from pytojcamp import from_xy
jcamp_string = from_xy((x,y))
For multicolumn data you can use
from pytojcamp import from_dict
data_dictionaries = {
'x' : {
'data': [1,2,3],
'type': 'INDEPENDENT',
'unit': 'cm'
},
'y' : {
'data': [3,2,3],
'type': 'DEPENDENT',
'unit': 'h'
},
'z' : {
'data': [3,2,3],
'type': 'DEPENDENT',
'unit': 'kg'
}
}
jcamp_string = from_dict(data_dictionaries)