I am releasing HTTP Request Translator, a tool for converting HTTP requests between formats, such as from a curl command-line invocation to a Python Requests call. This should be useful for automation, penetration testing, and scraping.
It works really well with the Safari Web Inspector to quickly generate code for replaying an XMLHTTPRequest:
If you are translating from something other than curl, you can just capture the raw HTTP request (say, with Wireshark) and the tool can parse that as well.
I wouldn’t say that the tool is complete; it doesn’t know about some basic things right now (such as cookies) and I don’t expect that I’ll ever have a need to support less common curl options such as