Python Selector (URL routing library), experience/opinions?

这一生的挚爱 提交于 2019-12-21 09:38:26

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/1864393/python-selector-url-routing-library-experience-opinions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!