You can use apex_export.get_application to create Apex exports from pl/sql.
This works fine, but as with the
APEXExport java utility,
not everything is exported by default. Most options are set to false by default, so you should check carefully which ones you need.
The
API Reference gives a simple example, but since I always seem to forget how to use apex_t_varchar2 types (having to use apex_string.push just doesn't seem logical somehow), I have included my own one here.