Accessing Ansible magic variables in python

Hello

How can I access Ansible magic variables like {{ playbook_dir }} in the python source code ? can someone please help with a code snippet?

Thank you

I might have better luck asking this question in the Anisble developer list.