One way in which Moroccan Jews expressed their culture and identity was through oral stories and writings, including poems, essays and fiction. Jews were proud of the religious poetry (piyyutim) and supplications (baqashot) written by religious leaders. In Morocco, a few Jewish francophone writers emerged in the twentieth century. However, much of the literature of Moroccan Jews has been written by emigrants and the children of emigrants.
Collections of Oral Stories and Legends

Moroccan Jews, often powerless in real life, expressed their power through supernatural stories and legends. Some of them focus on jinns and spirits that appear in similar tales told by Arab and Amazigh peoples. Many of them are associated with the imagined lives of Jewish saints. Others recount events where Jews prevailed over their Muslim neighbors. Scholars have collected some of these stories. One collection, “Jewish Moroccan Folk Narratives from Israel,” by Haya Bar-Itzhak an Aliza Shenhar, transcribes narratives recounted by Moroccan Jewish immigrants in Judeo-Arabic.
Piyyutim

Moroccan piyyutim and baqashot carry on a poetic tradition over 2,000 years-old that began in Palestine. Andalusian classical music developed in 9th-15th century Spain sometimes accompanies their presentation. Their poetic structure replicates that used by Arabic and Judeo-Spanish piyyutim written in Muslim Spain. While they were mainly in Hebrew, they also used Aramaic, Judeo-Arabic, Hakatia (Judeo-Spanish) and Judeo-Tamazight. They focused on Biblical, Talmudic and Kabbalistic themes, as well as issues of daily life, coexistence, exile and redemption. Many authors of Moroccan piyyutim are regarded as Jewish saints.

from http://kefisrael.com/2015/05/18/un-doumentaire-sur-le-rabbin-david-bouzaglo/
Piyyutim and baqashot are sung by professional religious singers for life-cycle events, Jewish holidays and hiloulot (pilgrimage festivals) as well as for performances by Andalusian orchestras. One of the most famous authors of piyyutim in the 20th century was Rabbi David Buzaglo, who wrote works in Hebrew and Judeo-Arabic on issues such as the establishment of the state of Israel, Jewish-Muslim harmony and the Agadir earthquake of 1960. Some of his piyyut were written with verses alternating in Hebrew and Judeo-Arabic. He was inspired not only by the Andalusian music and poetry brought to Morocco from Spain, but also by the Egyptian musicians Abdel Wahab and Oum Khaltoum. His emigration to Israel in 1965 inspired Moroccan Jews there to take pride in their heritage. The film, “A Song of Loves – R. David Buzaglo,” traces his life.
Jews remaining in Morocco have great respect for piyyutim. Many Moroccan Jews in the diaspora also are learning and performing Moroccan piyyutim as a means of preserving their heritage.
Twentieth Century Moroccan Jewish Writers
Prior to independence, some Jews contributed articles and letters to Moroccan francophone newspapers, such as the pro-Alliance Israelite Universelle paper l’Union Marocaine and the pro-Zionist paper, L’Avenir Illustré. Other Jewish writers, such as Léon Sultan, a Communist Party leader who contributed articles to the Clarté party weekly journal, were leftists committed to the independence movement. The Vichy regime closed down these papers during World War II, and they never were published again.
Writings by Moroccan Jewish Emigrants

Some Moroccan Jewish leaders and academics, such as Jacques Dahan, Robert Assaraf and Simon Levy, published memoirs and commentaries on the role of the Jewish community in the 1980’s-1990’s. It was Moroccan Jewish emigrants who wrote much more about Jewish community of Morocco, however. Leftist exiles in France such as Abraham Serfaty and Edmond Amran El Maleh wrote fiction, memoirs and analyses of the role of Jews in the Moroccan society and political system. Moroccan-French Jewish academics such as Haim Zafrani, Daniel Sibony and Marcel Benabou and Moroccan-North American Jewish academics such as Canadian David Bensoussan and American Ruth Knaffo Setton wrote histories of Moroccan Jewish culture, memoirs and fiction.

Moroccan-Israeli Jews have written the most about Jews in Morocco. Historians such as Joseph Toledano, Shlomo Deshen, Michel Abitbol, and Issachar Ben-Ami have examined different aspects of Moroccan Jewish life and experience from sociological, anthropological and historical perspectives. Moroccan-born Israeli writers of fiction include Gavriel Bensimhon, Haim Shiran, Ami Bouganim, Shelomo Elbaz and Uzziel Hazan. Much of Israeli fiction from Moroccan Jews reflects on the multiple identities of the authors, including Israeli, Moroccan, French, Spanish Jew, Arab or Amazigh as well as the culture of the region they came from in Morocco. It also explores bitter feelings over the obstacles placed on Moroccan Jews to integrating into Israeli society. Whether it is a novel, short story or memoir, writings by Moroccan-born Israeli Jews have a bittersweet image of Morocco. While the culture is remembered fondly, the feeling of not being fully Moroccan before their departure to Israel is remembered sadly. Coexistence among Jews, Arabs and Amazigh in Morocco is celebrated, but also moments of conflict. Moroccan Jews who emigrated to Israel and their descendants appear to have a greater need to examine life in Morocco than those who emigrated to other parts of the world.