Best to go to the path-to-py repository where the README is nicely rendered on the front page, but here’s a sneak preview:
Initialise a client with the metadata shown in the appendix at the end of this file. Typically provided by the server in JSON or YAML.>>> from path_to import Application >>> app = Application(...)
Chaining, indexing, following relationships between resources:>>> print app.users['dojo'].edit http://example.com/users/dojo/edit
Positional and named parameters:>>> print app.user_article('dojo', 'foo', format='json') http://example.com/users/dojo/articles/foo.json
I’ve improved the described_routes-py README (not to mention fixing the odd bug) also.
As I hinted in my previous post, I’m taking to Python much more readily than I expected. The Python ports of both path-to and described-routes are much cleaner than their Ruby originals (the benefit of rewriting, not Ruby’s fault), are just as nice to use, and (Rails integration aside) have almost equivalent functionality already. There are some significant differences under the covers but I’ve not yet missed a Ruby feature. In a future post I’ll write up some of the more interesting changes.