<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - Denisa Checiu</title><link href="https://jasongrout.github.io/medium-archive/pelican/" rel="alternate"/><link href="https://jasongrout.github.io/medium-archive/pelican/feeds/author-denisa-checiu.atom.xml" rel="self"/><id>https://jasongrout.github.io/medium-archive/pelican/</id><updated>2022-07-29T13:12:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>Visual programming in JupyterLab with Blockly</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/" rel="alternate"/><published>2022-07-29T13:12:00+00:00</published><updated>2022-07-29T13:12:00+00:00</updated><author><name>Denisa Checiu</name></author><id>tag:jasongrout.github.io,2022-07-29:/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/</id><summary type="html">&lt;p&gt;Block-based programming has become ubiquitous in school curricula for early computer science education. It is an excellent means to teach…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Block-based programming has become ubiquitous in school curricula for early computer science education. It is an excellent means to teach basic programming concepts without having to deal with the specific syntax of a text-based programming language.&lt;/p&gt;
&lt;p&gt;When moving from block-based programming to a more classical language like Python, students often have to switch to a completely new environment. In order to provide a smooth ramp of complexity for learners, we designed a JupyterLab extension for Blockly so that Jupyter can be used from the very first steps of their learning journey. We also used Blockly’s code generation feature to create a more integrated experience with Jupyter.&lt;/p&gt;
&lt;h2 id="but-what-exactly-is-blockly"&gt;&lt;strong&gt;But what exactly is Blockly?&lt;/strong&gt;&lt;/h2&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of the JupyterLab-Blockly extension, running a simple code" src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/images/001-0_yEQ8djozBKDLcCxZ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The JupyterLab-Blockly extension, running a simple loop, and the corresponding Python code in a cell.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;a href="https://developers.google.com/blockly"&gt;Blockly&lt;/a&gt; is an open source library designed by &lt;a href="https://twitter.com/GoogleOSS"&gt;Google&lt;/a&gt; to make coding easier and more accessible through block-based visual programming. It uses interlocking graphical blocks to represent coding concepts, while giving the user full creative freedom, it removes all language specific syntax requirements.&lt;/p&gt;
&lt;h2 id="getting-started-installing-the-blockly-extension"&gt;&lt;strong&gt;Getting started: installing the Blockly extension&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;To install the extension, you just need to execute the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mamba install -c conda-forge jupyterlab-blockly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Once installed, you can easily open a Blockly editor directly from the launcher, and start experimenting!&lt;/p&gt;
&lt;h2 id="features"&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The UI is made primarily of the toolbox located on the left side and the canvas where you can drag and drop the blocks you want to use in your code. When you are ready, just click the run button and see how the syntactically correct converted code appears on the bottom part of your screen in the programming language of your choice along with the output!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Short demo on how to use the JupyterLab-Blockly extension" src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/images/002-0_69P-HcYWrtriGmS-.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Short demo for the JupyterLab-Blockly extension&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The extension is also prepared to adapt to all your needs. The workspace is ready to generate the blocks using your selected JupyterLab kernel and modify its colors based on your individual theme, whether it’s dark, light or personalized.&lt;/p&gt;
&lt;p&gt;JupyterLab-Blockly integrates smoothly with the rest of the Jupyter stack: by using Jupyter kernels to execute the generated code, by reusing the JupyterLab code cell component to display the generated code, etc.&lt;/p&gt;
&lt;p&gt;In doing so, JupyterLab-Blockly remains consistent with the rest of the UI (consistent syntax highlighting, theming, and life cycle of Jupyter kernels).&lt;/p&gt;
&lt;h2 id="robotics-education"&gt;&lt;strong&gt;Robotics education&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;On top of JupyterLab-Blockly, we also built another extension dedicated to operating robots with the help of visual programming — more specifically, we created a toolbox which includes the blocks necessary to control the &lt;a href="https://niryo.com/fr/product/niryo-one/"&gt;Niryo One&lt;/a&gt; robot. Using ROS can be a time consuming task, but the pre-built visual blocks make it easier to experiment and faster to produce a prototype for any project you have in mind.&lt;/p&gt;
&lt;p&gt;To install this extension you need to execute the following commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mamba install -c conda-forge jupyterlab-niryo-one
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, all you need to do is switch from the &lt;em&gt;‘default’&lt;/em&gt; toolbox to the &lt;em&gt;‘niryo’&lt;/em&gt; one, and you will immediately gain access to forty-two new blocks, so if you have access to one of these robots, give it a try!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Demo on how to use the JupyterLab-NiryoOne extension" src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/images/003-0_KSNrd_DXpVWHkvPC.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Short demo for the JupyterLab-NiryoOne extension&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Both extensions can be found on GitHub. The &lt;a href="https://github.com/QuantStack/jupyterlab-blockly"&gt;JupyterLab-Blockly&lt;/a&gt; extension is ready to be used as a base for other projects; you can register new blocks, toolboxes and generators. Taking the &lt;a href="https://github.com/QuantStack/jupyterlab_niryo_one"&gt;JupyterLab-Niryo-One&lt;/a&gt; extension as an example, feel free to experiment on your own!&lt;/p&gt;
&lt;figure&gt;
&lt;iframe src="https://www.youtube-nocookie.com/embed/41GoTIljCug" title="Demo JupyterLab-Niryo-One with Blockly" width="560" height="315" style="aspect-ratio: 560 / 315" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen&gt;&lt;/iframe&gt;
&lt;figcaption&gt;
&lt;p&gt;Controlling the Niryo-one robot with the JupyterLab-blockly extension.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;You can also try out the JupyterLab-Blockly extension now, directly from your browser, using JupyterLite! Just click on the &lt;a href="https://jupyterlab-blockly.readthedocs.io/en/latest/lite/lab/index.html?path=example.jpblockly"&gt;link&lt;/a&gt; below.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyterlab-blockly.readthedocs.io/en/latest/lite/lab/index.html?path=example.jpblockly"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/visual-programming-in-jupyterlab-with-blockly/images/004-0_Z2TP8VlU-j14Taxo.webp" alt="Link to JupyterLite for the JupyterLab-Blockly extension" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;&lt;strong&gt;About the authors&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/DenisaCheciu"&gt;&lt;strong&gt;Denisa Checiu&lt;/strong&gt;&lt;/a&gt; is a Robotics working student at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;. She is also currently pursuing her bachelor’s degree, majoring in Robotics and Intelligent Systems and minoring in Computer Science.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/carlosherrerob"&gt;&lt;strong&gt;Carlos Herrero&lt;/strong&gt;&lt;/a&gt; is a scientific software developer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; passionate about AI and its applications to robotics. His current work focuses on the JupyterLab stack and expanding the &lt;a href="https://jupyter.org/"&gt;Jupyter ecosystem&lt;/a&gt; by developing new extensions to integrate &lt;a href="https://www.ros.org/"&gt;ROS&lt;/a&gt; in JupyterLab and also contributing to &lt;a href="https://github.com/voila-dashboards/voila"&gt;Voilà&lt;/a&gt;.&lt;/p&gt;
</content><category term="extensions"/><category term="JupyterLab"/></entry></feed>