{"id":20245,"date":"2020-07-25T05:55:11","date_gmt":"2020-07-25T12:55:11","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=20245"},"modified":"2023-12-01T03:56:10","modified_gmt":"2023-12-01T11:56:10","slug":"python-environment-variables","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/","title":{"rendered":"How to Use Python Environment Variables"},"content":{"rendered":"\n<p>When you\u2019re developing across different environments, you may want to specify different configuration values for each environment. The computer on which you developed an application will not be the same as the one on which you deploy an application.<br><\/p>\n\n\n\n<p>That\u2019s where environment variables come into use!<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to talk about what environment variables are and how they can be used. We\u2019ll walk through an example of Python environment variables to help you get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is an Environment Variable?<\/h2>\n\n\n\n<p>An environment variable is a <a href=\"https:\/\/careerkarma.com\/blog\/python-variables\/\">variable<\/a> whose value is set outside of a program.<br><\/p>\n\n\n\n<p>Environment variables allow you to set different values for a variable depending on the environment in which you are building an application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Are Environment Variables Used?<\/h2>\n\n\n\n<p>Many applications, especially collaborative ones, have multiple different environments. One environment will be used for testing, another for production, and yet another for development. These environments often have different configuration values that need to be set.<br><\/p>\n\n\n\n<p>The application programming interface (API) keys that you use in production are probably not going to be the same as the ones you use on your local machine. You may use dummy data on your local machine when building an application, but this is not appropriate in a production environment.<br><\/p>\n\n\n\n<p>The value of an environmental variable can be changed without altering your program. This means that you can easily deploy changes to your code without having to substitute configuration values for a new environment.<br><\/p>\n\n\n\n<p>Environment variables are also used for security purposes. Writing API keys and config values inside a main program can be risky because everyone on a project can see them. If you state a value inside an environment variable, only your program and the developer who set the variable will be able to access it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Set an Environment Variable<\/h2>\n\n\n\n<p>Let\u2019s begin by creating an environment variable. An environment variable will only last until your Python session is over. This means that once you close your Python interpreter, the variable will be reset in your Python scripts.<br><\/p>\n\n\n\n<p>We\u2019re building an app that uses the Airtable API. We are going to share our code on GitHub so we don\u2019t want our API key to be shown to the public. To add our API key to our code without sharing it publicly, we are going to use an environment variable.<br><\/p>\n\n\n\n<p>The first step is to import the os library:<br><\/p>\n\n\n\n<p><code>import os<br><\/code><\/p>\n\n\n\n<p>This library contains the code for working with Python environment variables. Next, we are going to set an environment variable:<br><\/p>\n\n\n\n<p><code>Os.environ[\u201cAIRTABLE_KEY\u201d] = \u201cYOUR_API_KEY\u201d<br><\/code><\/p>\n\n\n\n<p>This code will set a variable called AIRTABLE_KEY. Its value is <code>YOUR_API_KEY<\/code>. Assigning an environment variable works similar to how you change values in a <a href=\"https:\/\/careerkarma.com\/blog\/python-dictionary-values\/\">dictionary<\/a>.<br><\/p>\n\n\n\n<p>You need to specify the name of the variable you want to set or change, followed by an equals sign, then the value you want to assign to the variable.<br><\/p>\n\n\n\n<p>The same syntax can be used to change an environment variable:<br><\/p>\n\n\n\n<p><code>os.environ[\u201cAIRTABLE_KEY\u201d] = \u201cYOUR_API_KEY_2\u201d<br><\/code><\/p>\n\n\n\n<p>The value of our API key has changed to <code>YOUR_API_KEY_2<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Retrieve an Environment Variable<\/h2>\n\n\n\n<p>We\u2019ve just set an environment variable. The question on your mind is probably: how can we retrieve the value? That\u2019s where we can use the <code>os.environ.get() <\/code>method.<br><\/p>\n\n\n\n<p>Let\u2019s retrieve the value of our <code>AIRTABLE_KEY<\/code> variable:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>api_key = os.environ.get(&quot;AIRTABLE_KEY&quot;)\nprint(api_key)\n<\/pre><\/div>\n\n\n\n<p>We have stated that we want to get the value of the <code>AIRTABLE_KEY <\/code>environment variable. We assign this value to a new variable called <code>api_key<\/code> and then print it to the console.<br><\/p>\n\n\n\n<p>Our code returns: <code>YOUR_API_KEY_2<\/code>.<br><\/p>\n\n\n\n<p>You can retrieve a list of all the environment variables you have set by printing the contents of os.environ to the console:<br><\/p>\n\n\n\n<p><code>print(os.environ)<br><\/code><\/p>\n\n\n\n<p>There are a number of default environment variables set inside Python. This means that printing out all the environment variables set inside a Python program may return a long list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Delete an Environment Variable<\/h2>\n\n\n\n<p>You can delete environment variables inside a Python project. This can be accomplished using the <code>os.environ.pop()<\/code> method. Let\u2019s delete our <code>AIRTABLE_KEY<\/code> environment variable:<br><\/p>\n\n\n\n<p><code>os.environ.pop(\u201cAIRTABLE_KEY\u201d)<br><\/code><\/p>\n\n\n\n<p>This code removes the <code>AIRTABLE_KEY <\/code>environment variable.<br><\/p>\n\n\n\n<p>It\u2019s impractical to do this if you want to clear multiple environment variables. If you are starting a new instance of a project, or want to reset all the environment variables in your session, you could have dozens of values to override.<br><\/p>\n\n\n\n<p>That\u2019s where the <code>clear()<\/code> method comes in handy. Let&#8217;s remove all the environment variables in our session:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>os.environ.clear()\nprint(os.environ)\n<\/pre><\/div>\n\n\n\n<p>This code clears the values of all environment variables. Then, it prints a list of all the environment variables in our session:<br><\/p>\n\n\n\n<p><code>{}<br><\/code><\/p>\n\n\n\n<p>Python sets some default environment variables which may be needed by your project.<br><\/p>\n\n\n\n<p>You should only use the <code>clear() <\/code>method if you are confident that you do not need any of the environment variables in a program anymore. Using the <code>pop()<\/code> method is preferred because it is more specific.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Set Environment Variables Using Dotenv<\/h2>\n\n\n\n<p>The dotenv library provides a number of useful functions for managing environment variables.<br><\/p>\n\n\n\n<p>Notably, dotenv allows you to read environment variables from a <a href=\"https:\/\/careerkarma.com\/blog\/python-read-file\/\">file<\/a>. This means that you do not need to declare them inside a Python shell.<br><\/p>\n\n\n\n<p>Reading environment variables from a module file is more convenient if you have a lot of values to read. It also makes it easier to manage variables if you need to change their values.<br><\/p>\n\n\n\n<p>To work with the dotenv package, you will need to install it. You can do this using either easy_install or pip.<br><\/p>\n\n\n\n<p>Let\u2019s start by defining an environment variable. To do this, we are going to create a file called .env. We can create this file from the command line using the touch command:<br><\/p>\n\n\n\n<p><code>touch .env<br><\/code><\/p>\n\n\n\n<p>Open up your .env file and add in the following contents:<br><\/p>\n\n\n\n<p><code>AIRTABLE_KEY=YOUR_API_KEY_3<br><\/code><\/p>\n\n\n\n<p>Environment variables are assigned like any other variable. On the left side of the equals sign, you have the name of the variable. On the right side, you have the value that variable will store. These two values are separated by an equals sign.<br><\/p>\n\n\n\n<p>Next, we\u2019re going to load our variables into a file:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>from dotenv import load_dotenv\n\nload_dotenv()\n<\/pre><\/div>\n\n\n\n<p>This code imports the <code>load_dotenv()<\/code> method from the dotenv library and executes it. This will read all the variables in our .env file into our environment.<br><\/p>\n\n\n\n<p>Next, let\u2019s try to retrieve our variable using the os library:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import os\n\napi_key = os.environ.get(&quot;AIRTABLE_KEY&quot;)\nprint(api_key)\n<\/pre><\/div>\n\n\n\n<p>Our code returns: <code>YOUR_API_KEY_3<\/code>. Our API key was set inside our .env file. The <code>load_dotenv()<\/code> method loaded our environment variables and made them accessible using the os.environ method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Environment variables are predefined values which are used to configure a value outside of a program. They are commonly used to set up different environments, hence their name.&nbsp;<br><\/p>\n\n\n\n<p>Environment variables are a secure way to set secret values. You would not want to directly add an API key in your application code because it would be readable to everyone who sees your application. You can set it in an environment variable so that only you and your program can see the value.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to start working with environment variables in Python code like a professional!<br><\/p>\n","protected":false},"excerpt":{"rendered":"When you\u2019re developing across different environments, you may want to specify different configuration values for each environment. The computer on which you developed an application will not be the same as the one on which you deploy an application. That\u2019s where environment variables come into use! In this guide, we\u2019re going to talk about what&hellip;","protected":false},"author":240,"featured_media":18039,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-20245","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>How to Use Python Environment Variables | Career Karma<\/title>\n<meta name=\"description\" content=\"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.\" \/>\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-environment-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Python Environment Variables\" \/>\n<meta property=\"og:description\" content=\"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\" \/>\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-07-25T12:55:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:56:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Use Python Environment Variables\",\"datePublished\":\"2020-07-25T12:55:11+00:00\",\"dateModified\":\"2023-12-01T11:56:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\"},\"wordCount\":1166,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\",\"name\":\"How to Use Python Environment Variables | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg\",\"datePublished\":\"2020-07-25T12:55:11+00:00\",\"dateModified\":\"2023-12-01T11:56:10+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#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\":\"How to Use Python Environment Variables\"}]},{\"@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":"How to Use Python Environment Variables | Career Karma","description":"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.","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-environment-variables\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Python Environment Variables","og_description":"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.","og_url":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-07-25T12:55:11+00:00","article_modified_time":"2023-12-01T11:56:10+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Use Python Environment Variables","datePublished":"2020-07-25T12:55:11+00:00","dateModified":"2023-12-01T11:56:10+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/"},"wordCount":1166,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-environment-variables\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/","url":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/","name":"How to Use Python Environment Variables | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg","datePublished":"2020-07-25T12:55:11+00:00","dateModified":"2023-12-01T11:56:10+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Environment variables allow you to define values outside of a program. On Career Karma, learn how to create, update, manage, and delete Python environment variables.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-environment-variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/arnold-francisca-f77Bh3inUpE-unsplash.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-environment-variables\/#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":"How to Use Python Environment Variables"}]},{"@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\/20245","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=20245"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/20245\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18039"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=20245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=20245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=20245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}