{"id":24130,"date":"2020-10-13T09:49:50","date_gmt":"2020-10-13T16:49:50","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=24130"},"modified":"2023-12-01T04:01:32","modified_gmt":"2023-12-01T12:01:32","slug":"python-beyond-top-level-package-error-in-relative-import","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/","title":{"rendered":"Python beyond top level package error in relative import Solution"},"content":{"rendered":"\n<p>You can <a href=\"https:\/\/careerkarma.com\/blog\/python-import\/\">import packages<\/a> relatively inside a Python project. If you make a mistake in importing a package relatively, you\u2019ll encounter the <code>beyond top level package error in relative import<\/code> error.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss what this error means and why it is raised. We\u2019ll walk through an example of this error to help you learn how to successfully write a relative import statement in your project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">beyond top level package error in relative import<\/h2>\n\n\n\n<p>A relative import uses the name of a module to determine its location.<br><\/p>\n\n\n\n<p>Consider the following relative import:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from .. import app<\/pre><\/div>\n\n\n\n<p>This will import the \u201capp\u201d <a href=\"https:\/\/careerkarma.com\/blog\/python-modules\/\">Python module<\/a> from the directory above the folder in which the program with this import statement is written.<br><\/p>\n\n\n\n<p>Let\u2019s say that this file was called \u201cprogram.py\u201d and was contained within a folder called \u201capp\u201d. Our main project is called \u201ccake\u201d. Our file structure would look like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>run.py\ncake\/program\/__init__.py\ncake\/program\/app.py\ncake\/program\/app\/__init__.py\ncake\/program\/app\/program.py<\/pre><\/div>\n\n\n\n<p>When we run the \u201cprogram.py\u201d file, Python sees our import statement as:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from program import app<\/pre><\/div>\n\n\n\n<p>We import from the \u201cprogram\u201d folder rather than from our current working directory (the folder we are viewing).<br><\/p>\n\n\n\n<p>This is because \u201cprogram\u201d is two directories behind the one we are viewing. The __init__.py files tell Python that we are working with our own Python packages. This file is empty in both cases.<br><\/p>\n\n\n\n<p>Your programs must use this structure, otherwise you\u2019ll encounter an error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">An Example Scenario<\/h2>\n\n\n\n<p>We have a project called \u201ccake\u201d which prints out the statement \u201cI like cake!\u201d to the console. This project is going to get more complicated so we are using modules to divide up our code.<br><\/p>\n\n\n\n<p>The file structure for our project looks like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>app.py\n__init__.py\nprinter.py\napp\/__init__.py\napp\/program.py<\/pre><\/div>\n\n\n\n<p>This code is all in a folder called \u201ccake\u201d. Inside our app.py file, we have a statement that imports our program.py file:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import app.program<\/pre><\/div>\n\n\n\n<p>This is a standard import statement. Inside the app\/program.py file, we have a relative import statement:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from .. import printer<\/pre><\/div>\n\n\n\n<p>This code imports the file \u201cprinter\u201d from the directory above app\/. The directory above app\/ is the main directory for our project.&nbsp;<br><\/p>\n\n\n\n<p>Our printer.py file contains a <a href=\"https:\/\/careerkarma.com\/blog\/python-print-without-new-line\/\">print statement<\/a>:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(&quot;I like cake!&quot;)<\/pre><\/div>\n\n\n\n<p>Let\u2019s try to run our program to see if it works. We\u2019re going to run our app.py file because it is the main file for our project:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>python3 app.py<\/pre><\/div>\n\n\n\n<p>When we run this file, we see the following message:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Traceback (most recent call last):\n  File &quot;app.py&quot;, line 1, in &lt;module&gt;\n\timport app.program\n  File &quot;\/Users\/James\/cake\/app\/program.py&quot;, line 1, in &lt;module&gt;\n\tfrom .. import printer\nValueError: attempted relative import beyond top-level package<\/pre><\/div>\n\n\n\n<p>Our program.py file cannot import our \u201cprinter\u201d module.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>We\u2019re trying to import \u201cprinter\u201d into our \u201capp.program\u201d file. This is an issue because \u201cprinter\u201d itself is not in a package. Relative imports only work within packages.<br><\/p>\n\n\n\n<p>To solve this issue, we need to change the directory structure of our project. We need to add our \u201cprinter\u201d file and our \u201capp\u201d folder into its own directory so that \u201cprinter\u201d is in a package. This will let us reference our \u201cprinter\u201d file in the \u201capp\u201d folder.<br><\/p>\n\n\n\n<p>We can keep our app.py file in its current directory because it will reference our subdirectories.<br><\/p>\n\n\n\n<p>Let\u2019s move all of our files, excluding app.py, into a new folder:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>app.py\ncake\/__init__.py\ncake\/printer.py\ncake\/app\/__init__.py\ncake\/app\/program.py<\/pre><\/div>\n\n\n\n<p>All of our project files, aside from app.py, are in a new folder called \u201ccake\u201d. We need to modify our app.py file so that we reference the \u201ccake\u201d module:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import cake.app.program<\/pre><\/div>\n\n\n\n<p>This will import the \u201cprogram\u201d file that is in the cake\/app directory.<br><\/p>\n\n\n\n<p>Now that our printer.py file is in its own package, we should be able to successfully run our project. program.py should be able to access printer.py because both files are in a package.<br><\/p>\n\n\n\n<p>Let\u2019s run our code and see what happens:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>I like cake!<\/pre><\/div>\n\n\n\n<p>Our program successfully prints the message \u201cI like cake!\u201d to the console. This message is defined in printer.py, as we talked about earlier.<br><\/p>\n\n\n\n<p>This tells us that our program.py file was able to successfully import the printer.py file. When we imported the file, its contents were executed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>beyond top level package error in relative import<\/code> error occurs when you use a relative import without the file you are importing being part of a package. To fix this error, make sure that any directories that you import relatively are in their own packages.<br><\/p>\n\n\n\n<p>You now have the resources you need to solve this common Python error <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">like a pro<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"You can import packages relatively inside a Python project. If you make a mistake in importing a package relatively, you\u2019ll encounter the beyond top level package error in relative import error. In this guide, we\u2019re going to discuss what this error means and why it is raised. We\u2019ll walk through an example of this error&hellip;","protected":false},"author":240,"featured_media":18513,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-24130","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":[]},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python beyond top level package error in relative import | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python beyond top level package error in relative import Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-13T16:49:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:01:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python beyond top level package error in relative import Solution\",\"datePublished\":\"2020-10-13T16:49:50+00:00\",\"dateModified\":\"2023-12-01T12:01:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\"},\"wordCount\":706,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\",\"name\":\"Python beyond top level package error in relative import | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg\",\"datePublished\":\"2020-10-13T16:49:50+00:00\",\"dateModified\":\"2023-12-01T12:01:32+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python beyond top level package error in relative import Solution\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python beyond top level package error in relative import | Career Karma","description":"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.","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:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/","og_locale":"en_US","og_type":"article","og_title":"Python beyond top level package error in relative import Solution","og_description":"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.","og_url":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-10-13T16:49:50+00:00","article_modified_time":"2023-12-01T12:01:32+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python beyond top level package error in relative import Solution","datePublished":"2020-10-13T16:49:50+00:00","dateModified":"2023-12-01T12:01:32+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/"},"wordCount":706,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/","url":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/","name":"Python beyond top level package error in relative import | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg","datePublished":"2020-10-13T16:49:50+00:00","dateModified":"2023-12-01T12:01:32+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about the Python beyond top level package error in relative import error, why the error is raised, and how to solve the error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/sergey-zolkin-_UeY8aTI6d0-unsplash.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-beyond-top-level-package-error-in-relative-import\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python beyond top level package error in relative import Solution"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=24130"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24130\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18513"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=24130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=24130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=24130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}