The Oslo context library has helpers to maintain useful information about a request context.
conda install conda-forge::oslo.context