@asyncio.coroutine
def get_house(name, world=None):
    "Returns a dictionary containing a house's info, a list of possible matches or None.\n\n    If world is specified, it will also find the current status of the house in that world."
    c = tibiaDatabase.cursor()
    try:
        c.execute('SELECT * FROM Houses WHERE name LIKE ? ORDER BY LENGTH(name) ASC LIMIT 15', ((('%' + name) + '%'),))
        result = c.fetchall()
        if (len(result) == 0):
            return None
        elif ((result[0]['name'].lower() == name.lower()) or (len(result) == 1)):
            house = result[0]
        else:
            return [x['name'] for x in result]
        if ((world is None) or (world not in tibia_worlds)):
            house['fetch'] = False
            return house
        house['world'] = world
        house['url'] = url_house.format(id=house['id'], world=world)
        tries = 5
        while True:
            try:
                page = (yield from aiohttp.get(house['url']))
                content = (yield from page.text(encoding='ISO-8859-1'))
            except Exception:
                if (tries == 0):
                    log.error("get_house: Couldn't fetch {0} (id {1}) in {2}, network error.".format(house['name'], house['id'], world))
                    house['fetch'] = False
                    break
                else:
                    tries -= 1
                    (yield from asyncio.sleep(network_retry_delay))
                    continue
            try:
                start_index = content.index('"BoxContent"')
                end_index = content.index('</TD></TR></TABLE>')
                content = content[start_index:end_index]
            except ValueError:
                if (tries == 0):
                    log.error("get_house: Couldn't fetch {0} (id {1}) in {2}, network error.".format(house['name'], house['id'], world))
                    house['fetch'] = False
                    break
                else:
                    tries -= 1
                    (yield from asyncio.sleep(network_retry_delay))
                    continue
            house['fetch'] = True
            m = re.search('monthly rent is <B>(\\d+)', content)
            if m:
                house['rent'] = int(m.group(1))
            if ('rented' in content):
                house['status'] = 'rented'
                m = re.search('rented by <A?.+name=([^\\"]+).+e has paid the rent until <B>([^<]+)</B>', content)
                if m:
                    house['owner'] = urllib.parse.unquote_plus(m.group(1))
                    house['until'] = m.group(2).replace('&#160;', ' ')
                if ('move out' in content):
                    house['status'] = 'transferred'
                    m = re.search('will move out on <B>([^<]+)</B> \\(time of daily server save\\) and will pass the house to <A.+name=([^\\"]+).+ for <B>(\\d+) gold', content)
                    if m:
                        house['transfer_date'] = house['until'] = m.group(1).replace('&#160;', ' ')
                        house['transferee'] = urllib.parse.unquote_plus(m.group(2))
                        house['transfer_price'] = int(m.group(3))
            elif ('auctioned' in content):
                house['status'] = 'auctioned'
                if ('. No bid has' in content):
                    house['status'] = 'empty'
                    break
                m = re.search('The auction will end at <B>([^\\<]+)</B>\\. The highest bid so far is <B>(\\d+).+ by .+name=([^\\"]+)\\"', content)
                if m:
                    house['auction_end'] = m.group(1).replace('&#160;', ' ')
                    house['top_bid'] = int(m.group(2))
                    house['top_bidder'] = urllib.parse.unquote_plus(m.group(3))
            break
        return house
    finally:
        c.close()
Returns a dictionary containing a house's info, a list of possible matches or None.

If world is specified, it will also find the current status of the house in that world.
@asyncio.coroutine
def get_house(name, world=None):
    "Returns a dictionary containing a house's info, a list of possible matches or None.\n\n    If world is specified, it will also find the current status of the house in that world."
    c = tibiaDatabase.cursor()
    try:
        c.execute('SELECT * FROM Houses WHERE name LIKE ? ORDER BY LENGTH(name) ASC LIMIT 15', ((('%' + name) + '%'),))
        result = c.fetchall()
        if (len(result) == 0):
            return None
        elif ((result[0]['name'].lower() == name.lower()) or (len(result) == 1)):
            house = result[0]
        else:
            return [x['name'] for x in result]
        if ((world is None) or (world not in tibia_worlds)):
            house['fetch'] = False
            return house
        house['world'] = world
        house['url'] = url_house.format(id=house['id'], world=world)
        tries = 5
        while True:
            try:
                page = (yield from aiohttp.get(house['url']))
                content = (yield from page.text(encoding='ISO-8859-1'))
            except Exception:
                if (tries == 0):
                    log.error("get_house: Couldn't fetch {0} (id {1}) in {2}, network error.".format(house['name'], house['id'], world))
                    house['fetch'] = False
                    break
                else:
                    tries -= 1
                    (yield from asyncio.sleep(network_retry_delay))
                    continue
            try:
                start_index = content.index('"BoxContent"')
                end_index = content.index('</TD></TR></TABLE>')
                content = content[start_index:end_index]
            except ValueError:
                if (tries == 0):
                    log.error("get_house: Couldn't fetch {0} (id {1}) in {2}, network error.".format(house['name'], house['id'], world))
                    house['fetch'] = False
                    break
                else:
                    tries -= 1
                    (yield from asyncio.sleep(network_retry_delay))
                    continue
            house['fetch'] = True
            m = re.search('monthly rent is <B>(\\d+)', content)
            if m:
                house['rent'] = int(m.group(1))
            if ('rented' in content):
                house['status'] = 'rented'
                m = re.search('rented by <A?.+name=([^\\"]+).+e has paid the rent until <B>([^<]+)</B>', content)
                if m:
                    house['owner'] = urllib.parse.unquote_plus(m.group(1))
                    house['until'] = m.group(2).replace('&#160;', ' ')
                if ('move out' in content):
                    house['status'] = 'transferred'
                    m = re.search('will move out on <B>([^<]+)</B> \\(time of daily server save\\) and will pass the house to <A.+name=([^\\"]+).+ for <B>(\\d+) gold', content)
                    if m:
                        house['transfer_date'] = house['until'] = m.group(1).replace('&#160;', ' ')
                        house['transferee'] = urllib.parse.unquote_plus(m.group(2))
                        house['transfer_price'] = int(m.group(3))
            elif ('auctioned' in content):
                house['status'] = 'auctioned'
                if ('. No bid has' in content):
                    house['status'] = 'empty'
                    break
                m = re.search('The auction will end at <B>([^\\<]+)</B>\\. The highest bid so far is <B>(\\d+).+ by .+name=([^\\"]+)\\"', content)
                if m:
                    house['auction_end'] = m.group(1).replace('&#160;', ' ')
                    house['top_bid'] = int(m.group(2))
                    house['top_bidder'] = urllib.parse.unquote_plus(m.group(3))
            break
        return house
    finally:
        c.close()