{"id":4989,"date":"2023-09-11T21:07:24","date_gmt":"2023-09-12T04:07:24","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=4989"},"modified":"2024-02-01T13:30:09","modified_gmt":"2024-02-01T20:30:09","slug":"python-excel","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/python-excel\/","title":{"rendered":"Python Excel Handling: Your Ultimate Guide"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2023\/09\/Python-interacting-with-Excel-spreadsheet-grid-cells-code-snippets-logo-300x300.jpg\" alt=\"Python interacting with Excel spreadsheet grid cells code snippets logo\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Are you finding it challenging to handle Excel files in Python? You&#8217;re not alone. Many developers find themselves in a similar predicament, but Python, like a skilled accountant, can easily manage Excel files with the help of a few libraries.<\/p>\n<p>Python&#8217;s ability to interact with Excel files extends beyond mere reading and writing. It can manipulate data, apply formulas, and even handle complex operations like working with multiple worksheets. This versatility makes Python a powerful tool for data analysis and manipulation.<\/p>\n<p><strong>In this guide, we&#8217;ll walk you through the process of reading, writing, and manipulating Excel files using Python.<\/strong> We&#8217;ll cover everything from the basics to more advanced techniques, as well as alternative approaches.<\/p>\n<p>So, let&#8217;s dive in and start mastering Excel with Python!<\/p>\n<h2>TL;DR: How Do I Work with Excel Files in Python?<\/h2>\n<blockquote><p>\n  To work with Excel files in Python, you can use the <code>pandas<\/code> library functions such as <code>read_excel()<\/code> and <code>to_excel()<\/code>. It allows you to read and write Excel files with ease. Here&#8217;s a simple example:\n<\/p><\/blockquote>\n<pre><code class=\"language-python line-numbers\">import pandas as pd\n\ndf = pd.read_excel('file.xlsx')\n\ndf.to_excel('output.xlsx')\n\n# Output:\n# An Excel file named 'output.xlsx' is created with the same data as 'file.xlsx'.\n<\/code><\/pre>\n<p>In this example, we import the <code>pandas<\/code> library and use the <code>read_excel<\/code> function to read an Excel file named &#8216;file.xlsx&#8217;. The data from the file is stored in a DataFrame <code>df<\/code>. Then, we use the <code>to_excel<\/code> function to write the data from the DataFrame to a new Excel file named &#8216;output.xlsx&#8217;.<\/p>\n<blockquote><p>\n  This is a basic way to work with Excel files in Python, but there&#8217;s much more to learn about handling Excel files in Python. Continue reading for more detailed information and advanced usage scenarios.\n<\/p><\/blockquote>\n<h2>Getting Started with Python and Excel<\/h2>\n<p>Python&#8217;s <code>pandas<\/code> library is a powerful tool for handling Excel files. It&#8217;s capable of reading and writing Excel files, among other things. Let&#8217;s start with the basics.<\/p>\n<h3>Reading Excel Files with Python<\/h3>\n<p>To read an Excel file in Python, we use the <code>pd.read_excel()<\/code> function. Here&#8217;s a simple example:<\/p>\n<pre><code class=\"language-python line-numbers\">import pandas as pd\n\ndf = pd.read_excel('file.xlsx')\nprint(df)\n\n# Output:\n# Displays the content of the Excel file 'file.xlsx' in the console.\n<\/code><\/pre>\n<p>In this example, we start by importing the <code>pandas<\/code> library. We then use the <code>pd.read_excel()<\/code> function to read the Excel file named &#8216;file.xlsx&#8217;. The content of the file is stored in a <code>pandas<\/code> DataFrame, which we print to the console.<\/p>\n<h3>Writing Excel Files with Python<\/h3>\n<p>Writing to an Excel file is just as straightforward. We use the <code>df.to_excel()<\/code> function, where <code>df<\/code> is the DataFrame containing the data we want to write. Here&#8217;s how it works:<\/p>\n<pre><code class=\"language-python line-numbers\">df.to_excel('output.xlsx')\n\n# Output:\n# Creates a new Excel file named 'output.xlsx' with the data from the DataFrame.\n<\/code><\/pre>\n<p>In this code block, we use the <code>df.to_excel()<\/code> function to write the data from the DataFrame <code>df<\/code> to a new Excel file named &#8216;output.xlsx&#8217;. If the file already exists, it will be overwritten.<\/p>\n<h3>Advantages and Potential Pitfalls<\/h3>\n<p>The <code>pandas<\/code> library makes it simple to read and write Excel files, but there are a few things to keep in mind. The biggest advantage is its simplicity and efficiency. However, when dealing with large files, <code>pandas<\/code> can be slow and consume a lot of memory. Also, it might not handle complex Excel features like formulas or macros.<\/p>\n<h2>Advanced Excel Operations with Python<\/h2>\n<p>As you become more comfortable with handling Excel files in Python, you might find yourself needing to perform more complex operations. This could include managing multiple worksheets, applying formulas, or formatting cells. Let&#8217;s explore these in more detail.<\/p>\n<h3>Handling Multiple Worksheets<\/h3>\n<p>Python&#8217;s <code>pandas<\/code> library can handle multiple worksheets in an Excel file. Here&#8217;s how you can read from and write to multiple worksheets.<\/p>\n<pre><code class=\"language-python line-numbers\">with pd.ExcelWriter('output.xlsx') as writer:\n    df1.to_excel(writer, sheet_name='Sheet1')\n    df2.to_excel(writer, sheet_name='Sheet2')\n\n# Output:\n# Creates an Excel file 'output.xlsx' with two worksheets 'Sheet1' and 'Sheet2'.\n<\/code><\/pre>\n<p>In this example, we use the <code>ExcelWriter<\/code> object from the <code>pandas<\/code> library to create an Excel file named &#8216;output.xlsx&#8217;. We then write two DataFrames (<code>df1<\/code> and <code>df2<\/code>) to separate worksheets named &#8216;Sheet1&#8217; and &#8216;Sheet2&#8217; respectively.<\/p>\n<h3>Applying Formulas<\/h3>\n<p>While <code>pandas<\/code> doesn&#8217;t support Excel formulas directly, we can use the <code>openpyxl<\/code> library to achieve this. Here&#8217;s an example:<\/p>\n<pre><code class=\"language-python line-numbers\">from openpyxl import load_workbook\n\nbook = load_workbook('output.xlsx')\nwriter = pd.ExcelWriter('output.xlsx', engine='openpyxl') \nwriter.book = book\n\ndf.to_excel(writer, index=False, sheet_name='Sheet1')\n\nwriter.sheets['Sheet1']['A1'] = '=SUM(A2:A4)'\nwriter.save()\n\n# Output:\n# Adds a formula to cell A1 in 'Sheet1' of 'output.xlsx' that sums the values in cells A2 to A4.\n<\/code><\/pre>\n<p>In this case, we load the &#8216;output.xlsx&#8217; file using <code>openpyxl<\/code>&#8216;s <code>load_workbook<\/code> function. We then create an <code>ExcelWriter<\/code> object using the &#8216;openpyxl&#8217; engine and write the DataFrame <code>df<\/code> to &#8216;Sheet1&#8217;. Finally, we add a SUM formula to cell A1 that adds the values in cells A2 to A4.<\/p>\n<h3>Formatting Cells<\/h3>\n<p>Again, while <code>pandas<\/code> doesn&#8217;t directly support cell formatting, we can use <code>openpyxl<\/code> for this. Here&#8217;s an example of how to change the font color of a cell:<\/p>\n<pre><code class=\"language-python line-numbers\">from openpyxl.styles import Font, Color\n\nsheet = book.active\n\ncell = sheet['A1']\ncell.font = Font(color='FFFF0000')\n\nbook.save('output.xlsx')\n\n# Output:\n# Changes the font color of cell A1 in 'output.xlsx' to red.\n<\/code><\/pre>\n<p>This code block changes the font color of cell A1 to red. We first access the active worksheet and then the cell we want to format (&#8216;A1&#8217;). We then change the font color of the cell using the <code>Font<\/code> class from <code>openpyxl.styles<\/code>.<\/p>\n<p>These are just a few examples of the advanced operations you can perform when working with Excel files in Python. With these tools at your disposal, you&#8217;ll be able to handle even the most complex Excel tasks with ease.<\/p>\n<h2>Exploring Alternative Libraries for Excel Handling<\/h2>\n<p>While <code>pandas<\/code> is a powerful library for handling Excel files in Python, it&#8217;s not the only option. Other libraries, such as <code>openpyxl<\/code> and <code>xlrd<\/code>, can provide more flexibility or functionality in certain scenarios. Let&#8217;s explore these alternatives.<\/p>\n<h3>The Openpyxl Library<\/h3>\n<p><code>openpyxl<\/code> is another excellent library for working with Excel files. It&#8217;s especially useful when you need to read and write .xlsx files, and it supports more advanced Excel features like charts, images, and even conditional formatting.<\/p>\n<p>Here&#8217;s a simple example of reading an Excel file with <code>openpyxl<\/code>:<\/p>\n<pre><code class=\"language-python line-numbers\">from openpyxl import load_workbook\n\nwb = load_workbook(filename='file.xlsx')\nsheet = wb.active\n\nfor row in sheet.iter_rows(values_only=True):\n    print(row)\n\n# Output:\n# Prints the content of each row in the active worksheet of 'file.xlsx'.\n<\/code><\/pre>\n<p>In this example, we import the <code>load_workbook<\/code> function from <code>openpyxl<\/code>, use it to load &#8216;file.xlsx&#8217;, and then print the contents of each row in the active worksheet.<\/p>\n<h3>The Xlrd Library<\/h3>\n<p><code>xlrd<\/code> is a library for reading data and formatting information from Excel files. While it doesn&#8217;t support writing to Excel files, it&#8217;s very efficient at reading them, and it supports both .xls and .xlsx files.<\/p>\n<p>Here&#8217;s an example of how to read an Excel file with <code>xlrd<\/code>:<\/p>\n<pre><code class=\"language-python line-numbers\">import xlrd\n\nbook = xlrd.open_workbook('file.xlsx')\nsheet = book.sheet_by_index(0)\n\nfor i in range(sheet.nrows):\n    print(sheet.row_values(i))\n\n# Output:\n# Prints the content of each row in the first worksheet of 'file.xlsx'.\n<\/code><\/pre>\n<p>In this code block, we use <code>xlrd<\/code>&#8216;s <code>open_workbook<\/code> function to open &#8216;file.xlsx&#8217; and then print the contents of each row in the first worksheet.<\/p>\n<h3>Choosing the Right Tool<\/h3>\n<p>Each of these libraries has its strengths and weaknesses. <code>pandas<\/code> is powerful and versatile, but it can be slow with large files and doesn&#8217;t support some advanced Excel features. <code>openpyxl<\/code> supports more advanced features and .xlsx files, but it&#8217;s slower than <code>xlrd<\/code> and doesn&#8217;t support .xls files. <code>xlrd<\/code> is fast and supports both .xls and .xlsx files, but it can only read, not write, Excel files.<\/p>\n<p>In the end, the right tool depends on your specific needs. If you&#8217;re just getting started or need to both read and write Excel files, <code>pandas<\/code> is a great choice. If you need to work with advanced Excel features or .xlsx files, consider <code>openpyxl<\/code>. If you need to read large Excel files quickly, <code>xlrd<\/code> might be the best option.<\/p>\n<h2>Troubleshooting Common Python-Excel Issues<\/h2>\n<p>Working with Excel files in Python can sometimes be tricky. Let&#8217;s discuss some common issues you might encounter and how to solve them.<\/p>\n<h3>Handling Large Files<\/h3>\n<p>When dealing with large Excel files, <code>pandas<\/code> can be slow and consume a lot of memory. One solution is to read the file in chunks.<\/p>\n<pre><code class=\"language-python line-numbers\">chunksize = 50000\nchunks = []\n\nfor chunk in pd.read_excel('large_file.xlsx', chunksize=chunksize):\n    chunks.append(chunk)\n\n# Output:\n# Reads 'large_file.xlsx' in chunks of 50,000 rows and stores each chunk in a list.\n<\/code><\/pre>\n<p>This code reads &#8216;large_file.xlsx&#8217; in chunks of 50,000 rows at a time, reducing memory usage.<\/p>\n<h3>Handling Different Data Types<\/h3>\n<p>Excel files can contain different data types (numbers, strings, dates, etc.), which <code>pandas<\/code> might not interpret correctly. One solution is to specify the data type when reading the file.<\/p>\n<pre><code class=\"language-python line-numbers\">import numpy as np\n\ndf = pd.read_excel('file.xlsx', dtype={'column1': np.float64, 'column2': 'string'})\n\n# Output:\n# Reads 'file.xlsx', interpreting the data in 'column1' as float64 and 'column2' as string.\n<\/code><\/pre>\n<p>In this example, we specify that &#8216;column1&#8217; should be interpreted as float64 and &#8216;column2&#8217; as string.<\/p>\n<h3>Other Considerations<\/h3>\n<p>When working with Excel files in Python, you might encounter other issues, such as dealing with missing data or understanding Excel&#8217;s zero-based indexing. It&#8217;s important to read the documentation of the libraries you&#8217;re using and understand the underlying concepts.<\/p>\n<p>Remember, troubleshooting is a normal part of the development process. Don&#8217;t be discouraged by these challenges. With practice and patience, you&#8217;ll be able to handle Excel files in Python with ease.<\/p>\n<h2>Understanding Excel Files and Python<\/h2>\n<p>To effectively work with Excel files in Python, it&#8217;s important to understand their structure and how Python libraries interact with them.<\/p>\n<h3>Excel File Structure<\/h3>\n<p>An Excel file is a binary file that stores data in cells, which are organized into rows and columns. These cells can contain numbers, text, or formulas. The cells are grouped into worksheets, and one Excel file can contain multiple worksheets.<\/p>\n<pre><code class=\"language-python line-numbers\">import pandas as pd\n\n# Load an Excel file\nfile = pd.ExcelFile('file.xlsx')\n\n# Get the names of all worksheets in the file\nprint(file.sheet_names)\n\n# Output:\n# Prints the names of all worksheets in 'file.xlsx'.\n<\/code><\/pre>\n<p>In this example, we use <code>pandas<\/code> to load an Excel file and print the names of all worksheets in the file. This illustrates how an Excel file is structured and how Python can interact with it.<\/p>\n<h3>Interacting with Excel Files in Python<\/h3>\n<p>Python libraries like <code>pandas<\/code>, <code>openpyxl<\/code>, and <code>xlrd<\/code> interact with Excel files by reading their binary data and converting it into a format that Python can understand. For example, <code>pandas<\/code> reads an Excel file and stores its data in a DataFrame, a two-dimensional data structure with rows and columns that&#8217;s very similar to an Excel worksheet.<\/p>\n<pre><code class=\"language-python line-numbers\"># Read an Excel file into a DataFrame\ndf = pd.read_excel('file.xlsx')\n\n# Display the DataFrame\nprint(df)\n\n# Output:\n# Displays the content of 'file.xlsx' as a DataFrame.\n<\/code><\/pre>\n<p>In this code block, we read an Excel file into a DataFrame and print the DataFrame. This shows how Python can convert an Excel file into a format it can work with.<\/p>\n<h3>Underlying Concepts of the Pandas Library<\/h3>\n<p>At the core of <code>pandas<\/code> is the DataFrame, a data structure that&#8217;s designed to handle tabular data, like the data in an Excel file. When <code>pandas<\/code> reads an Excel file, it stores the data in a DataFrame. This allows you to manipulate the data using <code>pandas<\/code>&#8216; powerful data manipulation functions.<\/p>\n<p>For example, you can use <code>pandas<\/code> to calculate the sum of a column, sort the data by a specific column, or filter the data based on certain criteria. Understanding these underlying concepts is key to mastering the handling of Excel files in Python.<\/p>\n<h2>Expanding Your Python-Excel Skills<\/h2>\n<p>Working with Excel files in Python is a valuable skill, but it&#8217;s just the beginning. The real power of Python comes from its vast ecosystem of libraries and its versatility in various fields, including data analysis, machine learning, and more.<\/p>\n<h3>Python and Data Analysis<\/h3>\n<p>Python&#8217;s ability to handle Excel files makes it a powerful tool for data analysis. With Python, you can automate the process of reading and cleaning data, perform complex calculations, and even create visualizations. For example, you could read an Excel file containing sales data, calculate the average sales per month, and then create a bar chart to visualize your results.<\/p>\n<pre><code class=\"language-python line-numbers\">import pandas as pd\nimport matplotlib.pyplot as plt\n\ndf = pd.read_excel('sales_data.xlsx')\n\naverage_sales = df.groupby('Month')['Sales'].mean()\n\naverage_sales.plot(kind='bar')\nplt.show()\n\n# Output:\n# Reads 'sales_data.xlsx', calculates the average sales per month, and displays a bar chart.\n<\/code><\/pre>\n<h3>Python and Machine Learning<\/h3>\n<p>Python&#8217;s ability to handle Excel files also makes it a great tool for machine learning. You can use Python to read and clean your data, perform feature engineering, and then train and evaluate machine learning models. For example, you could read an Excel file containing customer data, engineer features based on the data, and then train a logistic regression model to predict customer churn.<\/p>\n<h3>Exploring Related Concepts<\/h3>\n<p>Beyond handling Excel files, Python offers a wide range of possibilities. You might want to explore related concepts like data visualization with libraries like Matplotlib and Seaborn, or data cleaning with libraries like NumPy and SciPy. Each of these areas adds another tool to your Python toolkit, allowing you to tackle more complex problems and create more powerful solutions.<\/p>\n<h3>Further Resources for Python-Excel Mastery<\/h3>\n<p>To deepen your understanding of handling Excel files in Python, consider exploring these external resources:<\/p>\n<ul>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-json\/\">Python JSON Handling Tips<\/a> &#8211; Discover how to handle large JSON datasets efficiently in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-json-pretty-print\/\">JSON Data Formatting in Python: Pretty Print with json.dumps()<\/a> &#8211; Dive into the world of pretty-printing JSON for improved readability.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/openpyxl\/\">Excel Automation with openpyxl in Python<\/a> &#8211; Discover how to leverage openpyxl for data extraction and reporting in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.python-excel.org\/\" target=\"_blank\" rel=\"noopener\">Working with Excel Files in Python<\/a> &#8211; This website is a comprehensive resource for working with Excel files in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/automatetheboringstuff.com\/2e\/chapter13\/\" target=\"_blank\" rel=\"noopener\">Automate the Boring Stuff with Python<\/a> &#8211; This chapter from Al Sweigart&#8217;s book provides a practical guide to automating Excel tasks with Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/shop.oreilly.com\/product\/0636920023784.do\" target=\"_blank\" rel=\"noopener\">Python for Data Analysis<\/a> &#8211; This book by Wes McKinney, the creator of <code>pandas<\/code>, provides an in-depth look at using Python for data analysis.<\/p>\n<\/li>\n<\/ul>\n<h2>Wrapping Up: Mastering Excel Files with Python<\/h2>\n<p>In this comprehensive guide, we&#8217;ve delved into the world of Python and Excel, exploring how to efficiently manipulate Excel files using Python. We&#8217;ve seen Python&#8217;s capabilities in handling Excel files, from basic reading and writing to more advanced operations, such as handling multiple worksheets and applying formulas.<\/p>\n<p>We began with the basics, learning how to read and write Excel files using the <code>pandas<\/code> library. We then ventured into more advanced territory, exploring complex Excel operations like dealing with multiple worksheets, applying formulas, and formatting cells.<\/p>\n<p>Along the way, we tackled common issues you might encounter when working with Excel files in Python, such as handling large files and different data types, providing you with solutions and workarounds for each issue.<\/p>\n<p>We also looked at alternative approaches to handling Excel files in Python, comparing <code>pandas<\/code> with other libraries like <code>openpyxl<\/code> and <code>xlrd<\/code>. Here&#8217;s a quick comparison of these libraries:<\/p>\n<table>\n<thead>\n<tr>\n<th>Library<\/th>\n<th>Reading and Writing<\/th>\n<th>Advanced Features<\/th>\n<th>Speed<\/th>\n<th>Memory Efficiency<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>pandas<\/td>\n<td>Yes<\/td>\n<td>Limited<\/td>\n<td>Moderate<\/td>\n<td>Low<\/td>\n<\/tr>\n<tr>\n<td>openpyxl<\/td>\n<td>Yes<\/td>\n<td>Yes<\/td>\n<td>Slow<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<tr>\n<td>xlrd<\/td>\n<td>Read Only<\/td>\n<td>Limited<\/td>\n<td>Fast<\/td>\n<td>High<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re just starting out with Python and Excel or you&#8217;re looking to level up your data manipulation skills, we hope this guide has given you a deeper understanding of Python&#8217;s capabilities in handling Excel files.<\/p>\n<p>With its balance of simplicity, power, and versatility, Python is a formidable tool for manipulating Excel files. As you continue your journey with Python and Excel, remember to explore, experiment, and most importantly, have fun. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you finding it challenging to handle Excel files in Python? You&#8217;re not alone. Many developers find themselves in a similar predicament, but Python, like a skilled accountant, can easily manage Excel files with the help of a few libraries. Python&#8217;s ability to interact with Excel files extends beyond mere reading and writing. It can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10483,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121,123],"tags":[],"class_list":["post-4989","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-coding","category-python","cat-121-id","cat-123-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/4989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=4989"}],"version-history":[{"count":6,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/4989\/revisions"}],"predecessor-version":[{"id":16817,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/4989\/revisions\/16817"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/10483"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=4989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=4989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=4989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}