{"id":1935,"date":"2016-06-24T19:03:33","date_gmt":"2016-06-24T10:03:33","guid":{"rendered":"http:\/\/avinton.com\/?page_id=1935"},"modified":"2023-01-11T16:31:50","modified_gmt":"2023-01-11T07:31:50","slug":"python-redis-postgresql","status":"publish","type":"page","link":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/","title":{"rendered":"Python with Redis &#038; PostgreSQL"},"content":{"rendered":"<h3>Pre-Requisites<\/h3>\n<p>1.\u00a0<a href=\"https:\/\/docs.python.org\/3\/using\/index.html\" target=\"_blank\" rel=\"noopener\">Setup Python<\/a><br \/>\n2. <a href=\"https:\/\/avinton.com\/en\/academy\/redis\/\" target=\"_blank\" rel=\"noopener\">Setup Redis<\/a><\/p>\n<p><\/br><\/p>\n<h3>Install Redis Library for Python<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo pip install redis\n<\/pre>\n<p><\/br><\/p>\n<h3>Redis Test Program<\/h3>\n<p>Create a small python application to test your connection from Python to Redis<\/p>\n<p>Create a file called redis_test.py in your home directory<br \/>\nPut the following lines of code in this new file.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport redis\nr = redis.StrictRedis(host='localhost', port=6379, db=0)\nr.set('foo', 'bar')\nprint(r.get('foo'))\n<\/pre>\n<p><\/br><\/p>\n<p>Run the code by typing python redis_test.py<\/p>\n<p><\/br><\/p>\n<p>This should return the value for the key &#8216;foo&#8217; (&#8216;bar&#8217;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application to test your connection from Python to Redis Create a file called redis_test.py in your home directory Put the following lines of code in this new file. import redis r = redis.StrictRedis(host=&#8217;localhost&#8217;,<br \/><a href=\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\" class=\"more\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1906,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1935","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python with Redis &amp; PostgreSQL - Avinton Japan<\/title>\n<meta name=\"description\" content=\"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python with Redis &amp; PostgreSQL - Avinton Japan\" \/>\n<meta property=\"og:description\" content=\"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Avinton Japan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Avintons\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-11T07:31:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/avinton.com\/wp-content\/uploads\/2020\/02\/avinton-japan-big-data.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@AvintonJapan\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\",\"url\":\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\",\"name\":\"Python with Redis & PostgreSQL - Avinton Japan\",\"isPartOf\":{\"@id\":\"https:\/\/avinton.com\/en\/#website\"},\"datePublished\":\"2016-06-24T10:03:33+00:00\",\"dateModified\":\"2023-01-11T07:31:50+00:00\",\"description\":\"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application\",\"breadcrumb\":{\"@id\":\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/avinton.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Avinton Academy\",\"item\":\"https:\/\/avinton.com\/en\/academy\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python with Redis &#038; PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/avinton.com\/en\/#website\",\"url\":\"https:\/\/avinton.com\/en\/\",\"name\":\"Avinton Japan\",\"description\":\"Tailored Solutions and Consulting in AI and Big Data\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/avinton.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python with Redis & PostgreSQL - Avinton Japan","description":"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application","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:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"Python with Redis & PostgreSQL - Avinton Japan","og_description":"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application","og_url":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/","og_site_name":"Avinton Japan","article_publisher":"https:\/\/www.facebook.com\/Avintons\/","article_modified_time":"2023-01-11T07:31:50+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/avinton.com\/wp-content\/uploads\/2020\/02\/avinton-japan-big-data.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@AvintonJapan","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/","url":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/","name":"Python with Redis & PostgreSQL - Avinton Japan","isPartOf":{"@id":"https:\/\/avinton.com\/en\/#website"},"datePublished":"2016-06-24T10:03:33+00:00","dateModified":"2023-01-11T07:31:50+00:00","description":"Pre-Requisites 1.\u00a0Setup Python 2. Setup Redis Install Redis Library for Python sudo pip install redis Redis Test Program Create a small python application","breadcrumb":{"@id":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/avinton.com\/en\/academy\/python-redis-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/avinton.com\/en\/"},{"@type":"ListItem","position":2,"name":"Avinton Academy","item":"https:\/\/avinton.com\/en\/academy\/"},{"@type":"ListItem","position":3,"name":"Python with Redis &#038; PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/avinton.com\/en\/#website","url":"https:\/\/avinton.com\/en\/","name":"Avinton Japan","description":"Tailored Solutions and Consulting in AI and Big Data","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/avinton.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/comments?post=1935"}],"version-history":[{"count":9,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1935\/revisions"}],"predecessor-version":[{"id":75819,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1935\/revisions\/75819"}],"up":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1906"}],"wp:attachment":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/media?parent=1935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/categories?post=1935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/tags?post=1935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}