Wurflscope is a project mainly written in Python, it's free.
Search the WURFL file to determine mobile device capabilities
Query the WURFL database to find mobile device capabilities.