Python text extractor