Ibn Sharaf al-Qayrawānī (; AD 1000–1067 [AH 390–460]) was an Arab Muslim writer and court poet who served first the Zīrids in Ifrīqiya (Africa) and later various sovereigns in al-Andalus (Spain). He wrote in Arabic. Most of his works have been lost.
Ibn Sharaf, full name Abū ʿAbdallāh Muḥammad ibn Saʿīd ibn Aḥmad Ibn Sharaf al-Judhāmī al-Qayrawānī, was born in al-Qayrawān in AD 1000 (AH 390). He had only one good eye. He learned poetry under Abu ʾl-Ḥasan al-Qābisī and Abū ʿImrān al-Fāsī, grammar under Muḥammad ibn Jaʿfar al-Qazzāz, adab (belles-lettres) under al-Ḥuṣrī and probably astrology under ʿAlī Ibn Abī l-Rijāl. He became a court poet of the Emir al-Muʿizz ibn Bādīs, who is said to have stoked his rivalry with fellow poet Ibn Rashīq. The two poets are known to have exchanged epigrams and epistles, but all are now lost. For al-Muʿizz, Ibn Sharaf composed conventional court poetry (panegyrics on his master, descriptions of flowers and fruits) and participated in literary colloquia.
In 1055 (447), when al-Muʿizz fled al-Qayrawān for al-Mahdiyya in the face of the Hilālī invasion, Ibn Sharaf accompanied him. For a short time he joined the court of al-Muʿizz's son, Tamīm, before moving to Mazara in Kalbid Sicily. There he reconciled with his fellow exile, Ibn Rashīq. In 1057 (449), he moved to al-Andalus. He moved between several mulūk al-ṭawāʾif (factional kingdoms) before settling at Berja in the kingdom of Almería. He died at Seville on 11 November 1067 (1 Muḥarram 460).
Ibn Sharaf had a son, Abu ʾl-Faḍl Jaʿfar ibn Muḥammad, who was also a poet.
Only a few extracts of Ibn Sharaf's writings now remain: some quotations in Ibn Bassām, two fragments from his Aʿlām al-kalām and some verses collected and edited by ʿAbd al-ʿAzīz al-Maymanī al-Rājakūtī in 1924. To this may be added some "historical passages of doubtful authenticity". Aʿlām al-kalām was his masterpiece. Other works know by title include his Lumaḥ al-mulaḥ and Akbār al-afkāar. This last was an anthology of his verse and prose that he himself selected for preservation. Ibn Bassām had access to Ibn Sharaf's dīwān and compared his poetry to that of Ibn Darrāj.
In Aʿlām al-kalām, Ibn Sharaf wrote 20 ḥadīths in imitation of the maqāmāt of al-Hamadhānī. The two surviving ones contain judgement of earlier poets and literary criticism typical of the Qayrawānī school.