There were hundreds of brightly colored houses clinging to a labyrinth of hills in Valparaíso, Chile. The cobblestone streets were a maze. The Andes were in the distance, and the azure Pacific Ocean glittered from beyond.

Taking in the dazzling views from a balcony at the Hotel Palacio Astoreca, my sister, Aditi, and I considered how we should spend our few days in the city, and the list of must-dos was long: several small museums, new art galleries, the historic center that is undergoing an impressive renovation, inviting restaurants and the lively port-side neighborhood.

There were a number of appealing choices during the visit, in early March, but it wasn’t too long ago that the city, which is about 90 minutes northwest of Santiago and has a population of around 300,000, was a gritty metropolis with few of the attractions it offers today.

“At long last, Valparaíso is getting a second life,” said Stephanie Carmody, 30, our guide for the day, who, like all locals, is called a Porteño. “What you see now is nothing like what it once was.”