Ruby has this very nice gem that allows redirecting all network traffic trough a SOCKS proxy
require 'socksify'
TCPSocket::socks_server = "127.0.0.1"
TCPSocket::socks_port = 9050
rubyforge_www = TCPSocket.new("rubyforge.org", 80)
# => #<TCPSocket:0x...>
Is there any python equivalent?