Customs officers have discovered about six kilograms of cocaine hidden in books among a woman's luggage at Perth Airport after she arrived on a flight from Johannesburg.

The 32-year-old South African woman was charged with attempting to import the cocaine.

The drugs were found when the woman's baggage was examined by Australian Border Force (ABF) officers after her flight landed in Perth on Friday night.

"During the examination, ABF officers detected six packages concealed in six books," the Australian Federal Police (AFP) said.

"Initial testing returned a positive result for the border controlled drug cocaine.

"The exact weight and purity of the cocaine will be subject to further forensic testing.

"The AFP attended and arrested the woman. She was later charged with importing a commercial quantity of a border controlled drug."

The woman is facing a maximum penalty of life imprisonment.

She is due to appear in Perth Magistrate Court.