This project consists of a single module which is extracted from the ideas package. Its purpose is to simplify manipulations of tokens from Python's tokenize module. One of its features is that, unlike Python's version, the following is always guaranteed:
from token_utils import tokenize, untokenize
source = "Arbitrary Python code here"
assert source == untokenize(tokenize(source))
See ideas documentation for more information