An early, never-before-published work by crime novelist Raymond Chandler has been discovered in the Library of Congress in Washington.

The 48-page libretto to the comic opera The Princess and the Pedlar, with music by Julian Pascal, has hidden in plain sight at the library since its copyright was first registered on 29 August 1917.

The work, a copy of which was obtained by the Guardian, was found in March by Kim Cooper, shortly after she published her debut novel, The Kept Girl, featuring a fictionalised Chandler in 1929 Los Angeles.

While looking for more information about Pascal, Cooper discovered a missing link between Chandler’s English boyhood and his detective fiction: a witty, Gilbert-and-Sullivan-inflected libretto for a fantasy-tinged romance between Porphyria, daughter to the King and Queen of the Arcadians, and Beautiful Jim, a “strolling Pedlar.”

Chandler penned pithy lines for supporting players, and even foreshadowed his own crime fiction career, as when the humpback Gorboyne sings: “Criminals dyed with the deepest dyes/Hated of all the good and wise, Soaked in crime to the hair and eyes/Very unpleasant are we.”

“Chandler’s motivation had to be pretty serious,” Cooper told the Guardian. “He had been in Los Angeles for only five years, after a bitter departure from London as a failed writer. It’s obvious this libretto was a serious attempt at the writing life in the midst of nowhere, culturally.”

Cooper noted the libretto’s discovery “completely negates” the notion that Chandler gave up being a writer until he was fired in 1931 from Dabney Oil Syndicate, where he was a highly paid executive, due to a mix of alcoholism, affairs with female employees, and absenteeism.

Sybil Davis, who knew Chandler as a young child and whose mother, Jean Fracasse, was romantically involved with the author in his final years, concurred with Cooper’s assessment of the libretto’s importance. Chandler gave Davis a copy of Pedlar, without Pascal’s score, in 1958, when she was 12 years old – one in a series of gifts to Davis and her brother Vincent.

Davis, a retired attorney, “forgot all about” the libretto until she found it five years ago after donating several hundred books from Chandler’s personal library to UCLA. “I thought, ‘Oh, this rang a bell.’ Just the first chorus, ‘You may possibly have heard from some idle little bird’ made me want to start singing Gilbert and Sullivan-style music!”

Cooper and her husband, Richard Schave, local historians in Los Angeles who also operate the Esotouric crime bus tours, set in motion plans for a production of The Princess and the Pedlar. They enlisted Tony Award-winning actor Paul Sand to stage the production, and drafted composer and guitarist Skip Heller as musical director.

“I think [the libretto is] very smart and delightfully satiric, with wonderful glimpses of the no-nonsense writer Mr Chandler was to become,” Sand said.

So far, Raymond Chandler’s estate has blocked Cooper and Schave’s production plans. Ed Victor, the estate’s literary agent, refused permission to perform or publish the libretto because, as he said in an email obtained by the Guardian: “It is a very early work, and not representative of Chandler’s oeuvre. Yes, it is of course a curiosity, but we feel no more than that.” (Victor did not respond to requests for further comment.)

Cooper and Schave were disappointed by the estate’s refusal. “It’s strange they are completely disinclined to share the libretto with the world, and that they believe it’s a curiosity that doesn’t contribute anything. As a Chandler fan, I’d want to know about it,” Cooper said.

The existence of The Princess and the Pedlar also speaks to the prospect of other undiscovered Chandler works lurking in plain sight, according to Tom Williams, author of the biography, Raymond Chandler: A Mysterious Something in the Light.

“I don’t think we’re going to discover a huge cache, but pockets of Chandler material will reappear as people die and attics get cleared,” said Williams, who learned of the libretto’s existence for the first time from the Guardian. “There is always another box of letters out there somewhere.”

Cooper and Schave have launched a website with more information about The Princess and the Pedlar to raise public support for the project.