There are some options, free of charge, available on the web for handling EDI messages.
Bots [Open source EDI translator] If you have python skills that's just what you need ! Bots is an open source project with a very active support forum /group behind. Bots supports edifact, x12, tradacoms, xml and has powerful mapping and conversion features. Here the official site.
EDI Notepad [EDI building/editing/validation] EDI Notepad allows you to view EDI transactions in multiple ways, including intuitive, HTML, edit and text view. Furthermore you can create, edit, validate and also generate a functional acknowledgments for any EDI envelope opened in its interface. You can download it here (registration required).
EDIFACT Viewer [EDI view/export] EDIFACT Viewer allows to view, in a very intuitive interface, the contents of a bunch of EDI messages. Furthermore you can export EDI in an HTML or XLS format in case you need to manipulate its contents. You can download it here (no registration required).
That's the three top free application that I really would recommend to handle EDI.
In case you are not looking for applications but just for a "library" (eg. a framework) I know that there is a free project hosted on Sourceforge here. It's a "Frameworx Open License" but it's still in Alpha...