{"id":86871,"date":"2023-01-27T09:00:55","date_gmt":"2023-01-27T03:30:55","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=86871"},"modified":"2023-01-27T09:00:55","modified_gmt":"2023-01-27T03:30:55","slug":"multiprocessing-with-python","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/","title":{"rendered":"Multiprocessing with Python &#8211; A Complete Guide"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Thanks to Python&#8217;s built-in multiprocessing library, the system can execute numerous processes at once. It will make it possible to divide apps into smaller, independent threads. The operating system can then assign each of these threads or processes to a processor to run concurrently, enhancing performance and effectiveness.<\/span><\/p>\n<p><span style=\"font-weight: 400\">While working on a computer vision project, preprocessing a large amount of image data is necessary. Processing several photographs simultaneously is preferable because it takes a lot of time. The capacity of a system to use many processors simultaneously is known as multiprocessing. <\/span><\/p>\n<p><span style=\"font-weight: 400\">A computer with a single processor would cycle between various tasks to keep them all active. However, most modern computers include at least a multi-core CPU, which enables the simultaneous execution of multiple tasks. You can use the Python Multiprocessing Module to assign tasks to various processes, which will help your scripts run more quickly.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">Why Use Multiprocessing In Python?<\/span><\/h3>\n<p><span style=\"font-weight: 400\">It becomes difficult to perform several processes on a single processor. To keep up with the increasing quantity of processes, the processor will have to pause the current one and switch to the next. As a result, it will have to stop each activity, which will lower performance.<\/span><\/p>\n<p><span style=\"font-weight: 400\">It is comparable to a worker in a company who is expected to handle tasks from various departments. For example, the employee will have to cease selling when working on accounts, and vice versa, if he is responsible for managing sales, accounts, and even the backend.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Let&#8217;s assume that there are various employees, each with a distinct job description. It gets easier. Python multiprocessing is necessary because of this. It is simpler to handle and manage diverse operations since the smaller task threads function like distinct employees. An illustration of a multiprocessing system is as follows:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A setup that uses many central processors<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A single computing device containing several separate core processing units, sometimes known as a &#8220;multi-core processor,&#8221;<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">The system can divide and distribute tasks to other processors in multiprocessing.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">Basic Multiprocessing Using Python<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Using the Python Multiprocessing module, let&#8217;s create a simple program that exemplifies concurrent programming.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Let&#8217;s examine the task() function, which prints before and after a 0.5-second sleep.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Import time<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def task():\n    print('Sleeping for 0.5 seconds')\n    time.sleep(0.5)\n    print('Finished')\n<\/pre>\n<p><span style=\"font-weight: 400\">Using the multiprocessing module, we can easily declare a process:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import multiprocessing\np1 = multiprocessing.Process(target=task)\np2 = multiprocessing.Process(target=task)\n<\/pre>\n<p><span style=\"font-weight: 400\">The process&#8217;s target function is specified by the target parameter of the Process() method. But before we start, these procedures don&#8217;t begin immediately:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">p1.start()\np2.start()\n<\/pre>\n<p><span style=\"font-weight: 400\">A full concurrent program might look like this:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import multiprocessing\nimport time\n\ndef task():\n    print('Sleeping for 0.5 seconds')\n    time.sleep(0.5)\n    print('Finished sleeping')\n\nif __name__ == \"__main__\":\n    start_time = time.perf_counter()\n\n    # Creates two processes\n    p1 = multiprocessing.Process(target=task)\n    p2 = multiprocessing.Process(target=task)\n\n    # Starts both processes\n    p1.start()\n    p2.start()\n\n    finish_time = time.perf_counter()\n\n    print(f\"It took the programme {finish_time-start_time} seconds to complete.\")\n<\/pre>\n<p><span style=\"font-weight: 400\">If __name__ == &#8220;__main__,&#8221; we must fence our main program under that condition to avoid the multiprocessing module&#8217;s objections. This safety feature ensures Python completes program analysis before the sub-process is formed.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The code has a flaw, though, as the program timer is printed before the operations we wrote have even been carried out. Here is what the code is shown above produced:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">The program finished in 0.01618915414532 seconds\nSleeping for 0.5 seconds\nSleeping for 0.5 seconds\nFinished sleeping\nFinished sleeping\n<\/pre>\n<p><span style=\"font-weight: 400\">To get the two processes to run before the time is printed, we must use the join() function on the two processes. This is because three processes p1, p2, and the main process are active. The primary process is the one that monitors the passing of time and prints the execution time. The line finish time should not run before processes p1 and p2 have been completed. Just add the following line of code right after the start() function calls:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">p1.join()\np2.join()\n<\/pre>\n<p><span style=\"font-weight: 400\">The join() function enables us to instruct other processes to pause until the processes on which join() was called have finished. The output with the join statements added is as shown below:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Sleeping for 0.5 seconds\nSleeping for 0.5 seconds\nFinished sleeping\nFinished sleeping\nProgram finished in 0.5688213340181392 seconds\n<\/pre>\n<p><span style=\"font-weight: 400\">Similar thinking allows us to run more processes. For example, the entire code from above, modified to have ten processes, is as follows:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import multiprocessing\nimport time\n\ndef task():\n    print('Sleeping for 0.5 seconds')\n    time.sleep(0.5)\n    print('Finished')\n\nif __name__ == \"__main__\": \n    start_time = time.perf_counter()\n    processes = []\n\n    # Creates 10 processes then starts them\n    for i in range(10):\n        p = multiprocessing.Process(target = task)\n        p.start()\n        processes.append(p)\n    \n    # Joins all the processes \n    for p in processes:\n        p.join()\n    finish_time = time.perf_counter()\n    print(f\"It took the programme {finish_time-start_time} seconds to complete.)\n<\/pre>\n<h3><span style=\"font-weight: 400\">Python Multiprocessing Module: What Is It?<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Multiple classes are available in the Python multiprocessing module. It enables us to create parallel programs to implement multiprocessing in Python. It provides an easy-to-use API for distributing tasks among numerous processors, fully utilizing multiprocessing. It gets around the drawbacks of Global Interpreter Lock (GIL) by using sub-processes rather than threads. The Python multiprocessing module&#8217;s main classes are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Process<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Queue\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Lock<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400\">What Purposes Do Python&#8217;s Multiprocessing Pipes Serve?<\/span><\/h3>\n<p>Python&#8217;s multiprocessing uses Pipes as a route for communication. For example, pipes are useful when you want to start a conversation between several processes. They use the send() &amp; recv() methods to exchange information and return two connection objects, one for either end of the Pipe. For a better understanding, let&#8217;s look at an example. The code below uses a Pipe to deliver data from the child connected to the parent connection.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import multiprocessing\nfrom multiprocessing import Process, Pipe\ndef exm_function(c):\n    c.send(['Welcome to TechVidvan'])\n    c.close()\nif __name__ == '__main__':\n    par_c, chi_c = Pipe()\n    mp1 = multiprocessing.Process(target=exm_function, args=(chi_c,))\n    mp1.start()\nprint (par_c.recv() )\nmp1.join()\n<\/pre>\n<p><b>Output:<\/b><\/p>\n<div class=\"code-output\">[&#8216;Welcome to TechVidvan&#8217;]<\/div>\n<h3><span style=\"font-weight: 400\">What Purposes Do Queues Serve in Python Multiprocessing?<\/span><\/h3>\n<p><span style=\"font-weight: 400\">The FIFO (First-In-First-Out) principle is the foundation of the Python data structure known as the Queue. A queue aids in communication between various processes in Python multiprocessing, just like the Pipe does. It offers the put() and get() methods to add data to the queue and retrieve it. Here is an illustration of how Python&#8217;s queue can be used for multiprocessing. The function will be created using this code to determine if a number is even or odd and to add it to the queue. The procedure will then be started, and the numbers will be printed.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def even_no(num, n):\n    for i in num:\n        if i % 2 == 0:\n            n.put(i)\nif __name__ == \"__main__\":\n    n = multiprocessing.Queue()\n    p = multiprocessing.Process(target=even_no, args=(range(10), n))\n    p.start()\n    p.join()\nwhile n:\n    print(n.get())\n<\/pre>\n<p><b>Output:<\/b><\/p>\n<div class=\"code-output\">0<br \/>\n2<br \/>\n4<br \/>\n6<br \/>\n8<\/div>\n<h3><span style=\"font-weight: 400\">What is Queue class Python Multiprocessing? <\/span><\/h3>\n<p><span style=\"font-weight: 400\">A process is a running instance of computer software. Every Python program is executed in a process, which is a new instance of the Python interpreter. This process, known as MainProcess, executes the program&#8217;s commands using a single thread, known as the MainThread. Processes and threads are both created and managed by the underlying operating system.<\/span><\/p>\n<p><span style=\"font-weight: 400\">To run code concurrently, we may need to establish new child processes in our application\u2014Python&#8217;s multiprocessing. Process class enables users to create and control new processes.<\/span><\/p>\n<p><span style=\"font-weight: 400\">We frequently need to transfer data between processes when programming for several processors. Using a queue data structure is one way to share data.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Multiple processing. By initially constructing a class instance, the queue can be used. By default, this will establish an unbounded queue or a queue with no maximum size.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># created an unbounded queue\nqueue = multiprocessing.Queue()\n<\/pre>\n<h3><span style=\"font-weight: 400\">What is Lock Class Python Multiprocessing?<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Users can launch new processes and use the Python API thanks to the multiprocessing package for Python. This is similar to playing around with the threading module. It&#8217;s crucial to execute multiple tasks. We must load the multiprocessing module into the Python script to perform multiprocessing activities. In programming, issues could arise when two processes or threads try to access a shared resource like memory files or other data. Therefore, we need to use a lock to secure that access. The processor units can run the applications simultaneously by sharing the main memory and peripherals.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The multiprocessing application splits into more manageable chunks, each running independently. The operating system gives each process a processor. We use the multiprocessing Lock class to gain a lock on the process, preventing other processes from performing the same function until the lock is released.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The Lock class&#8217;s job is relatively straightforward. It enables code to claim a lock so that until the lock is released, no other process can run identical code. So, there are two main tasks for the Lock class. Both are unlocking and claiming the lock are possible. The acquire() function claims the lock, while the release() function is used to release the lock.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Processes can construct, acquire, and then release an instance of the lock before accessing a vital area.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#create lock\nlock = multiprocessing.Lock()\n# acquire the lock\nlock.acquire()\n# And release the lock\nlock.release()\n<\/pre>\n<p><span style=\"font-weight: 400\">The lock can only ever be held by one process at once. An acquired lock cannot be reclaimed if a process does not relinquish it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">If another process holds the lock and releases it, the process trying to acquire it will become blocked until it is acquired.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Setting the &#8220;blocking&#8221; option to False will try to obtain the lock without blocking. A value of False is returned if the lock cannot be acquired.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># acquire the lock without blocking\nlock.acquire(blocking=false)\n<\/pre>\n<h3><span style=\"font-weight: 400\">Conclusion<\/span><\/h3>\n<p>With this article, you have learned multiprocessing in Python and how to use it. Sharing CPU resources and ATM operations is the most practical multiprocessing application, as seen in the previous example. Multiprocessing in Python will surely catch on because it is simple to handle several processes. Therefore, gaining a thorough understanding and practical experience will be smart.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to Python&#8217;s built-in multiprocessing library, the system can execute numerous processes at once. It will make it possible to divide apps into smaller, independent threads. The operating system can then assign each of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":86961,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[4818],"class_list":["post-86871","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-multiprocessing-with-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Multiprocessing with Python - A Complete Guide - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn about multiprocessing in Python, its need and how to use it with example. See Multiprocessing Module, pipes, queue class etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multiprocessing with Python - A Complete Guide - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn about multiprocessing in Python, its need and how to use it with example. See Multiprocessing Module, pipes, queue class etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-27T03:30:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Multiprocessing with Python - A Complete Guide - TechVidvan","description":"Learn about multiprocessing in Python, its need and how to use it with example. See Multiprocessing Module, pipes, queue class etc.","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:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/","og_locale":"en_US","og_type":"article","og_title":"Multiprocessing with Python - A Complete Guide - TechVidvan","og_description":"Learn about multiprocessing in Python, its need and how to use it with example. See Multiprocessing Module, pipes, queue class etc.","og_url":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2023-01-27T03:30:55+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Multiprocessing with Python &#8211; A Complete Guide","datePublished":"2023-01-27T03:30:55+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/"},"wordCount":1379,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp","keywords":["Multiprocessing with Python"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/","url":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/","name":"Multiprocessing with Python - A Complete Guide - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp","datePublished":"2023-01-27T03:30:55+00:00","description":"Learn about multiprocessing in Python, its need and how to use it with example. See Multiprocessing Module, pipes, queue class etc.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/01\/multiprocessing-with-python.webp","width":1200,"height":628,"caption":"multiprocessing with python"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/multiprocessing-with-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Multiprocessing with Python &#8211; A Complete Guide"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/86871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=86871"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/86871\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/86961"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=86871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=86871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=86871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}