def __init__(self, **kwargs): types = kwargs.get('types', '050000') polygon = kwargs.get('polygon', '120.107076,30.326175;120.085948,30.316822;') th = TypeHelper(types) ph = PolygonHelper(polygon) self.types_list = th.to_list() self.polygon = ph.to_str() self.rid = ph.get_hash() + th.get_hash() self.key = 'e444f2d824f09ff1708854c1e66d0e19' self.offset = 20 self.url = 'http://restapi.amap.com/v3/place/polygon' self.lock = threading.Lock()