Code:
import docker cli = docker.from_env() print(cli.containers.get(\'container1\').stats(stream=False)[\'precpu_stats\'])
Output: