Michael Palin has donated personal diaries, annotated scripts and 'Python notebooks' to the British Library.