示例#1
0
    def __init__(self, key, secret, api_version='1.0', host='api.simplegeo.com', port=80):
        self.subclient = True
        ParentClient.__init__(self, key, secret, host=host, port=port)

        self.endpoints.update([
            # Context
            ('context', '1.0/context/%(lat)s,%(lon)s.json'),
            ('context_by_ip', '1.0/context/%(ip)s.json'),
            ('context_by_my_ip', '1.0/context/ip.json'),
            ('context_by_address', '1.0/context/address.json')])
示例#2
0
    def __init__(self, key, secret, **kwargs):
        ParentClient.__init__(self, key, secret, **kwargs)

        self.endpoints.update(
            feature='1.2/places/%(place_id)s.json',
            search='1.2/places/%(lat)s,%(lon)s.json',
            search_text='1.2/places/search.json',
            search_bbox='1.2/places/%(lat_sw)s,%(lon_sw)s,%(lat_ne)s,%(lon_ne)s.json',
            search_by_ip='1.2/places/%(ipaddr)s.json',
            search_by_my_ip='1.2/places/ip.json',
            search_by_address='1.2/places/address.json')
示例#3
0
    def __init__(self, key, secret, api_version='1.0', host='api.simplegeo.com', port=80):
        self.subclient = True
        ParentClient.__init__(self, key, secret, host=host, port=port)

        self.endpoints.update([
            # Places
            ('create', '1.0/places'),
            ('search', '1.0/places/%(lat)s,%(lon)s.json'),
            ('search_by_ip', '1.0/places/%(ipaddr)s.json'),
            ('search_by_my_ip', '1.0/places/ip.json'),
            ('search_by_address', '1.0/places/address.json')])
示例#4
0
    def __init__(self, key, secret, api_version="1.0", **kwargs):
        ParentClient.__init__(self, key, secret, **kwargs)

        context_endpoints = [
            ["context", "/context/%(lat)s,%(lon)s.json"],
            ["context_by_ip", "/context/%(ip)s.json"],
            ["context_by_my_ip", "/context/ip.json"],
            ["context_by_address", "/context/address.json"],
            ["context_from_bbox", "/context/%(sw_lat)s,%(sw_lon)s,%(ne_lat)s,%(ne_lon)s.json"],
        ]

        self.endpoints.update(map(lambda x: (x[0], api_version + x[1]), context_endpoints))
示例#5
0
    def __init__(self, key, secret, api_version='1.0', **kwargs):
        ParentClient.__init__(self, key, secret, **kwargs)

        places_endpoints = [
            ['create', '/places'],
            ['search', '/places/%(lat)s,%(lon)s.json'],
            ['search_by_ip', '/places/%(ipaddr)s.json'],
            ['search_by_my_ip', '/places/ip.json'],
            ['search_by_address', '/places/address.json']
        ]

        self.endpoints.update(map(lambda x: (x[0], api_version+x[1]), places_endpoints))
示例#6
0
    def __init__(self, key, secret, api_version='1.0', **kwargs):
        self.subclient = True
        ParentClient.__init__(self, key, secret, **kwargs)

        context_endpoints = [
            ['context', '/context/%(lat)s,%(lon)s.json'],
            ['context_by_ip', '/context/%(ip)s.json'],
            ['context_by_my_ip', '/context/ip.json'],
            ['context_by_address', '/context/address.json'],
            ['context_from_bbox', '/context/%(sw_lat)s,%(sw_lon)s,%(ne_lat)s,%(ne_lon)s.json']
        ]

        self.endpoints.update(map(lambda x: (x[0], api_version+x[1]), context_endpoints))
示例#7
0
    def __init__(self, key, secret, api_version='0.1', **kwargs):
        ParentClient.__init__(self, key, secret, **kwargs)

        storage_endpoints = [
            ['record', '/records/%(layer)s/%(id)s.json'],
            ['records', '/records/%(layer)s/%(ids)s.json'],
            ['add_records', '/records/%(layer)s.json'],
            ['history', '/records/%(layer)s/%(id)s/history.json'],
            ['nearby', '/records/%(layer)s/nearby/%(arg)s.json'],
            ['layer', '/layers/%(layer)s.json'],
            ['layers', '/layers.json']
        ]

        self.endpoints.update(map(lambda x: (x[0], api_version+x[1]), storage_endpoints))
示例#8
0
    def __init__(self,
                 key,
                 secret,
                 api_version='1.0',
                 host='api.simplegeo.com',
                 port=80):
        self.subclient = True
        ParentClient.__init__(self, key, secret, host=host, port=port)

        self.endpoints.update([
            # Context
            ('context', '1.0/context/%(lat)s,%(lon)s.json'),
            ('context_by_ip', '1.0/context/%(ip)s.json'),
            ('context_by_my_ip', '1.0/context/ip.json'),
            ('context_by_address', '1.0/context/address.json')
        ])
示例#9
0
    def __init__(self,
                 key,
                 secret,
                 api_version='1.0',
                 host='api.simplegeo.com',
                 port=80):
        self.subclient = True
        ParentClient.__init__(self, key, secret, host=host, port=port)

        self.endpoints.update([
            # Places
            ('create', '1.0/places'),
            ('search', '1.0/places/%(lat)s,%(lon)s.json'),
            ('search_by_ip', '1.0/places/%(ipaddr)s.json'),
            ('search_by_my_ip', '1.0/places/ip.json'),
            ('search_by_address', '1.0/places/address.json')
        ])
示例#10
0
    def __init__(self,
                 key,
                 secret,
                 api_version='0.1',
                 host='api.simplegeo.com',
                 port=80):
        self.subclient = True
        ParentClient.__init__(self, key, secret, host=host, port=port)

        self.endpoints.update([
            ('record', '0.1/records/%(layer)s/%(id)s.json'),
            ('records', '0.1/records/%(layer)s/%(ids)s.json'),
            ('add_records', '0.1/records/%(layer)s.json'),
            ('history', '0.1/records/%(layer)s/%(id)s/history.json'),
            ('nearby', '0.1/records/%(layer)s/nearby/%(arg)s.json'),
            ('layer', '0.1/layers/%(layer)s.json'),
            ('layers', '0.1/layers.json')
        ])