api: add patrun exporting function
Merge pull request #51 from yawnt/fix-export-patrun

api: add patrun exporting function