{"action":"created","issue":{"url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/1","repository_url":"https://api.github.com/repos/Carreau/jupytercontrib","labels_url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/1/comments","events_url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/1/events","html_url":"https://github.com/Carreau/jupytercontrib/issues/1","id":145137904,"number":1,"title":"Applying cell magics for multiple cells","user":{"login":"methodds","id":7460499,"avatar_url":"https://avatars.githubusercontent.com/u/7460499?v=3","gravatar_id":"","url":"https://api.github.com/users/methodds","html_url":"https://github.com/methodds","followers_url":"https://api.github.com/users/methodds/followers","following_url":"https://api.github.com/users/methodds/following{/other_user}","gists_url":"https://api.github.com/users/methodds/gists{/gist_id}","starred_url":"https://api.github.com/users/methodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/methodds/subscriptions","organizations_url":"https://api.github.com/users/methodds/orgs","repos_url":"https://api.github.com/users/methodds/repos","events_url":"https://api.github.com/users/methodds/events{/privacy}","received_events_url":"https://api.github.com/users/methodds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-01T09:52:23Z","updated_at":"2016-04-01T18:41:40Z","closed_at":null,"body":"Hi,\r\n\r\nfirst of all sorry for hijacking this issues as kind of a \"feature/possibility request\", but I had problems finding people familiar with jupyter nbextensions and hope that you can help me out.\r\n\r\nCurrently an implementation for using the statistics software Stata within Jupyter Notebooks [is being developed](https://github.com/TiesdeKok/ipystata). The current version uses cell magic ``%%stata`` to communicate with the software.\r\n\r\nMy question related to this: With the new multi-cells selection from 4.1, is it possible to automatically apply cell magic to multiple cells (or even the whole notebook)? If so it would not be necessary to rewrite the cell magic at the beginning of every cell.\r\n\r\nMany thanks and cheers"},"comment":{"url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/comments/204510308","html_url":"https://github.com/Carreau/jupytercontrib/issues/1#issuecomment-204510308","issue_url":"https://api.github.com/repos/Carreau/jupytercontrib/issues/1","id":204510308,"user":{"login":"Carreau","id":335567,"avatar_url":"https://avatars.githubusercontent.com/u/335567?v=3","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T18:41:40Z","updated_at":"2016-04-01T18:41:40Z","body":"Hi @methodds ,\r\n\r\nThanks for the question, feel free to raise it also on the IPython mailing list or one of the main [IPython repository](https://github.com/ipython/ipython) to get more people reading.\r\n\r\nSo technically nothing is impossible, though what you ask seem to brea a lot of abstraction, and would require custom patching of a lots of methods plus would be highly brittle.\r\n\r\n- What if user execute cell out of order ?\r\n- on how many cell does the magic apply ?\r\n- How do you handle magic in non-notebook ?\r\n\r\n\r\nThough, let me try to understand what you want. As far as I can tell from the example notebook, it just seem like writing `%%stata` on each cell is a hassle, but you still need to communicate with Python every now and then. I thus believe that you might be better implementing your own kernel on top of IPython which will **default** to Stata, and use a different syntax (`%python` ??) to switch one cell back to Python.\r\n\r\nSee for example this Stata kernel: \r\n\r\nhttps://github.com/jrfiedler/stata-kernel"}}