def tp(path, method="GET", body=None, headers=None): c = TypePadClient() c.add_credentials(CONSUMER, ACCESS_TOKEN, domain="api.typepad.com") req = c.request(_get_url(path), method=method, body=body, headers=headers)[1] return json.loads(req)
The `typepad` package contains `RemoteObject` implementations for TypePad's content objects and an OAuth client for making authenticated requests to the API. """ __version__ = '2.0' __date__ = '8 July 2010' __author__ = 'Six Apart Ltd.' __credits__ = """Brad Choate Leah Culver Mark Paschal""" from remoteobjects import RemoteObject, ListObject from typepad.tpclient import TypePadClient, OAuthClient, ThreadAwareTypePadClientProxy client_factory = lambda: TypePadClient() """Python callable that will prep and assign a typepad.client instance.""" client = ThreadAwareTypePadClientProxy() """A user agent instance for making TypePad API requests.""" from typepad.tpobject import * from typepad import fields from typepad.api import *
def me(): c = TypePadClient() c.add_credentials(CONSUMER, ACCESS_TOKEN, domain="api.typepad.com") req = c.request(_get_url('/users/@self.json'))[1] return json.loads(req)