{"id":4806,"date":"2023-09-07T23:37:00","date_gmt":"2023-09-08T06:37:00","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=4806"},"modified":"2024-01-30T07:08:49","modified_gmt":"2024-01-30T14:08:49","slug":"python-debugger","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/python-debugger\/","title":{"rendered":"Python Debugger: Comprehensive 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\/Debugging-in-Python-breakpoints-code-inspection-bug-icons-magnifying-glasses-300x300.jpg\" alt=\"Debugging in Python breakpoints code inspection bug icons magnifying glasses\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Ever felt like you&#8217;re lost in a maze while debugging your Python code? You&#8217;re not alone. Many developers find themselves in a similar predicament, but there&#8217;s a tool that can help you navigate this labyrinth.<\/p>\n<p>Think of Python&#8217;s built-in debugger (pdb) as your guiding compass. It can help you trace the path of your code, inspect variables, and even change the course of your program on the fly.<\/p>\n<p><strong>This guide will walk you through the basics to advanced usage of the Python debugger.<\/strong> We&#8217;ll cover everything from setting breakpoints, stepping through the code, to using more advanced features like conditional breakpoints and post-mortem debugging.<\/p>\n<p>Let&#8217;s dive in and start mastering the Python debugger!<\/p>\n<h2>TL;DR: How Do I Use the Python Debugger?<\/h2>\n<blockquote><p>\n  To use the Python debugger, you can use the <code>pdb<\/code> module. This module allows you to pause your program, inspect variables, execute commands, and step through the code.\n<\/p><\/blockquote>\n<p>Here&#8217;s a simple example:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\n# Some Python code\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\n# More Python code\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(7)&lt;module&gt;()-&gt;None\n# (Pdb) p x\n# 10\n# (Pdb) p y\n# 20\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this example, we import the <code>pdb<\/code> module and set a breakpoint using <code>pdb.set_trace()<\/code>. When the Python interpreter reaches this line, it will pause the program. At this point, you can inspect variables (<code>p x<\/code>, <code>p y<\/code>), execute commands, and step through the code. The <code>c<\/code> command continues the execution of the program.<\/p>\n<blockquote><p>\n  This is just a basic introduction to using the Python debugger. There&#8217;s a lot more to learn about <code>pdb<\/code>, including advanced features like conditional breakpoints and post-mortem debugging. Continue reading for a comprehensive guide on mastering the Python debugger.\n<\/p><\/blockquote>\n<h2>Getting Started with Python Debugger<\/h2>\n<p>The Python debugger, also known as <code>pdb<\/code>, is a built-in module that allows you to interactively examine your code. Let&#8217;s take a closer look at some of its basic features including setting breakpoints, stepping through the code, and inspecting variables.<\/p>\n<h3>Setting Breakpoints<\/h3>\n<p>Breakpoints are specific points in your code where you instruct the debugger to pause the execution of your program. This allows you to inspect the current state of your program, including the values of variables.<\/p>\n<p>Here&#8217;s how to set a breakpoint using <code>pdb<\/code>:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(7)&lt;module&gt;()-&gt;None\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this code, we&#8217;ve set a breakpoint at the line <code>pdb.set_trace()<\/code>. When the Python interpreter reaches this line, it&#8217;ll pause the program and open the debugger.<\/p>\n<h3>Stepping Through the Code<\/h3>\n<p>Once the debugger is open, you can use various commands to control the execution of your program. The <code>n<\/code> (next) command executes the current line and moves to the next one. The <code>s<\/code> (step) command steps into functions or methods. Here&#8217;s an example:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\ndef add(x, y):\n    return x + y\n\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\nresult = add(x, y)\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(9)&lt;module&gt;()-&gt;None\n# (Pdb) s\n# --Call--\n# &gt; &lt;stdin&gt;(4)add()\n# (Pdb) n\n# &gt; &lt;stdin&gt;(5)add()-&gt;30\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this example, we used the <code>s<\/code> command to step into the <code>add<\/code> function. We then used the <code>n<\/code> command to execute the return statement, and the <code>c<\/code> command to continue the execution of the program.<\/p>\n<h3>Inspecting Variables<\/h3>\n<p>The <code>p<\/code> (print) command allows you to print the value of variables. Here&#8217;s how you can use it:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(7)&lt;module&gt;()-&gt;None\n# (Pdb) p x\n# 10\n# (Pdb) p y\n# 20\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this example, we used the <code>p<\/code> command to print the values of <code>x<\/code> and <code>y<\/code>. This is particularly useful when you want to inspect the values of variables at a specific point in your code.<\/p>\n<p>These are just the basics of using the Python debugger, but they&#8217;re enough to get you started on your journey. As you become more comfortable with these features, you can start exploring more advanced features of <code>pdb<\/code>.<\/p>\n<h2>Advanced Features: Python Debugger<\/h2>\n<p>Now that we&#8217;ve covered the basics of the Python debugger, let&#8217;s dive into some of its more advanced features. We&#8217;ll explore conditional breakpoints, post-mortem debugging, and using the debugger within an Integrated Development Environment (IDE).<\/p>\n<h3>Conditional Breakpoints<\/h3>\n<p>Sometimes, you might want your program to pause only when a certain condition is met. This is where conditional breakpoints come in handy. Here&#8217;s how you can set a conditional breakpoint in <code>pdb<\/code>:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\nx = 10\ny = 20\n\n# Set a conditional breakpoint here\nif y &gt; x:\n    pdb.set_trace()\n\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(8)&lt;module&gt;()-&gt;None\n# (Pdb) p x\n# 10\n# (Pdb) p y\n# 20\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this example, the debugger will only pause if <code>y<\/code> is greater than <code>x<\/code>. This can be incredibly useful when debugging complex conditions in your code.<\/p>\n<h3>Post-Mortem Debugging<\/h3>\n<p>Post-mortem debugging allows you to inspect the state of your program at the point of an exception. Here&#8217;s an example of how you can use it:<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\ndef divide(x, y):\n    return x \/ y\n\ntry:\n    result = divide(10, 0)\nexcept Exception:\n    pdb.post_mortem()\n\n# Output:\n# &gt; &lt;stdin&gt;(4)divide()-&gt;None\n# (Pdb) p x\n# 10\n# (Pdb) p y\n# 0\n<\/code><\/pre>\n<p>In this example, an exception occurs when we try to divide by zero. The <code>pdb.post_mortem()<\/code> function is called within the <code>except<\/code> block, which opens the debugger at the point of the exception.<\/p>\n<h3>Using the Debugger in an IDE<\/h3>\n<p>Most IDEs, such as PyCharm or Visual Studio Code, have built-in support for <code>pdb<\/code>. This means you can set breakpoints, step through the code, and inspect variables right within your IDE. This can greatly enhance your debugging experience.<\/p>\n<p>These advanced features of the Python debugger can help you debug more effectively and efficiently. So don&#8217;t be afraid to explore them and see how they can improve your debugging skills.<\/p>\n<h2>Alternative Python Debugging Tools<\/h2>\n<p>While <code>pdb<\/code> is a powerful debugger, Python offers other debugging tools that you might find useful. Let&#8217;s take a look at some of these alternatives, including PyCharm&#8217;s debugger, <code>ipdb<\/code>, and <code>pdb++<\/code>, and discuss their advantages and disadvantages compared to the built-in Python debugger.<\/p>\n<h3>PyCharm&#8217;s Debugger<\/h3>\n<p>PyCharm, a popular Python IDE, comes with its own debugger. It provides a user-friendly interface that allows you to easily set breakpoints, inspect variables, and control the execution of your program.<\/p>\n<p>PyCharm&#8217;s debugger can be used by clicking on the gutter next to the line number and then running your program in debug mode.<\/p>\n<p>One advantage of PyCharm&#8217;s debugger is its integration with the IDE, which can make the debugging process smoother. However, it might be overkill if you&#8217;re working on a small script or if you prefer working in a text editor.<\/p>\n<h3>ipdb<\/h3>\n<p><code>ipdb<\/code> is another debugging tool that you can use. It provides the same functionality as <code>pdb<\/code>, but with added features like syntax highlighting and tab completion.<\/p>\n<pre><code class=\"language-python line-numbers\">import ipdb\n\nx = 10\ny = 20\n\n# Set a breakpoint here\nipdb.set_trace()\n\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(6)&lt;module&gt;()-&gt;None\n# ipdb&gt; p x\n# 10\n# ipdb&gt; p y\n# 20\n# ipdb&gt; c\n# 30\n<\/code><\/pre>\n<p>The main advantage of <code>ipdb<\/code> is its enhanced user interface, which can make your debugging experience more pleasant. However, it&#8217;s not built-in and requires an additional installation.<\/p>\n<h3>pdb++<\/h3>\n<p><code>pdb++<\/code> is an extension of <code>pdb<\/code> that provides additional features like sticky mode, syntax highlighting, and tab completion.<\/p>\n<pre><code class=\"language-python line-numbers\"># pdb++ is used in the same way as pdb, but with additional features. Here's how you can use it:\n\n# First, install pdb++\n# pip install pdbpp\n\nimport pdb\n\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\nresult = x + y\nprint(result)\n\n# Output:\n# &gt; &lt;stdin&gt;(8)&lt;module&gt;()-&gt;None\n# (Pdb++) p x\n# 10\n# (Pdb++) p y\n# 20\n# (Pdb++) c\n# 30\n<\/code><\/pre>\n<p>The advantage of <code>pdb++<\/code> is that it enhances the functionality of <code>pdb<\/code> without changing the way you use it. However, like <code>ipdb<\/code>, it requires an additional installation.<\/p>\n<p>While the built-in Python debugger is a powerful tool, these alternatives offer enhanced features that can improve your debugging experience. It&#8217;s worth exploring these tools to see which one fits your needs best.<\/p>\n<h2>Fixing Issues: Python Debugger<\/h2>\n<p>Like any tool, the Python debugger isn&#8217;t without its quirks. You might run into issues like not being able to inspect variables or the debugger not stopping at breakpoints. Let&#8217;s tackle these common problems and provide some solutions.<\/p>\n<h3>Debugger Not Inspecting Variables<\/h3>\n<p>Sometimes, you might find that the debugger isn&#8217;t inspecting variables as expected. This could be due to a variety of reasons, such as the variable not being defined at the point of the breakpoint.<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\n# Set a breakpoint here\npdb.set_trace()\n\nx = 10\n\n# Output:\n# &gt; &lt;stdin&gt;(4)&lt;module&gt;()-&gt;None\n# (Pdb) p x\n# *** NameError: name 'x' is not defined\n<\/code><\/pre>\n<p>In this example, we tried to print the value of <code>x<\/code> before it was defined, resulting in a <code>NameError<\/code>. To fix this, ensure that the variable is defined before the breakpoint.<\/p>\n<h3>Debugger Not Stopping at Breakpoints<\/h3>\n<p>Another common issue is the debugger not stopping at breakpoints. This could be because the line with the breakpoint isn&#8217;t being executed.<\/p>\n<pre><code class=\"language-python line-numbers\">import pdb\n\nx = 10\n\nif x &gt; 20:\n    # Set a breakpoint here\n    pdb.set_trace()\n\nresult = x * 2\nprint(result)\n\n# Output:\n# 20\n<\/code><\/pre>\n<p>In this example, the breakpoint is inside an <code>if<\/code> statement that isn&#8217;t true, so the line with the breakpoint isn&#8217;t executed. To fix this, ensure that the line with the breakpoint is being executed.<\/p>\n<p>These are just a couple of common issues you might face when using the Python debugger. Remember, every problem has a solution, so don&#8217;t let these minor hiccups discourage you from using this powerful debugging tool!<\/p>\n<h2>The Art of Debugging Explained<\/h2>\n<p>Before we delve deeper into the specifics of the Python debugger, it&#8217;s important to understand the concept of debugging and its significance in the realm of software development.<\/p>\n<h3>What is Debugging?<\/h3>\n<p>Debugging is a methodical process of finding and fixing bugs or issues in a computer program. It&#8217;s an integral part of the software development cycle, often taking up a significant portion of the development time.<\/p>\n<pre><code class=\"language-python line-numbers\"># A simple Python program with a bug\n\ndef add(x, y):\n    return x - y  # Oops! This should be x + y\n\nresult = add(10, 20)\nprint(result)\n\n# Output:\n# -10\n<\/code><\/pre>\n<p>In this example, the <code>add<\/code> function is supposed to add <code>x<\/code> and <code>y<\/code>, but due to a bug, it subtracts <code>y<\/code> from <code>x<\/code> instead. Debugging is the process of identifying and fixing this bug.<\/p>\n<h3>Why is Debugging Necessary?<\/h3>\n<p>Bugs can lead to unexpected behavior, incorrect results, and even system crashes. Debugging helps ensure that your program works as expected and provides correct results.<\/p>\n<pre><code class=\"language-python line-numbers\"># The corrected Python program\n\ndef add(x, y):\n    return x + y  # Fixed the bug\n\nresult = add(10, 20)\nprint(result)\n\n# Output:\n# 30\n<\/code><\/pre>\n<p>After debugging and fixing the bug, the <code>add<\/code> function now works correctly, providing the correct result.<\/p>\n<h3>The Role of a Debugger in the Development Process<\/h3>\n<p>A debugger is a tool that aids in the debugging process. It allows you to control the execution of your program, inspect the program&#8217;s state at any point, and even change the program&#8217;s state on the fly.<\/p>\n<p>Using a debugger like <code>pdb<\/code> can greatly enhance your productivity and make the process of finding and fixing bugs much more efficient. It&#8217;s a crucial tool in any developer&#8217;s toolkit, and mastering it is well worth the effort.<\/p>\n<h2>Larger Projects and the Debugger<\/h2>\n<p>While we&#8217;ve covered the basics and advanced usage of the Python debugger, there&#8217;s still a lot more to explore. Let&#8217;s discuss how you can use <code>pdb<\/code> in larger projects and how it integrates with testing frameworks and continuous integration systems. We&#8217;ll also suggest some related topics for you to explore further.<\/p>\n<h3>Python Debugger in Large-Scale Projects<\/h3>\n<p>When working on larger projects, the Python debugger can be an invaluable tool. You can use it to debug complex systems, inspect interactions between different parts of your code, and even debug code running on remote servers.<\/p>\n<pre><code class=\"language-python line-numbers\"># In a large project, you might have multiple modules. Here's how you can use pdb to debug them.\n\n# module1.py\nimport pdb\nimport module2\n\nx = 10\ny = 20\n\n# Set a breakpoint here\npdb.set_trace()\n\nresult = module2.add(x, y)\nprint(result)\n\n# module2.py\n\ndef add(x, y):\n    return x + y\n\n# Output:\n# &gt; &lt;stdin&gt;(8)&lt;module&gt;()-&gt;None\n# (Pdb) s\n# --Call--\n# &gt; &lt;stdin&gt;(4)add()\n# (Pdb) n\n# &gt; &lt;stdin&gt;(5)add()-&gt;30\n# (Pdb) c\n# 30\n<\/code><\/pre>\n<p>In this example, we&#8217;re using <code>pdb<\/code> to debug a function in a different module. This can be incredibly useful when debugging large projects with multiple modules.<\/p>\n<h3>Integrating Python Debugger with Testing Frameworks<\/h3>\n<p>The Python debugger can also be integrated with testing frameworks like pytest. This allows you to debug your tests, making it easier to identify and fix issues.<\/p>\n<pre><code class=\"language-python line-numbers\"># test_example.py\nimport pytest\nimport pdb\n\ndef add(x, y):\n    return x + y\n\ndef test_add():\n    # Set a breakpoint here\n    pdb.set_trace()\n    assert add(10, 20) == 30\n\n# Run the test with pytest\n# pytest test_example.py\n\n# Output:\n# &gt; &lt;stdin&gt;(9)test_add()-&gt;None\n# (Pdb) s\n# --Return--\n# &gt; &lt;stdin&gt;(9)test_add()-&gt;None\n# (Pdb) c\n# .\n# 1 passed in 0.01s\n<\/code><\/pre>\n<p>In this example, we&#8217;re using <code>pdb<\/code> to debug a test case. When the breakpoint is hit, you can inspect variables, step through the code, and even change the state of the program.<\/p>\n<h3>Further Resources for Mastering Python Debugger<\/h3>\n<p>If you&#8217;re interested in delving deeper into the Python debugger, here are some resources you might find useful:<\/p>\n<ol>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/pytest\/\">This blog post<\/a> explains the ins and outs of Pytest&#8217;s command-line options for Python testing.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/mypy\/\">Exploring the Benefits of mypy<\/a> &#8211; Master the art of Static Typing in Python with mypy to enhance code quality and maintainability in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-no-module-named\/\">Resolving &#8220;No Module Named&#8221; Errors in Python<\/a> &#8211; Learn how to troubleshoot and resolve the &#8220;No module named&#8221; error in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/docs.python.org\/3\/library\/pdb.html\" target=\"_blank\" rel=\"noopener\">Python&#8217;s Official pdb: The Python Debugger Documentation<\/a> &#8211; This is the official Python documentation for their built-in debugger pdb.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/realpython.com\/python-debugging-pdb\/\" target=\"_blank\" rel=\"noopener\">Python Debugging With Pdb<\/a> &#8211; This tutorial provides a comprehensive overview of the Python debugger, including its basic and advanced features.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.jetbrains.com\/help\/pycharm\/using-debug-console.html\" target=\"_blank\" rel=\"noopener\">Python Debugging Using PyCharm<\/a> &#8211; JetBrains provides a useful guide to debugging Python programs using the PyCharm IDE.<\/p>\n<\/li>\n<\/ol>\n<p>Remember, mastering a tool like the Python debugger takes time and practice. So don&#8217;t be discouraged if you don&#8217;t get it right away. Keep practicing, and before you know it, you&#8217;ll be a pro at debugging Python code.<\/p>\n<h2>Summary: Python Debugger Tutorial<\/h2>\n<p>In this comprehensive guide, we&#8217;ve journeyed through the world of Python debugging, exploring the built-in Python debugger, pdb, from its basic to advanced features.<\/p>\n<p>We began with the basics, learning how to set breakpoints, step through the code, and inspect variables. We then ventured into more advanced territory, exploring conditional breakpoints, post-mortem debugging, and how to use pdb within an Integrated Development Environment (IDE).<\/p>\n<p>Along the way, we tackled common challenges you might face when using pdb, such as not being able to inspect variables or the debugger not stopping at breakpoints, providing you with solutions and workarounds for each issue.<\/p>\n<p>We also looked at alternative approaches to debugging in Python, comparing pdb with other debugging tools like PyCharm&#8217;s debugger, ipdb, and pdb++. Here&#8217;s a quick comparison of these tools:<\/p>\n<table>\n<thead>\n<tr>\n<th>Debugger<\/th>\n<th>Pros<\/th>\n<th>Cons<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>pdb<\/td>\n<td>Built-in, no additional installation needed<\/td>\n<td>User interface can be improved<\/td>\n<\/tr>\n<tr>\n<td>PyCharm&#8217;s Debugger<\/td>\n<td>User-friendly interface, integrated with the IDE<\/td>\n<td>Might be overkill for small scripts<\/td>\n<\/tr>\n<tr>\n<td>ipdb<\/td>\n<td>Enhanced user interface, syntax highlighting, tab completion<\/td>\n<td>Requires additional installation<\/td>\n<\/tr>\n<tr>\n<td>pdb++<\/td>\n<td>Enhances pdb&#8217;s functionality, syntax highlighting, tab completion<\/td>\n<td>Requires additional installation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re a beginner just starting out with Python debugging or an experienced developer looking to level up your debugging skills, we hope this guide has given you a deeper understanding of the Python debugger and its capabilities. Happy debugging!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever felt like you&#8217;re lost in a maze while debugging your Python code? You&#8217;re not alone. Many developers find themselves in a similar predicament, but there&#8217;s a tool that can help you navigate this labyrinth. Think of Python&#8217;s built-in debugger (pdb) as your guiding compass. It can help you trace the path of your code, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10767,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121,123],"tags":[],"class_list":["post-4806","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\/4806","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=4806"}],"version-history":[{"count":17,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/4806\/revisions"}],"predecessor-version":[{"id":16513,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/4806\/revisions\/16513"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/10767"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=4806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=4806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=4806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}