BeanBag is a set of modules that provide some syntactic sugar to make interacting with REST APIs easy and pleasant.
A simple example:
>>> import beanbag # version 1 api >>> github = beanbag.BeanBag("https://api.github.com") >>> watchers = github.repos.ajtowns.beanbag.watchers() >>> for w in watchers: ... print(w["login"])
>>> import beanbag.v2 as beanbag # version 2 api >>> github = beanbag.BeanBag("https://api.github.com") >>> watchers = GET(github.repos.ajtowns.beanbag.watchers) >>> for w in watchers: ... print(w.login)
- beanbag.v2 – REST API access
- beanbag.v1 – Original-style REST API access
- beanbag.auth – Authentication Helpers
- beanbag.attrdict – Access dict members by attribute
- Anthony Towns <firstname.lastname@example.org>
Test case contributors and bug reporters:
BeanBag is inspired by Kadir Pekel’s Hammock, though sadly only shares a license, and not any actual code. Hammock is available from https://github.com/kadirpekel/hammock.