Resource contexts

Up to date implementation of the Python client lib by @bc-jackiehuynh.