views:

367

answers:

2

Does anyone have opinions about or experience with Python Selector? It looks great, but I'm a bit put off by its "Alpha" status on pypi and lack of unit tests.

I mostly like that its simple, self contained, and pure WSGI. All other url routers I've found assume I'm using django, or pylons, or paste, or pull in lots of other dependencies, or just don't let me create a simple mapping of url patterns to wsgi apps. Really, all I want to do is:

mapper.add("/regex/{to}/{resource}", my_wsgi_app)
mapper.add("/another/.*", other_wsgi_app)
...etc...

Anyways, has anyone used it before, or know of projects that have?

+2  A: 

Have you looked at werkzeug.routing? It's hard to find anything that's simpler, more self-contained, or purer-WSGI than Werkzeug, in general -- I'm quite a fan of it!-)

Alex Martelli
Perhaps I'm dense, but how does the Map invoke the wsgi app associated with a rule? From browsing the source, it seems you make rules, add them to a map, then write your own dispatcher for the map.
Richard Levasseur
Yes, in the end you use the `dispatch` method (typically with a `lambda`) to get the handler from the endpoint and call it (http://dev.pocoo.org/projects/werkzeug/wiki/UsingNamedRulesWithWerkzeugRouting has a more elegant proposal;-).
Alex Martelli
+2  A: 

I've used Selector for the last couple years and found it perfectly stable. It's been at 0.8.11 for at least two years now.

I would draw two conclusions from that:

  1. It could be basically unmaintained. If you find a bug in it or need a new feature, I wouldn't count on being able to get Luke Arno to jump up and fix it in a hurry (not saying he wouldn't, but I'm guessing that Selector isn't his main focus these days). Would you be comfortable maintaining a local fork in that case?

  2. It's pretty much complete. The problem that it's trying to solve is contained in scope. It's a very small library without much code. The bugs have been shaken out and there's really nothing left to do on it. I think this is the main reason it hasn't been updated in a long time. It's basically done.

Open source developers, and Python developers in particular, have a long history of being very (probably overly) conservative about marking things as 1.0. The lack of unit tests can be a little off-putting, but again, it's a small library solving a problem with limited scope. The code is short and clear enough to read and convince yourself of its correctness.

thraxil
Thanks, this is what I was hoping to hear!
Richard Levasseur