That was the problem I wanted to solve when I started to work on pacparser. Now it's ready in full glory - http://code.google.com/p/pacparser. From the release announcement:
I am very pleased to announce the release of "pacparser" - a C library to parse proxy auto-config (PAC) scripts. Needless to say, PAC files are now a widely accepted method for proxy configuration management and almost all popular browsers support them. The idea behind pacparser is to make it easy to add this PAC file parsing capability to other programs. It comes as a shared C library with a clear API. You can use it to make any C or python (using ctypes) program PAC scripts intelligent. Some very useful targets could be popular web software like wget, curl and python-urllib.
For documentation and available packages, please visit project home page at:
http://code.google.com/p/pacparser
For the ones who like to start with source code, here is the link to direct download for source code:
http://pacparser.googlecode.com/files/pacparser-1.0.1.tar.gz.
I hope you will find some use for it. Anyway, let me know how your find it :-)
Cheers :-),
Manu
Update: For easy installation on Ubuntu boxes, I have created debs for Ubuntu gutsy for i386 and amd64 platforms. These debs can be downloaded from here:
http://code.google.com/p/pacparser/downloads/list
---
Manu Garg/http://www.manugarg.com/"Journey is the destination of life"