Donate to Twisted

Donations are tax-deductible.


Twisted Sponsors

Become a 2011 sponsor today!

Your Logo Here

You can use the form above for both personal donations and corporate sponsorships; for any donation above the Bronze level, we will display your logo here on the front page.




What is Twisted?

Twisted is an event-driven networking engine written in Python and licensed under the open source MIT license.

The Twisted Book

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a urna dui, a egestas lectus. Sed lacinia vestibulum ipsum, eget mattis arcu viverra ut. Nam quis nisi neque, ut mattis turpis. Donec blandit lectus id nunc laoreet pulvinar. In turpis metus, ultricies et mollis vitae, vehicula eget nibh. Proin in lacus id ipsum viverra posuere et sit amet tortor. Nulla pulvinar purus ac enim dapibus et ullamcorper nunc pharetra. Aenean ultricies hendrerit justo ut aliquet.

Easy Custom Servers and Clients

Twisted makes it easy to implement custom network applications, both servers and clients. Here's a TCP server that echoes back everything that's written to it:

from twisted.internet import protocol, reactor

class Echo(protocol.Protocol):
    def dataReceived(self, data):

class EchoFactory(protocol.Factory):
    def buildProtocol(self, addr):
        return Echo()

reactor.listenTCP(1234, EchoFactory())

Learn more about writing servers, writing clients and the core networking libraries, including support for SSL, UDP, scheduled events, unit testing infrastructure, and much more.

Event-Driven Web Applications

Twisted includes an event-driven web server. Here's a sample web application:

from twisted.web import server, resource
from twisted.internet import reactor

class HelloResource(resource.Resource):
    isLeaf = True
    def render_GET(self, request):
        request.setHeader("content-type", "text/plain")
        return "Hello, world!"

reactor.listenTCP(8080, server.Site(HelloResource()))

Learn more about web application development and Twisted's HTTP client.

And Other Protocols

Twisted also supports many common network protocols, including SMTP, POP3, IMAP, SSHv2, and DNS. For more information see our documentation and API reference.

General Information:

More Useful Pointers: