skip to navigation
skip to content

Not Logged In

api-proxy 0.1.5

Thin layer to access resources living behind api's

Latest Version: 0.1.3

  • Compliant with django's session authentication and csrf protection.
  • Inspired by django-rest-framework GenericView's enforced url.

Install

pip install api-proxy

Create a login proxy

import api_proxy as proxy

class Login(proxy.BaseProxy):
    url = '/login/'

login = Login()
login.post({'username': 'user', 'password': 'pass'})
print login.result.status_code
print login.result.json()

Create a resource proxy

class UserAccounts(proxy.ResourceProxy):
    url = '/users/'
    detail = '{username}'

users = User(session_source=login)
users.post({'username': 'nedstark', 'password': '123'})
users.rebase(username="nedstark").get()
print users.result.json()
 
File Type Py Version Uploaded on Size
api-proxy-0.1.5.tar.gz (md5) Source 2014-01-23 2KB
  • Downloads (All Versions):
  • 42 downloads in the last day
  • 393 downloads in the last week
  • 1305 downloads in the last month