This code wraps the user endpoint and media endpoint of Instagram API. Any best practices/ styles or glaring bugs you can see? I wrote some unit tests for each class but did not include for readability Base class: import unirestfrom oauth2 import OAuth2APIclass Client(OAuth2API):     host = http://api.instagram.com     base_path = /v1     header_default = {Accept: application/json}     ACCESS_TOKEN_ONLY = [access_token]def __init__(self, **kwargs):    super(Client, self).__init__(**kwargs)def build_path(self, endpoint):    return self.host + self.base_path + endpointdef build_params(self, params):    return paramsdef build_oauth_params(self, params):    if params == self.ACCESS_TOKEN_ONLY:        return {access_token: self.access_token}    else:        raise NotImplementedError(ouath params {} not implemented.format(params))def parse_request(self, endpoint, accepted_oauth_params, accepted_params):    path = self.build_path(endpoint)    params = self.build_params(accepted_params)    params.update(self.build_oauth_params(accepted_oauth_params))    return path, paramsdef get_request(self, endpoint, accepted_oauth_params, accepted_params):    path, params = self.parse_request(endpoint, accepted_oauth_params, accepted_params)    return unirest.get(path, headers=self.header_default, params=params)User endpoint class:from client import Clientclass User(Client):endpoint_base = /usersdef __init__(self, **kwargs):    super(User, self).__init__(**kwargs)def self(self):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    endpoint = self.endpoint_base + /self    response = self.get_request(endpoint, oauth_params, params)    return responsedef self_recent_media(self, count=None, min_id=None, max_id=None):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    if count:        params.update({count: count})    if min_id:        params.update({mind_id: min_id})    if max_id:        params.update({max_id: max_id})    endpoint = self.endpoint_base + /self/media/recent    response = self.get_request(endpoint, oauth_params, params)    return responsedef user_id(self, user_id):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    endpoint = self.endpoint_base + / + str(user_id)    response = self.get_request(endpoint, oauth_params, params)    return responsedef user_recent_media(self, user_id, count=None, min_id=None, max_id=None):    passdef self_liked(self, count=None, max_like_id=None):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    if count:        params.update({count: count})    if max_like_id:        params.update({max_like_id: max_like_id})    endpoint = self.endpoint_base + /self/media/liked    response = self.get_request(endpoint, oauth_params, params)    return responsedef search(self, query, count=None):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {q: query}    if count:        params.update({count: count})    endpoint = self.endpoint_base + /search    response = self.get_request(endpoint, oauth_params, params)    return responseMedia endpoint classfrom client import Clientclass Media(Client):endpoint_base = /mediadef __init__(self, **kwargs):    super(Media, self).__init__(**kwargs)def media_id(self, media_id):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    endpoint = self.endpoint_base + / + str(media_id)    response = self.get_request(endpoint, oauth_params, params)    return responsedef media_shortcode(self, shortcode):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    endpoint = self.endpoint_base + /shortcode/ + str(shortcode)    response = self.get_request(endpoint, oauth_params, params)    return responsedef media_search(self, latitude=None, longitude=None, distance=1000):    oauth_params = self.ACCESS_TOKEN_ONLY    params = {}    if latitude and longitude:        params.update({lat: latitude, lng: longitude})    if distance != 1000:        params.update({distance: distance})    endpoint = self.endpoint_base + /search    response = self.get_request(endpoint, oauth_params, params)    return response
Python wrapper for Instagram API
python;rest;wrapper;instagram
    params.update({count: count})seems overwrought.  What's wrong with just params[count] = count ?Also, code like:endpoint = self.endpoint_base + / + str(media_id)always makes me wonder if I'm getting the number of slashes correct, so instead I do:import posixpathendpoint = posixpath.join(self.endpoint_base, str(media_id))