Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A lightweight framework for writing asynchronous network applications in Python.
Python

This branch is 118 commits behind ecdavis:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
docs
pants
.gitignore
AUTHORS.txt
LICENSE.txt
MANIFEST.in
NOTICE.txt
README.md
setup.py

README.md

Pants

Pants is a lightweight framework for writing asynchronous network applications in Python. Pants is simple, fast and very good-looking.

Pants is available under the Apache License, Version 2.0

Install

Pants can be installed using pip:

pip install pants

You can also grab the latest code from the git repository:

git clone git://github.com/ecdavis/pants

Pants requires Python 2.6+ - Python 3 is not yet supported.

Community

Pants has a small but active community of developers who congregate in the IRC channel #pantsmud on irc.freenode.net.

Examples

Here's an absurdly simple example - Hello World:

from pants import engine, Server, Stream

class Hello(Stream):
    def on_connect(self):
        self.write("Hello, World!\r\n")
        self.close()

Server(Hello).listen()
engine.start()

Want a stupidly fast web server? Got you covered:

from pants import engine
from pants.web import Application, HTTPServer

app = Application()

@app.route('/')
def hello(request):
    return "Hello, World!"

HTTPServer(app).listen()
engine.start()
Something went wrong with that request. Please try again.