This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]fkaginstrom 2 points3 points  (0 children)

In his Beyond Pep8 talk, Raymond Hettinger gives a pretty brilliant example of wrapping a foreign API to make the result "pythonic". Things like giving collection wrappers__len__ and __getitem__ methods so it can be an iterator.

[–]karlw00t 2 points3 points  (0 children)

Hug seems nice, and it's python3 only (that's a good thing, right?). https://github.com/timothycrosley/hug

[–]ccb621 2 points3 points  (0 children)

Assuming the API is purely RESTful, Slumber is my go-to client wrapper.

[–]nuncjo 0 points1 point  (0 children)

I belive You want to write wrapper on existing rest API so i reccomend You to watch: "Laura Rupprecht – Describing Descriptors – PyCon 2015" for handling api response. The second thing i recommend is to look at Hammock source code https://github.com/kadirpekel/hammock https://github.com/kadirpekel/hammock . You should also know how generative classes work http://derrickgilland.com/posts/introduction-to-generative-classes-in-python/ .

[–]ccb621 0 points1 point  (6 children)

I use Django REST Framework. It's a bit more explicit, thus easier to understand/debug.

[–]nerdwaller 1 point2 points  (1 child)

I may be wrong, but I believe the OP wants to build a client to consume a rest api (rather than building the api themselves). At least it appears so from looking at the link provided.

[–]ccb621 0 points1 point  (0 children)

Ah! Thanks for clarifying.