by Paradigmatic http://github.com/paradigmatic/SwissParser
Simple DSL to define parser for flat files formats common in biofinformatics, such as Swissprot, Uniprot, KEGG, TREMBL, etc.
SwissParser API was changed in its version 1.0.0 to simplify parser definition. The code was tested on entire Uniprot and KEGG releases and functional testing guarantees that existing features will not break after an update.
The 1.x versions represent an API change which is not backward compatible. However, the rules definitions and helper need small changes. A wiki page will soon give instructions for updating your parsers.
Defines parsers with a clear and compact declarative syntax.
The whole parsing workflow is configurable.
Able to parse remote files accessible from a web or an FTP server.
Users can create new parsers by extending existing parsers.
Parser rules have access to user defined helper methods.
SwissParser uses only pure standard ruby.
Thanks to rvm it was successfuly tested with versions:
* ruby-1.8.7-p302 * ruby-1.9.2-p136 * jruby-1.5.2
No other gems are required to use it. However, if you want to participate in SwissParser developpement, you will need the gem bones, rspec and cucumber.
Then you can simply install SwissParser with:
gem install swissparser
and start parsers definitions by requiring it:
Alternatively, you can download the whole source tree or just the swissparser.rb file using the github site:
Finally, if you want to participate in the development or use the edge version you can clone the project with git:
$ git clone git://github.com/paradigmatic/SwissParser
Free and open software distributed under GPLv3.
See the included LICENSE file for details.