text: user3061: I would like to extract date of acquisiton from mzXML and mzML files, using Python. Is it possible e.g. with Pyteomics? pymzml is only for mzML files. Are there other libraries that can do that? I assume of course that the date of acquisition is recored in mzXML/mzML files.
  
  user12589: You should be able to extract anything from mzML and mzXML with Pyteomics. You will have to look at your files and figure out what you need to do, though, because you need to know what element contains the information that you want. I don't often work with mzXML and in the files that I have I do not see an acquisition date at all. With mzML it appears that the <run> element has this information:
  <run id="small_raw" defaultInstrumentConfigurationRef="IC1" startTimeStamp="2005-07-20T14:44:22">
  
  So I can get it like this:
  In [1]: from pyteomics import mzml
  
  In [2]: with mzml.MzML('tests/test.mzML') as f:
     ...:     print(next(f.iterfind('run', recursive=False))['startTimeStamp'])
     ...: 
  2005-07-20T14:44:22
  
  P.S. Disclaimer: I am the maintainer of Pyteomics.
  
original_text: 3061: <p>I would like to extract date of acquisiton from mzXML and mzML files, using Python. Is it possible e.g. with <a href="https://pypi.org/project/pyteomics/" rel="nofollow noreferrer">Pyteomics</a>? pymzml is only for mzML files. Are there other libraries that can do that? I assume of course that the date of acquisition is recored in mzXML/mzML files.</p>
   12589: <p>You should be able to extract anything from mzML and mzXML with Pyteomics. You will have to look at your files and figure out what you need to do, though, because you need to know what element contains the information that you want. I don't often work with mzXML and in the files that I have I do not see an acquisition date at all. With mzML it appears that the <code>&lt;run&gt;</code> element has this information:</p>
  <pre><code>&lt;run id=&quot;small_raw&quot; defaultInstrumentConfigurationRef=&quot;IC1&quot; startTimeStamp=&quot;2005-07-20T14:44:22&quot;&gt;
  </code></pre>
  <p>So I can get it like this:</p>
  <pre><code>In [1]: from pyteomics import mzml
  
  In [2]: with mzml.MzML('tests/test.mzML') as f:
     ...:     print(next(f.iterfind('run', recursive=False))['startTimeStamp'])
     ...: 
  2005-07-20T14:44:22
  </code></pre>
  <p>P.S. Disclaimer: I am the maintainer of Pyteomics.</p>
  