Scopes, template filters, and Python APIs