{"id":7776,"date":"2021-01-01T20:58:49","date_gmt":"2021-01-01T15:28:49","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=7776"},"modified":"2025-12-25T00:51:25","modified_gmt":"2025-12-25T05:51:25","slug":"python-check-if-file-or-directory-exists","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/python-check-if-file-or-directory-exists\/","title":{"rendered":"Python Check If File or Directory Exists"},"content":{"rendered":"\n<p>In Python, you can check if a directory exists using several built-in modules. The most modern and recommended approach is using\u00a0<code>pathlib<\/code>.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Using\u00a0<code>pathlib<\/code>\u00a0<\/h2>\n\n\n\n<p>Introduced in Python 3.4, this module provides an object-oriented approach to filesystem paths.&nbsp;<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\npath = Path(\"my_directory\")\n\nif path.is_dir():\n    print(\"Directory exists\")\nelse:\n    print(\"Directory does not exist\")\n<\/pre>\n\n\n\n<p>Use code with caution.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Note:<\/strong>\u00a0<code>is_dir()<\/code>\u00a0returns\u00a0<code>True<\/code>\u00a0only if the path exists\u00a0<strong>and<\/strong>\u00a0it is a directory. If the path is a file, it returns\u00a0<code>False<\/code>.\u00a0<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. Using&nbsp;<code>os.path<\/code><\/h2>\n\n\n\n<p>This is the traditional method used in older scripts and remains widely compatible.&nbsp;<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\n\npath = \"my_directory\"\n\nif os.path.isdir(path):\n    print(\"Directory exists\")\n<\/pre>\n\n\n\n<p>Use code with caution.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Difference:<\/strong>\u00a0<code>os.path.isdir()<\/code>\u00a0specifically checks for directories, while\u00a0<code>os.path.exists()<\/code>\u00a0returns\u00a0<code>True<\/code>\u00a0for both files and directories.\u00a0<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">3. Check and Create if Missing&nbsp;<\/h2>\n\n\n\n<p>A common task is to create a directory only if it doesn&#8217;t already exist. You can do this in one line to avoid &#8220;race conditions&#8221; where another process might create the folder between your check and your creation step.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Modern approach (<code>pathlib<\/code>):<\/strong>python<code>Path(\"my_directory\").mkdir(parents=True, exist_ok=True) <\/code>Use code with caution.<\/li>\n\n\n\n<li><strong>Traditional approach (<code>os<\/code>):<\/strong>python<code>os.makedirs(\"my_directory\", exist_ok=True) <\/code>Use code with caution.\u00a0<\/li>\n<\/ul>\n\n\n\n<p>Summary of Methods<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th class=\"has-text-align-left\" data-align=\"left\">Method&nbsp;<\/th><th class=\"has-text-align-left\" data-align=\"left\">Module<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><tr><td><code>Path.is_dir()<\/code><\/td><td><code>pathlib<\/code><\/td><td>Returns&nbsp;<code>True<\/code>&nbsp;if path is an existing directory.<\/td><\/tr><tr><td><code>Path.exists()<\/code><\/td><td><code>pathlib<\/code><\/td><td>Returns&nbsp;<code>True<\/code>&nbsp;if path is an existing file or directory.<\/td><\/tr><tr><td><code>os.path.isdir()<\/code><\/td><td><code>os.path<\/code><\/td><td>Returns&nbsp;<code>True<\/code>&nbsp;if path is an existing directory.<\/td><\/tr><tr><td><code>os.path.exists()<\/code><\/td><td><code>os.path<\/code><\/td><td>Returns&nbsp;<code>True<\/code>&nbsp;if path is an existing file or directory.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Here is an example of how you can use both the <code>os<\/code> and <code>pathlib<\/code> methods to check for the existence of files or directories:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Using the <code>os<\/code> module:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\n\nfile_path = 'example.txt'\n\nif os.path.exists(file_path):\n    print(f\"The file {file_path} exists.\")\nelse:\n    print(f\"The file {file_path} does not exist.\")\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Using the <code>pathlib<\/code> module:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\nfile_path = Path('example.txt')\n\nif file_path.exists():\n    print(f\"The file {file_path} exists.\")\nelse:\n    print(f\"The file {file_path} does not exist.\")\n<\/pre>\n\n\n\n<p>When it comes to managing files and directories in Python programming, one of the essential tasks is checking whether a file or directory exists before performing operations such as reading, writing, or modifying it. The <strong><a href=\"https:\/\/www.h2kinfosys.com\/courses\/python-online-training\/\">Python Programming Training Course<\/a><\/strong> provides various ways to check the existence of files and directories, which is crucial for error handling and ensuring smooth execution of code.<\/p>\n\n\n\n<p>The ability to check if a file or directory exists is a fundamental aspect of working with file systems in Python programming. It helps to ensure that your code runs without unexpected errors, especially when dealing with user inputs or dynamically generated paths. In addition to existence checks, developers often perform other tasks, such as creating new files or directories if they don&#8217;t exist, using functions like <code>os.mkdir()<\/code> or <code>Path.mkdir()<\/code> from <code>pathlib<\/code>.<\/p>\n\n\n\n<p>Understanding how to work with file and directory paths and perform existence checks is an important skill for Python programmers. It lays the foundation for handling more complex file system operations, such as file manipulation, directory traversal, and file permission management. By mastering these techniques, you&#8217;ll be well-equipped to build robust and error-free Python programs that interact seamlessly with the file system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Is This Knowledge Important?<\/strong><\/h2>\n\n\n\n<p>In Python, file operations like opening, reading, and writing files are common tasks. But before performing such operations, it\u2019s essential to confirm whether the file or directory exists to prevent errors in your program. Imagine attempting to access a file that doesn\u2019t exist your program would crash, and that\u2019s a situation you\u2019d want to avoid in any application.<\/p>\n\n\n\n<p>Luckily, Python makes it easy to check for files and directories before performing actions on them. Let\u2019s explore how you can do that.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. <strong>Understanding Python\u2019s File and Directory System<\/strong><\/h2>\n\n\n\n<p>Before learning how to check if a file or directory exists, it\u2019s crucial to understand how Python interacts with the system\u2019s file structure.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Files<\/strong>: These can be anything from text files, images, scripts, or other data stored on your computer.<\/li>\n\n\n\n<li><strong>Directories<\/strong>: These are containers for organizing files into folders.<\/li>\n<\/ul>\n\n\n\n<p>Python provides libraries that allow you to interact with these files and directories directly. The most common libraries for file operations are <code>os<\/code>, <code>pathlib<\/code>, and <code>os.path<\/code>. You can use these modules to check the existence of files and directories.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. <strong>Checking if a File or Directory Exists Using <code>os.path<\/code><\/strong><\/h2>\n\n\n\n<p>The <code>os<\/code> module is one of the core modules in Python and provides a method called <code>os.path.exists()<\/code> to check if a file or directory exists.<\/p>\n\n\n\n<p>Here\u2019s how you can use it:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example Code:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\n\n# File path\nfile_path = 'example.txt'\ndirectory_path = 'my_folder'\n\n# Check if the file exists\nif os.path.exists(file_path):\n    print(f\"{file_path} exists\")\nelse:\n    print(f\"{file_path} does not exist\")\n\n# Check if the directory exists\nif os.path.exists(directory_path):\n    print(f\"{directory_path} exists\")\nelse:\n    print(f\"{directory_path} does not exist\")\n<\/pre>\n\n\n\n<p><strong>Explanation<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>os.path.exists()<\/code> checks whether the given path (file or directory) exists.<\/li>\n\n\n\n<li>It returns <code>True<\/code> if the file or directory exists, otherwise <code>False<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">3. <strong>Using <code>os.path<\/code> to Check Specifically for Files and Directories<\/strong><\/h2>\n\n\n\n<p>Sometimes, you may want to check if a specific path is a file or a directory. The <code>os.path<\/code> module provides specific functions like <code>os.path.isfile()<\/code> and <code>os.path.isdir()<\/code> for these checks.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2021\/01\/python-programming-code-language-learning-concept-with-person-laptop-1-1024x576.jpg\" alt=\"\" class=\"wp-image-31623\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example Code:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\n\n# Paths\nfile_path = 'example.txt'\ndirectory_path = 'my_folder'\n\n# Check if it's a file\nif os.path.isfile(file_path):\n    print(f\"{file_path} is a file\")\nelse:\n    print(f\"{file_path} is not a file\")\n\n# Check if it's a directory\nif os.path.isdir(directory_path):\n    print(f\"{directory_path} is a directory\")\nelse:\n    print(f\"{directory_path} is not a directory\")\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation<\/strong>:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>os.path.isfile()<\/code> returns <code>True<\/code> if the path is a file.<\/li>\n\n\n\n<li><code>os.path.isdir()<\/code> returns <code>True<\/code> if the path is a directory.<\/li>\n<\/ul>\n\n\n\n<p>These checks allow you to write more precise code depending on whether you\u2019re dealing with a file or directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. <strong>The Power of <code>pathlib<\/code> for File and Directory Operations<\/strong><\/h2>\n\n\n\n<p>While <code>os<\/code> is powerful, Python introduced a newer library, <code>pathlib<\/code>, in Python 3.4 that offers a more modern, object-oriented approach to file system paths. It\u2019s now the recommended way to work with paths.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example Code:<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation<\/strong>:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\n# File and directory paths\nfile_path = Path('example.txt')\ndirectory_path = Path('my_folder')\n\n# Check if file exists\nif file_path.exists():\n    print(f\"{file_path} exists\")\nelse:\n    print(f\"{file_path} does not exist\")\n\n# Check if directory exists\nif directory_path.exists():\n    print(f\"{directory_path} exists\")\nelse:\n    print(f\"{directory_path} does not exist\")\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>pathlib.Path<\/code> objects are more flexible and intuitive than working directly with strings and <code>os.path<\/code>.<\/li>\n\n\n\n<li>The <code>exists()<\/code> method in <code>pathlib<\/code> works similarly to <code>os.path.exists()<\/code> but with a cleaner syntax.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. <strong>Real-World Applications of Checking File and Directory Existence<\/strong><\/h2>\n\n\n\n<p>In real-world scenarios, you\u2019ll often need to check if a file or directory exists before performing actions like creating, reading, or deleting them. Below are some common examples:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example 1: File Reading<\/strong><\/h3>\n\n\n\n<p>When processing files, it\u2019s crucial to check whether the file exists before trying to open it to avoid errors:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\n# File path\nfile_path = Path('data.txt')\n\nif file_path.exists():\n    with open(file_path, 'r') as file:\n        content = file.read()\n        print(content)\nelse:\n    print(\"File does not exist!\")\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example 2: Directory Creation<\/strong><\/h3>\n\n\n\n<p>Before creating a new directory, you can check whether it already exists to avoid overwriting:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\n# Directory path\ndirectory_path = Path('new_folder')\n\nif not directory_path.exists():\n    directory_path.mkdir()\n    print(\"Directory created\")\nelse:\n    print(\"Directory already exists\")\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>from pathlib import Path<br><br># Directory path<br>directory_path = Path('new_folder')<br><br>if not directory_path.exists():<br>    directory_path.mkdir()<br>    print(\"Directory created\")<br>else:<br>    print(\"Directory already exists\")<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">6. <strong>Python Certifications: Boost Your Career with Python Skills<\/strong><\/h2>\n\n\n\n<p>As you work on mastering Python\u2019s file handling, enrolling in a Python Programming Language Certification can significantly boost your career. With an online Python programming course, you can gain practical knowledge in handling files, directories, and much more.<\/p>\n\n\n\n<p>Online Python courses focus on industry-relevant skills such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>File and data management<\/li>\n\n\n\n<li>Automation and scripting<\/li>\n\n\n\n<li>Web development with frameworks like Flask and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Django_(web_framework)\" rel=\"nofollow noopener\" target=\"_blank\">Django<\/a><\/li>\n\n\n\n<li>Data analysis with libraries such as <a href=\"https:\/\/www.h2kinfosys.com\/blog\/data-cleansing-using-pandas\/\" data-type=\"post\" data-id=\"4866\">Pandas<\/a> and NumPy<\/li>\n<\/ul>\n\n\n\n<p>By joining Python Online Training, you will be well-equipped to solve real-world problems efficiently, opening doors to job opportunities and career advancement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. <strong>Handling Exceptions: Improving Your Code Robustness<\/strong><\/h2>\n\n\n\n<p>When working with files and directories, handling exceptions is a crucial part of ensuring your program doesn\u2019t crash unexpectedly. Even after checking if a file or directory exists, various issues might still arise when trying to open, modify, or delete a file. Python\u2019s <code>try-except<\/code> blocks can help handle these issues gracefully.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example: Handling File Opening Exceptions<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\nfile_path = Path('data.txt')\n\ntry:\n    if file_path.exists():\n        with open(file_path, 'r') as file:\n            content = file.read()\n            print(content)\n    else:\n        print(f\"File '{file_path}' does not exist!\")\nexcept PermissionError:\n    print(f\"Permission denied to access '{file_path}'\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation<\/strong>:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This approach helps handle specific errors (like permission issues) and general errors, ensuring your program continues to run smoothly even when encountering unexpected conditions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">8. <strong>Understanding Relative and Absolute Paths<\/strong><\/h2>\n\n\n\n<p>When checking for file or directory existence, understanding the difference between <strong>relative<\/strong> and <strong>absolute paths<\/strong> is crucial.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Absolute Path<\/strong>: This refers to the full path from the root directory (e.g., <code>C:\/Users\/username\/Documents\/file.txt<\/code>).<\/li>\n\n\n\n<li><strong>Relative Path<\/strong>: This is relative to the current working directory of the program (e.g., <code>data\/file.txt<\/code>).<\/li>\n<\/ul>\n\n\n\n<p>Python allows you to work with both types of paths, and knowing when to use each is vital for effective file management.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example: Absolute vs. Relative Paths<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">from pathlib import Path\n\n# Absolute Path\nabs_path = Path('C:\/Users\/username\/Documents\/data.txt')\n\n# Relative Path\nrel_path = Path('data.txt')\n\n# Check if the file exists\nprint(f\"Absolute Path exists: {abs_path.exists()}\")\nprint(f\"Relative Path exists: {rel_path.exists()}\")<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation<\/strong>:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>By using <strong>absolute paths<\/strong>, you ensure that the file or directory is correctly located, regardless of the current working directory.<\/li>\n\n\n\n<li><strong>Relative paths<\/strong> are often used for portability, as they allow your program to reference files relative to where the script is run.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">9. <strong>Best Practices for File Path Handling in Python<\/strong><\/h2>\n\n\n\n<p>While working with file paths, it\u2019s essential to follow best practices to ensure portability and clarity in your code. Here are a few practices:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use <code>pathlib<\/code> for Modern Code<\/strong>: The <code>pathlib<\/code> module provides a more intuitive and readable approach to file path handling.<\/li>\n\n\n\n<li><strong>Avoid Hard-Coding Paths<\/strong>: Instead of hard-coding absolute paths in your program, use relative paths or store paths in configuration files to make your code more flexible and portable.<\/li>\n\n\n\n<li><strong>Normalize Paths<\/strong>: Paths can differ based on the operating system. Use <code>os.path.normpath()<\/code> or <code>pathlib.Path().resolve()<\/code> to standardize them across platforms.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example: Path Normalization<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">import os\nfrom pathlib import Path\n\n# Normalizing file path\nfile_path = Path('data\/\/folder\/..\/data.txt')\n\n# Normalize and resolve\nnormalized_path = file_path.resolve()\n\nprint(f\"Normalized path: {normalized_path}\")<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation<\/strong>:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This ensures that redundant components like <code>\/\/<\/code> or <code>..<\/code> are cleaned up, making your path more predictable.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Enroll in Online Python Classes at H2K Infosys?<\/strong><\/h2>\n\n\n\n<p>At H2K Infosys, our online classes for Python programming are designed to provide hands-on experience. Our instructors are industry experts, guiding you through concepts such as file handling, error handling, object-oriented programming, and more.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Interactive Learning<\/strong>: Engage in practical coding exercises.<\/li>\n\n\n\n<li><strong>Flexible Schedule<\/strong>: Take classes at your convenience.<\/li>\n\n\n\n<li><strong>Comprehensive Course<\/strong>: Learn everything from basics to advanced topics in Python.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Takeaways<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Checking if a file or directory exists<\/strong> is essential before performing file operations like opening, reading, or deleting.<\/li>\n\n\n\n<li>Python offers multiple libraries for file and directory handling, such as <code>os.path<\/code> and <code>pathlib<\/code>.<\/li>\n\n\n\n<li>You can use <code>os.path.exists()<\/code> for general checks, and <code>os.path.isfile()<\/code> or <code>os.path.isdir()<\/code> for specific checks.<\/li>\n\n\n\n<li>Python\u2019s online courses can provide you with practical knowledge, including file handling and other essential skills for a career in programming.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion: Start Your Python Journey Today<\/strong><\/h2>\n\n\n\n<p>Now that you understand how to check if a file or directory exists, it\u2019s time to put these skills to use. For hands-on learning and deeper insights, enroll in H2K Infosys <a href=\"https:\/\/www.h2kinfosys.com\/courses\/python-online-training\/\">Certificate Python Programming<\/a>. Take the first step toward mastering Python and boosting your career!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Call to Action<\/strong>:<\/h2>\n\n\n\n<p>Enroll today in H2K Infosys\u2019 online training in Python and start building your career with practical programming skills!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Python, you can check if a directory exists using several built-in modules. The most modern and recommended approach is using\u00a0pathlib.\u00a0 1. Using\u00a0pathlib\u00a0 Introduced in Python 3.4, this module provides an object-oriented approach to filesystem paths.&nbsp; python from pathlib import Path path = Path(&#8220;my_directory&#8221;) if path.is_dir(): print(&#8220;Directory exists&#8221;) else: print(&#8220;Directory does not exist&#8221;) Use code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7778,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[342],"tags":[],"class_list":["post-7776","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorials"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/7776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=7776"}],"version-history":[{"count":2,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/7776\/revisions"}],"predecessor-version":[{"id":33309,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/7776\/revisions\/33309"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/7778"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=7776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=7776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=7776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}