LOS ANGELES — Once upon a time, pumpkin spice lived pretty much only in pies.

That was a long time ago.

These days, it’s a modifier on a list of foods that grows longer each fall: There are pumpkin spice lattes and breakfast cereals, doughnuts and yogurt-coated pretzels, pancakes and candy, even pizza and beer. In fact, in recent years, the number of pumpkin spice-related items introduced in restaurants and supermarkets has doubled, according to Datassentials, a company that tracks menu trends.

Where did it all come from?

The first reference to what we now know as “pumpkin spice” can be traced back to 1796. That’s the year Amelia Simmons published “American Cookery,” regarded as the nation’s first cookbook. In it, she includes a recipe for “pompkin pudding,” a pie made with stewed pumpkin and spiced with ginger and nutmeg.

As Americans moved to urban areas during the Industrial Revolution and sought to maintain a connection with agrarian life, pumpkin pie – and the spices used in it – became an essential slice of Americana.

“It represents a sense of goodness, natural abundance and old values that people think are good,” said Cindy Ott, a scholar and author of “Pumpkin: The Curious History of an American Icon.”

Which is why, perhaps, pumpkin spice lattes bring equal parts devotion and disdain.

“It feels like it goes against these values that aren’t supposed to be commercialized,” Ott said.

The pumpkin occupation already has begun. Dunkin’ Donuts is serving iced pumpkin lattes, doughnuts and muffins. Breweries from Dogfish to Coors are infusing it into beers. And chains like Einstein Bros. Bagels are selling pumpkin-flavored bagels and shmear.

Walk down the grocery aisle and be prepared for a pumpkin spice onslaught, with cookies, M&Ms, marshmallows, granola bars, peanut butter, even pumpkin spice-flavored almonds, Pop-Tarts and pancake mix.

Pumpkin-flavored items went from reaching 6 percent to 14.5 percent of U.S. restaurant menus from 2005 to 2015, according to Datassentials.

National chains and fine dining restaurants are the biggest proponents of pumpkin, and when it comes to geography, the Northeast tops every other region: 19 percent of restaurant menus there featured at least one item.

Pumpkin season is getting earlier each year, too. And we don’t mean the crop. At major chains, nearly 20 percent of all pumpkin food items now are introduced in August, when temperatures in many parts of the country still are sweltering.