Python Selector (URL routing library), experience/

2019-03-27 06:27发布

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条回答
来,给爷笑一个
2楼-- · 2019-03-27 07:01

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!-)

查看更多
一夜七次
3楼-- · 2019-03-27 07:05

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.

查看更多
登录 后发表回答