Iotians

Imitative humanoids of Sigma Iotia II

A highly imitative humanoid people whose entire society was rebuilt around a single Earth book about 1920s Chicago gangsters left behind by a Federation ship.

The Iotians are humanoids native to Sigma Iotia II, a world outside regular Federation traffic. Their defining trait is an extraordinary talent for imitation: they absorb and copy whatever model of society is put in front of them with great speed and thoroughness.
About a century before Kirk's era, the USS Horizon visited the planet before the non-interference directive was in place and left behind several items, among them a book on the Chicago mobs of the 1920s. The Iotians treated it as a blueprint, and by the time the Enterprise arrived the planet was divided into territories run by rival bosses such as Bela Oxmyx and Jojo Krako, complete with tommy guns, hats and slang.
In A Piece of the Action, Kirk, Spock and McCoy are drawn into the bosses' feuds. Kirk ends the chaos by playing the gangster himself, forcing the bosses into a single syndicate with the Federation taking a cut, and invents the card game fizzbin along the way. McCoy accidentally leaves his communicator behind, hinting that the Iotians may next copy Federation technology.