I need to rewrite some Perl code in python. So I’m looking for the closest modules to what I’m using now in Perl (i.e. with similar functionality and stability):
- DBI + DBD::mysql
- LWP::UserAgent
- WWW::Mechanize
- XML::LibXML
- HTML::TreeBuilder
- CGI::FormBuilder
- Template::Toolkit
What are the Python equivalents to these?
MySQLdboroursqlwill work.urllib2mechanizeetreeorlxmlBeautifulSoupandlxmlcan parse, andetreeandlxmlcan generate.FormEncodeGenshi,Jinja2,mako,cheetah, and too many othersurllib2andetreeare in the standard library; the rest are easy enough to get.