{"id":34434,"date":"2023-05-01T09:19:15","date_gmt":"2023-05-01T13:19:15","guid":{"rendered":"https:\/\/www.aerotech.com\/?p=34434"},"modified":"2023-05-01T15:07:49","modified_gmt":"2023-05-01T19:07:49","slug":"use-the-automation1-python-api-in-a-jupyter-notebook","status":"publish","type":"post","link":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/","title":{"rendered":"Use the Automation1 Python API in a Jupyter Notebook"},"content":{"rendered":"<p><a href=\"https:\/\/www.aerotech.com\/automation1-python-api\/\" target=\"_blank\" rel=\"noreferrer noopener\">Click here<\/a>\u00a0to see a video review of this white paper.<\/p><p>The Automation1 Python API is an incredibly powerful feature that allows users to combine Python\u2019s open-source data analysis tools with Aerotech\u2019s Automation1 motion control platform. Users have access to the features and capabilities of the Aerotech motion controller through Python, without needing to open the Automation1 software. In addition, users can develop custom programs in Python to suit any precision motion need.<\/p><p>The Python API has vast capabilities. To demonstrate how easily the Python API works with Automation1, this paper will focus on performing a simple test using the Python API. It will show how users can connect to an Automation1 controller, move a stage, and collect and process data entirely through a Python script. This exercise assumes that the Automation1-MDK (version 2.4 or newer), Automation1-iSMC (version 2.4 or newer)&nbsp; and Python (version 3.8.10 or newer) are installed on the user&#8217;s workstation. The example provided is written for an arbitrary 3-axis motion system with axes names X, Y and Z. &nbsp; However, the programming example can easily be adjusted to match any system configuration and axes naming convention.<\/p><h2 class=\"wp-block-heading\">Setting Up The Automation1 Python API<\/h2><h3 class=\"wp-block-heading\">Install Python and pip<\/h3><p>Python must be installed on the computer before the Automation1 Python API is installed. The Automation1 Python API is compatible with Python 3.8.10 and newer. Please see <a href=\"https:\/\/www.python.org\/\">Welcome to Python.org<\/a> for instructions on downloading and installing Python.&nbsp;&nbsp;<\/p><p>Note: If installing for the first time, check \u201cAdd Python to PATH\u201d when running the installer. After the installation is complete, run the following lines of code (as an administrator) in the&nbsp; Windows Command Prompt:<\/p><pre class=\"wp-block-code\"><code>\ncurl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py\n\n<\/code><\/pre><p>Followed by<\/p><pre class=\"wp-block-code\"><code>python get-pip.py<\/code><\/pre><p>Verify that pip has been installed correctly using<\/p><pre class=\"wp-block-code\"><code>pip --version<\/code><\/pre><p>which should return the version of pip installed.<\/p><h3 class=\"wp-block-heading\">Install the Automation1 Python API<\/h3><p>The Python API is included as part of Automation1, but it must be installed before it is usable. For details on how to utilize the python API, please see: <a href=\"http:\/\/help.aerotech.com\/automation1\/Content\/APIs\/Python\/Get-Started\/Intro-to-Python.htm\">About the Python API <\/a>.<\/p><p>Note: Before running the pip install, make sure that pip and Python are installed (see above).<\/p><h3 class=\"wp-block-heading\">Install Jupyter Notebook<\/h3><p>The Jupyter Notebook is an open source web application. It can be used to create and share documents that contain live code, equations, visualizations and text. To install Jupyter Notebook, go to <a href=\"https:\/\/jupyter.org\/install\">Project Jupyter | Installing Jupyter<\/a>. Follow the instructions for installing&nbsp; \u201cJupyter Notebook.\u201d<\/p><h3 class=\"wp-block-heading\">Install Other Python Libraries<\/h3><p>Follow the installation instructions on the individual websites for these Python libraries, which will be used alongside the Automation1 Python API in this example:<\/p><ul class=\"wp-block-list\"><li>Python time &#8211; The time module comes with Python\u2019s standard utility module, so there is no need to install it externally. Simply import it using the import statement.<\/li>\n\n<li><a href=\"https:\/\/numpy.org\/install\/\">Installing NumPy<\/a> &#8211; NumPy is the fundamental package for scientific computing in Python. It provides mathematical tools for fast operations on arrays.<\/li>\n\n<li><a href=\"https:\/\/matplotlib.org\/stable\/users\/installing\/index.html\">Installing Matplotlib<\/a> &#8211; Matplotlib is a comprehensive library for creating static, animated and interactive visualizations in Python.<\/li><\/ul><h2 class=\"wp-block-heading\">Using the Automation1 Python API<\/h2><h3 class=\"wp-block-heading\">Open a New Jupyter Notebook<\/h3><p>Running the Windows Command Prompt as an administrator, lunch Jupyter Notebook by issuing the following command:<\/p><pre class=\"wp-block-code\"><code>jupyter notebook<\/code><\/pre><p>Then create a new notebook. Simply click on the New button (upper right) and choose Python 3. The notebook is now created. Import all APIs and Libraries.<\/p><p>Once all APIs and libraries are installed, they need to be imported into the relevant script. Copy and paste the following script into a prompt and run the script:&nbsp;<\/p><pre class=\"wp-block-code\"><code>#The Automation1 API imported as \"a1\"\nimport automation1 as a1\n#Additional modules for demo and data analysis\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt<\/code><\/pre><p>For this script, there is no return. It simply imports the APIs and libraries into the notebook for future reference.<\/p><h3 class=\"wp-block-heading\">Connect to the Local Automation1 Controller<\/h3><p>The connect() method in the Controller() class of the a1 module establishes a connection to an Automation1 controller before any other commands are executed. In addition, a controller must be started using the start() method. The variable, connected_controller, represents an instance of the Controller() class. Copy and paste the following script into a prompt and run the script.&nbsp;<\/p><pre class=\"wp-block-code\"><code>connected_controller = a1.Controller.connect()\nconnected_controller.start()\nprint(connected_controller.is_running)\n<\/code><\/pre><p>For this script, the value \u201cTrue\u201d is returned. You are now connected to the local Automation1 controller and the controller has been started.<\/p><h3 class=\"wp-block-heading\">Configure Data Collection<\/h3><p>When commanding motion, it might be necessary to collect data signals from the Automation1 controller for analysis. To do this, the data collection must first be configured. This can be done by creating a DataCollectionConfiguration object. For this test, that object will be named data_config.<\/p><p>Once a data object name is selected, signals can then be specified for collection within that object. Axis data signals, task data signals and system data signals can all be added to the data configuration. To add an axis data signal, the name of the signal is a required parameter, as is the axis on which to collect the signal.<\/p><p>The frequency and number of data collection points can be configured at a 1, 10, 20, 100 and 200kHz resolution. If you are only running the controller in virtual mode, your data collection might be limited to 1 kHz. Visit the <a href=\"http:\/\/help.aerotech.com\/automation1\/Content\/APIs\/Python\/References\/Data-Collection-Python.htm\">Automation1 Python API help file<\/a> for more information. Copy and paste the following script into a prompt and run the script:&nbsp;<\/p><pre class=\"wp-block-code\"><code>num_points = 1000\nfrequency = a1.DataCollectionFrequency.Frequency1kHz\ndata_config = a1.DataCollectionConfiguration(num_points, frequency)\n#Adding the following signals to be collected on the x-axis\ndata_config.axis.add(a1.AxisDataSignal.PositionCommand, 'X')\ndata_config.axis.add(a1.AxisDataSignal.PositionFeedback, 'X')\ndata_config.axis.add(a1.AxisDataSignal.PositionError, 'X')\n#Adding the time signal from the controller.\ndata_config.system.add(a1.SystemDataSignal.DataCollectionSampleTime)<\/code><\/pre><p>For this script, there is no return value.&nbsp;<\/p><h3 class=\"wp-block-heading\">Command Axis Motion<\/h3><p>Before motion can be commanded on an axis, the axis must be enabled. It is also a good idea to home the axes. Please make sure to verify it is safe to move said stage or device before commanding motion. Multiple axes can be enabled and homed at once if entered as a list.<\/p><p>The move_linear() command is used to move the axis a specified distance. Inputs for this command are an axis, distance and speed. The start() method of the DataCollection class is called when data collection should begin. The get_results() method is used to retrieve data from data collection. The stage is commanded to perform a simple step here while data is being collected. Copy and paste the following script into a prompt and run the script:&nbsp;<\/p><pre class=\"wp-block-code\"><code>#Enable and home the 'X' and 'Y' axes\nconnected_controller.runtime.commands.motion.enable(&#91;'X','Y'])\nconnected_controller.runtime.commands.motion.home(&#91;'X','Y'])\n#Data collection starts before the move \nconnected_controller.runtime.data_collection.start(a1.DataCollectionMode.Snapshot, data_config)\n#Linear move of 10 mm at 200 mm\/s on the x-axis\nconnected_controller.runtime.commands.motion.movelinear('X', &#91;10], 200)\n#Return data after the move has been completed. \nresults = connected_controller.runtime.data_collection.get_results(data_config, num_points)<\/code><\/pre><p>For this script, nothing is returned. However, in Automation1 Studio, as seen in figure 1 below, the X axis has moved to position 10, as commanded.<\/p><figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\" alt=\"\" class=\"wp-image-34436\" width=\"792\" height=\"87\" srcset=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png 792w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1-300x33.png 300w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1-768x84.png 768w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1-600x66.png 600w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1-225x25.png 225w\" sizes=\"(max-width: 792px) 100vw, 792px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Figure 1.<\/strong> A screenshot of the Axis Dashboard from the Automation1 Studio application.<\/em><\/figcaption><\/figure><h3 class=\"wp-block-heading\">Extract and Plot Data<\/h3><p>Any individual signal can be accessed from the results object. The expansive network of Python data analysis tools are now at a user\u2019s disposal. For example, the matplotlib module can be used to plot the collected data.<\/p><pre class=\"wp-block-code\"><code>#Storing the position command, feedback, and error signals collected from the controller into separate numpy arrays\npos_com = np.array(results.axis.get(a1.AxisDataSignal.PositionCommand, 'X').points)\npos_fbk = np.array(results.axis.get(a1.AxisDataSignal.PositionFeedback, 'X').points)\npos_err = np.array(results.axis.get(a1.AxisDataSignal.PositionError, 'X').points)\n\n#Storing the time array collected from the controller\ntime_array = np.array(results.system.get(a1.SystemDataSignal.DataCollectionSampleTime).points)\ntime_array -=time_array&#91;0]\ntime_array *=0.001\n#Plotting the position command and feedback\nfigure_size = (40, 20)\nplt.figure(1, figsize = figure_size)\nfont_size = 30\ntick_size = 18\nplt.plot(time_array, pos_com, linewidth = 10, label = 'PosCmd')\nplt.plot(time_array, pos_fbk, linewidth = 10, linestyle = '--', label = 'PosFbk')\nplt.xlabel('Time (sec)', fontsize = font_size)\nplt.ylabel('PosFbk (X) mm',fontsize = font_size)\nplt.title('Entire Signal',fontsize = font_size)\n\nplt.xticks(fontsize = tick_size)\nplt.yticks(fontsize = tick_size)\nplt.legend(fontsize = font_size)<\/code><\/pre><p>For this script, the following plot (figure 2) is collected. Because this command was run on a virtual (not real) axis of motion, the position feedback (PosFbk) matches the position command (PosCmd) perfectly.<\/p><figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-1024x527.png\" alt=\"\" class=\"wp-image-34440\" width=\"840\" height=\"432\" srcset=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-1024x527.png 1024w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-300x154.png 300w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-768x395.png 768w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-1536x790.png 1536w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-600x309.png 600w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2-225x116.png 225w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-2.png 1600w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Figure 2.<\/strong> A graph using matplotlib\u2019s Pyplot interface. To create this graph, a move is commanded to the Automation1 controller\u2019s X axis. The position command and position feedback are captured over time, and the data signals are shown on this graph.<\/em><\/figcaption><\/figure><p>Additionally, you are able to plot 3D graphs using matplotlib in order to show movement in three dimensions. An example of such a graph is shown below:<\/p><pre class=\"wp-block-code\"><code>#Configure data collection frequency and points\nnum_points = 10000\nfrequency = a1.DataCollectionFrequency.Frequency1kHz\n\ndata_config = a1.DataCollectionConfiguration(num_points, frequency)\n\n#Adding the following signals to be collected on the x-axis\ndata_config.axis.add(a1.AxisDataSignal.PositionCommand, 'X')\ndata_config.axis.add(a1.AxisDataSignal.PositionFeedback, 'X')\ndata_config.axis.add(a1.AxisDataSignal.PositionError, 'X')\n\n#Adding the time signal from the controller.\ndata_config.system.add(a1.SystemDataSignal.DataCollectionSampleTime)\n\n#Adding the following signals to be collected on the y-axis\ndata_config.axis.add(a1.AxisDataSignal.PositionCommand, 'Y')\ndata_config.axis.add(a1.AxisDataSignal.PositionFeedback, 'Y')\ndata_config.axis.add(a1.AxisDataSignal.PositionError, 'Y')\n\n#Adding the following signals to be collected on the z-axis\ndata_config.axis.add(a1.AxisDataSignal.PositionCommand, 'Z')\ndata_config.axis.add(a1.AxisDataSignal.PositionFeedback, 'Z')\ndata_config.axis.add(a1.AxisDataSignal.PositionError, 'Z')\n\n#Enable and home the 'X' , 'Y' , and 'Z' axes\nconnected_controller.runtime.commands.motion.enable(&#91;'X','Y','Z'])\nconnected_controller.runtime.commands.motion.home(&#91;'X','Y','Z'])\n\n#Data collection starts before the move \nconnected_controller.runtime.data_collection.start(a1.DataCollectionMode.Snapshot, data_config)\n\n#Linear move of 10 mm at 200 mm\/s on the x-axis\nconnected_controller.runtime.commands.motion.movelinear('X', &#91;50], 200)\nconnected_controller.runtime.commands.motion.movelinear('Y', &#91;50], 200)\nconnected_controller.runtime.commands.motion.movelinear('Z', &#91;50], 200)\nconnected_controller.runtime.commands.motion.moveabsolute(&#91;'X','Y','Z'], &#91;5,5,5], &#91;200,200,200])\n\n#Return data after the move has been completed. \nresults = connected_controller.runtime.data_collection.get_results(data_config, num_points)\n\nx= np.array(results.axis.get(a1.AxisDataSignal.PositionCommand, 'X').points)\ny= np.array(results.axis.get(a1.AxisDataSignal.PositionCommand, 'Y').points)\nz= np.array(results.axis.get(a1.AxisDataSignal.PositionCommand, 'Z').points)\nfigure = plt.figure()\naxis = figure.add_subplot(111, projection = '3d')\n\nplt.plot(x, y,z)\n\naxis.set_xlabel('X-axis')\naxis.set_ylabel('Y-axis')\naxis.set_zlabel('Z-axis')\n\nplt.show()<\/code><\/pre><p>For this script, the following three dimensional plot (figure 3) is displayed in the Jupyter notebook.<\/p><figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"407\" height=\"398\" src=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-3.png\" alt=\"\" class=\"wp-image-34443\" srcset=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-3.png 407w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-3-300x293.png 300w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-3-225x220.png 225w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Figure 3.<\/strong> A three dimensional graph using matplotlib\u2019s Pyplot interface. To create this graph, moves are commanded to the Automation1 controller\u2019s X, Y and Z axes. The position commands are captured over time and the three dimensional positions are plotted in space, including a line tracing the points, in order, through space.<\/em><\/figcaption><\/figure><p>Note: Motion can be commanded directly from the API, but it can also be commanded by running a pre-scripted motion program. The API call for a compiled AeroScript program that already exists on the controller file system looks like this:<\/p><pre class=\"wp-block-code\"><code>connected_controller.runtime.tasks&#91;int Task].program.run(\"Program_Name.a1exe\") <\/code><\/pre><p>Please see <a href=\"http:\/\/help.aerotech.com\/automation1\/Content\/APIs\/Python\/Get-Started\/Intro-to-Python.htm\">About the Python API<\/a> for more information.<\/p><h3 class=\"wp-block-heading\">Develop A Simple User Interface<\/h3><p>Jupyter Notebook and ipywidgets (an open-source tool available to Python users) can be leveraged to develop a simple front end for data collection scripts. Similar to the libraries imported above, the ipywidgets library needs to be installed on a PC or workstation. A textbox widget can be created to prompt a user to input the desired step size. Next, a button widget can be created to perform the appropriately sized step and plot the results. The rest of the code in this paper can then be placed in a function that runs when the button is clicked.<\/p><p>Users can adjust the step size via the text box and move the stage via the button. A plot of the step can then be output without the user needing to write any additional code.&nbsp; In other words , a user interface can be created.<\/p><pre class=\"wp-block-code\"><code>\nimport ipywidgets as widgets\n\n#Create a textbox widget\ntext_widget = widgets.FloatText(description = 'Step Size:', value = 10)\n\n#Create a button widget\nbutton_widget = widgets.Button(description = 'Run')\n\n#Display widgets\ndisplay(text_widget, button_widget)\n\n#Function to step and plot the results\ndef button_function(b):\n    print('Stepping...')\n    \n    connected_controller = a1.Controller.connect()\n    connected_controller.start()\n    \n    connected_controller.runtime.commands.motion_setup.setupcoordinatedspeed(200)\n    axis = &#91;'X', 'Y']\n    connected_controller.runtime.commands.motion.enable(axis)\n    connected_controller.runtime.commands.motion.home(axis)\n    \n    num_points = 1000\n    frequency = a1.DataCollectionFrequency.Frequency1kHz\n\n    data_config = a1.DataCollectionConfiguration(num_points, frequency)\n\n    #Adding the following signals to be collected on the x-axis\n    data_config.axis.add(a1.AxisDataSignal.PositionCommand, 'X')\n    data_config.axis.add(a1.AxisDataSignal.PositionFeedback, 'X')\n    data_config.axis.add(a1.AxisDataSignal.PositionError, 'X')\n\n    #Adding the time signal from the controller to be connected.\n    data_config.system.add(a1.SystemDataSignal.DataCollectionSampleTime)\n    \n    #Enable and home the 'X' and 'Y' axes\n    connected_controller.runtime.commands.motion.enable(&#91;'X','Y'])\n    connected_controller.runtime.commands.motion.home(&#91;'X','Y'])\n    \n    #Data collection starts before the move \n    connected_controller.runtime.data_collection.start(a1.DataCollectionMode.Snapshot, data_config)\n\n    #Linear move on x-axis at 200 mm\/s, distance is what is typed into text_widget\n    connected_controller.runtime.commands.motion.movelinear('X', &#91;text_widget.value], 200)\n\n    #Return data after the move has been completed. \n    results = connected_controller.runtime.data_collection.get_results(data_config, num_points)\n\n    #Storing the position command, feedback, and error signals collected from the controller into separate numpy arrays\n    pos_com = np.array(results.axis.get(a1.AxisDataSignal.PositionCommand, 'X').points)\n    pos_fbk = np.array(results.axis.get(a1.AxisDataSignal.PositionFeedback, 'X').points)\n    pos_err = np.array(results.axis.get(a1.AxisDataSignal.PositionError, 'X').points)\n\n    #Storing the time array collected from the controller\n    time_array = np.array(results.system.get(a1.SystemDataSignal.DataCollectionSampleTime).points)\n    time_array -=time_array&#91;0]\n    time_array *=0.001\n\n    #Plotting the position command and feedback\n    figure_size = (40, 20)\n    plt.figure(1, figsize = figure_size)\n\n    font_size = 30\n    tick_size = 18\n\n    plt.plot(time_array, pos_com, linewidth = 10, label = 'PosCmd')\n    plt.plot(time_array, pos_fbk, linewidth = 10, linestyle = '--', label = 'PosFbk')\n\n    plt.xlabel('Time (sec)', fontsize = font_size)\n    plt.ylabel('PosFbk (X) mm',fontsize = font_size)\n    plt.title('Entire Signal',fontsize = font_size)\n\n    plt.xticks(fontsize = tick_size)\n    plt.yticks(fontsize = tick_size)\n\n    plt.legend(fontsize = font_size)\n    \n#When button_widget is clicked, run button_function\n\nbutton_widget.on_click(button_function)\n\n<\/code><\/pre><p>For this script, the following user interface (figure 4) is displayed:<\/p><figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"268\" height=\"66\" src=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-4.png\" alt=\"\" class=\"wp-image-34446\" srcset=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-4.png 268w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-4-225x55.png 225w\" sizes=\"(max-width: 268px) 100vw, 268px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Figure 4.&nbsp;<\/strong> A simple user interface is created in Jupyter notebook.<\/em><\/figcaption><\/figure><p>Entering a number (in this case 10) and clicking \u201crun\u201d generates the following (figure 5)&nbsp; in the Jupyter notebook:<\/p><figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"634\" height=\"331\" src=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-5.png\" alt=\"\" class=\"wp-image-34449\" srcset=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-5.png 634w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-5-300x157.png 300w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-5-600x313.png 600w, https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-5-225x117.png 225w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><figcaption class=\"wp-element-caption\"><em><strong>Figure 5. <\/strong>A graph using matplotlib\u2019s Pyplot interface. To create this graph, use the simple user interface shown in figure 4. The position command and position feedback of the X axis&nbsp;are captured over time, and the data signals are displayed on this graph.<\/em><\/figcaption><\/figure><h2 class=\"wp-block-heading\">Summary<\/h2><p>The Python API for Automation1 is an extremely powerful tool for integrating Python data analysis with Automation1 data collection. It can be used to move stages, quickly process data and develop graphical user interfaces. Users can leverage the flexible API to quickly create programs and tools for their own processes.<\/p>","protected":false},"excerpt":{"rendered":"<p>Click here\u00a0to see a video review of this white paper.&hellip;<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","_searchwp_excluded":"","footnotes":""},"categories":[945,958],"tags":[],"content_type":[972],"industry":[],"topic":[987],"class_list":["post-34434","post","type-post","status-publish","format-standard","hentry","category-motion-control-platforms","category-white-paper","content_type-white-paper","topic-motion-control-platforms"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US\" \/>\n<meta property=\"og:description\" content=\"Click here\u00a0to see a video review of this white paper.&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\" \/>\n<meta property=\"og:site_name\" content=\"Aerotech US\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-01T13:19:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-01T19:07:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\" \/>\n<meta name=\"author\" content=\"dwebster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dwebster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\"},\"author\":{\"name\":\"dwebster\",\"@id\":\"https:\/\/www.aerotech.com\/#\/schema\/person\/1c49828c1ca04a5ebdd6101b094ed6b2\"},\"headline\":\"Use the Automation1 Python API in a Jupyter Notebook\",\"datePublished\":\"2023-05-01T13:19:15+00:00\",\"dateModified\":\"2023-05-01T19:07:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\"},\"wordCount\":1580,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.aerotech.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\",\"articleSection\":[\"Motion Control Platforms\",\"White Paper\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\",\"url\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\",\"name\":\"Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US\",\"isPartOf\":{\"@id\":\"https:\/\/www.aerotech.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\",\"datePublished\":\"2023-05-01T13:19:15+00:00\",\"dateModified\":\"2023-05-01T19:07:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage\",\"url\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\",\"contentUrl\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png\",\"width\":792,\"height\":87},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.aerotech.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use the Automation1 Python API in a Jupyter Notebook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.aerotech.com\/#website\",\"url\":\"https:\/\/www.aerotech.com\/\",\"name\":\"Aerotech US\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.aerotech.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.aerotech.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.aerotech.com\/#organization\",\"name\":\"Aerotch Inc\",\"url\":\"https:\/\/www.aerotech.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.aerotech.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2021\/03\/aerotech-logo-new.png\",\"contentUrl\":\"https:\/\/www.aerotech.com\/wp-content\/uploads\/2021\/03\/aerotech-logo-new.png\",\"width\":406,\"height\":120,\"caption\":\"Aerotch Inc\"},\"image\":{\"@id\":\"https:\/\/www.aerotech.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.aerotech.com\/#\/schema\/person\/1c49828c1ca04a5ebdd6101b094ed6b2\",\"name\":\"dwebster\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/","og_locale":"en_US","og_type":"article","og_title":"Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US","og_description":"Click here\u00a0to see a video review of this white paper.&hellip;","og_url":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/","og_site_name":"Aerotech US","article_published_time":"2023-05-01T13:19:15+00:00","article_modified_time":"2023-05-01T19:07:49+00:00","og_image":[{"url":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png","type":"","width":"","height":""}],"author":"dwebster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dwebster","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#article","isPartOf":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/"},"author":{"name":"dwebster","@id":"https:\/\/www.aerotech.com\/#\/schema\/person\/1c49828c1ca04a5ebdd6101b094ed6b2"},"headline":"Use the Automation1 Python API in a Jupyter Notebook","datePublished":"2023-05-01T13:19:15+00:00","dateModified":"2023-05-01T19:07:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/"},"wordCount":1580,"commentCount":0,"publisher":{"@id":"https:\/\/www.aerotech.com\/#organization"},"image":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png","articleSection":["Motion Control Platforms","White Paper"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/","url":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/","name":"Use the Automation1 Python API in a Jupyter Notebook &#8211; Aerotech US","isPartOf":{"@id":"https:\/\/www.aerotech.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage"},"image":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png","datePublished":"2023-05-01T13:19:15+00:00","dateModified":"2023-05-01T19:07:49+00:00","breadcrumb":{"@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#primaryimage","url":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png","contentUrl":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2023\/05\/Python-1.png","width":792,"height":87},{"@type":"BreadcrumbList","@id":"https:\/\/www.aerotech.com\/use-the-automation1-python-api-in-a-jupyter-notebook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.aerotech.com\/"},{"@type":"ListItem","position":2,"name":"Use the Automation1 Python API in a Jupyter Notebook"}]},{"@type":"WebSite","@id":"https:\/\/www.aerotech.com\/#website","url":"https:\/\/www.aerotech.com\/","name":"Aerotech US","description":"","publisher":{"@id":"https:\/\/www.aerotech.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.aerotech.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.aerotech.com\/#organization","name":"Aerotch Inc","url":"https:\/\/www.aerotech.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.aerotech.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2021\/03\/aerotech-logo-new.png","contentUrl":"https:\/\/www.aerotech.com\/wp-content\/uploads\/2021\/03\/aerotech-logo-new.png","width":406,"height":120,"caption":"Aerotch Inc"},"image":{"@id":"https:\/\/www.aerotech.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.aerotech.com\/#\/schema\/person\/1c49828c1ca04a5ebdd6101b094ed6b2","name":"dwebster"}]}},"_links":{"self":[{"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/posts\/34434"}],"collection":[{"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/comments?post=34434"}],"version-history":[{"count":0,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/posts\/34434\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/media?parent=34434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/categories?post=34434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/tags?post=34434"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/content_type?post=34434"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/industry?post=34434"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.aerotech.com\/wp-json\/wp\/v2\/topic?post=34434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}