{"id":12562,"date":"2016-05-20T12:15:34","date_gmt":"2016-05-20T09:15:34","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=12562"},"modified":"2016-05-19T12:17:45","modified_gmt":"2016-05-19T09:17:45","slug":"file-handling-amazon-s3-python-boto-library","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/","title":{"rendered":"File Handling in Amazon S3 with Python Boto Library"},"content":{"rendered":"<h2>1.Introduction<\/h2>\n<p>Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the objects are grouped under a name space called as \u201cbuckets\u201d. \u00a0The buckets are unique across entire AWS S3.<\/p>\n<p>Boto library is the official Python SDK for software development. \u00a0It provides APIs to work with AWS services like EC2, S3 and others.<\/p>\n<p>In this article we will focus on how to use Amzaon S3 for regular file handling operations using Python and Boto library.<\/p>\n<h2>2. Amzon\u00a0S3 &amp; Work Flows<\/h2>\n<p>In Amzaon S3, the user has to first create a bucket. \u00a0The bucket is a namespace, which is has a unique name across AWS. \u00a0The users can set access privileges to it based on their requirement. \u00a0The buckets can contain objects. \u00a0The objects are\u00a0referred as a key-value pair, where key is the identifier to operate on the object. \u00a0The key must be unique inside the bucket. \u00a0The object can be of any type. \u00a0It can be used to store strings, integers, JSON, text files, sequence files, binary files, picture &amp; videos. \u00a0To understand more about Amazon S3 Refer <a href=\"https:\/\/aws.amazon.com\/documentation\/s3\/\">Amazon Documentation<\/a>\u00a0[2].<\/p>\n<p>Following are the possible work flow of operations in Amazon S3:<\/p>\n<ul>\n<li>Create a Bucket<\/li>\n<li>Upload file to a bucket<\/li>\n<li>List the contents of a bucket<\/li>\n<li>Download a file from a bucket<\/li>\n<li>Move files across buckets<\/li>\n<li>Delete a file from bucket<\/li>\n<li>Delete a bucket<\/li>\n<\/ul>\n<h2>3. Python Boto Library<\/h2>\n<p>Boto library is the official Python SDK for software development. \u00a0It supports Python 2.7. \u00a0Work for Python 3.x is on going. \u00a0The code snippets in this article are developed using boto v2.x. \u00a0To install the boto library, pip command can be used as below:<\/p>\n<pre class=\"brush:php\">pip install -u boto<\/pre>\n<p>&nbsp;<\/p>\n<p>Also in the below code snippets, I have used connect_s3() API, by passing the access credentials as arguments. \u00a0This provides the connection object to work with. \u00a0But If you don\u2019t want to code \u00a0the access credentials in your program, there are other ways of do it. \u00a0We can create environmental variables for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. \u00a0The other way is to create a credential files and keep them under .aws directory in the name of \u201ccredentials\u201d in the users home directory. \u00a0 The file should contain the below:<\/p>\n<p>File Name : ~\/.aws\/credentials<\/p>\n<pre class=\"brush:php\">[default]\r\naws_access_key_id = ACCESS_KEY\r\naws_secret_access_key = SECRET_KEY<\/pre>\n<h2>4. S3 Work flow Automation<\/h2>\n<h4>4.1 Create a bucket<\/h4>\n<p>The first operation to be performed before any other operation to access the S3 is to create a bucket. \u00a0The <strong>create_bucket()<\/strong> api in connection object performs the same. \u00a0The bucket is the name space under which all the objects of the users can be stored.<\/p>\n<pre class=\"brush:php\">import boto\r\n\r\nkeyId = \"your_aws_key_id\"\r\nsKeyId=\"your_aws_secret_key_id\"\r\n#Connect to S3 with access credentials \r\nconn = boto.connect_s3(keyId,sKeyId)  \r\n\r\n#Create the bucket in a specific region.\r\nbucket = conn.create_bucket('mybucket001',location='us-west-2')<\/pre>\n<p>In <em><strong>create_bucket()<\/strong><\/em> api, the bucketname (\u2018mybucket001\u2019) is the mandatory parameter, which is the name of the bucket. \u00a0The <em><strong>location<\/strong><\/em> is optional parameter, if the location is not given, then bucket will be created in the default region of the user.<\/p>\n<p><em><strong>create_bucket()<\/strong><\/em> call might throw an error message, if a bucket with the same name already exists. \u00a0Also the bucket name is unique across the system. \u00a0Naming convention of the bucket is depend the rules enforced by the AWS region. \u00a0Generally, bucket name must be in lower case.<\/p>\n<h4>4.2 Upload a file<\/h4>\n<p>To upload a file into S3, we can use <em><strong>set_contents_from_file()<\/strong> <\/em>api of the Key object. \u00a0The Key object resides inside the bucket object.<\/p>\n<pre class=\"brush:php\">import boto\r\nfrom boto.s3.key import Key\r\n\r\nkeyId = \"your_aws_key_id\"\r\nsKeyId= \"your_aws_secret_key_id\"\r\n\r\nfileName=\"abcd.txt\"\r\nbucketName=\"mybucket001\"\r\nfile = open(fileName)\r\n\r\nconn = boto.connect_s3(keyId,sKeyId)\r\nbucket = conn.get_bucket(bucketName)\r\n#Get the Key object of the bucket\r\nk = Key(bucket)\r\n#Crete a new key with id as the name of the file\r\nk.key=fileName\r\n#Upload the file\r\nresult = k.set_contents_from_file(file)\r\n#result contains the size of the file uploaded<\/pre>\n<h4>4.3 Download a file<\/h4>\n<p>To download the file, we can use <em><strong>get_contents_to_file()<\/strong><\/em> api.<\/p>\n<pre class=\"brush:php\">import boto\r\nfrom boto.s3.key import Key\r\n\r\nkeyId =\"your_aws_key_id\"\r\nsKeyId=\"your_aws_secret_key_id\"\r\nsrcFileName=\"abc.txt\"\r\ndestFileName=\"s3_abc.txt\"\r\nbucketName=\"mybucket001\"\r\n\r\nconn = boto.connect_s3(keyId,sKeyId)\r\nbucket = conn.get_bucket(bucketName)\r\n\r\n#Get the Key object of the given key, in the bucket\r\nk = Key(bucket,srcFileName)\r\n\r\n#Get the contents of the key into a file \r\nk.get_contents_to_filename(destFileName)<\/pre>\n<h4>4.4 Move a file\u00a0from one bucket to another<\/h4>\n<p>We can achieve moving a file from one bucket to another, only by copying the object from one bucket to another. \u00a0The <strong><em>copy_key()<\/em><\/strong> api of bucket object, copies the object from a given bucket to local.<\/p>\n<pre class=\"brush:php\">import boto\r\n\r\nkeyId = \"your_aws_access_key_id\"\r\nsKeyId=\"your_aws_secret_key_id\"\r\n\r\nconn = boto.connect_s3(keyId,sKeyId)\r\nsrcBucket = conn.get_bucket('mybucket001')   #Source Bucket Object\r\ndstBucket = conn.get_bucket('mybucket002')   #Destination Bucket Object\r\nfileName = \"abc.txt\"\r\n#Call the copy_key() from destination bucket\r\ndstBucket.copy_key(fileName,srcBucket.name,fileName)<\/pre>\n<h4>\u00a04.5 Delete a file<\/h4>\n<p>To delete a file inside the object, we have to retrieve the key of the object and call the <em><strong>delete()<\/strong><\/em> API of the Key object. \u00a0The key object can be retrieved by calling <strong><em>Key()<\/em><\/strong> with bucket name and object name.<\/p>\n<pre class=\"brush:php\">import boto\r\nfrom boto.s3.key import Key\r\n\r\nkeyId = \"your_aws_access_key\"\r\nsKeyId = \"your_aws_secret_key\"\r\nsrcFileName=\"abc.txt\"      #Name of the file to be deleted\r\nbucketName=\"mybucket001\"   #Name of the bucket, where the file resides\r\n\r\nconn = boto.connect_s3(keyId,sKeyId)   #Connect to S3\r\nbucket = conn.get_bucket(bucketName)   #Get the bucket object\r\n\r\nk = Key(bucket,srcFileName)            #Get the key of the given object\r\n\r\nk.delete()                             #Delete the object<\/pre>\n<h4>4.6 Delete a bucket<\/h4>\n<p>The <em><strong>delete_bucket()<\/strong><\/em> api of the connection object deletes the given bucket in the parameter.<\/p>\n<pre class=\"brush:php\">import boto\r\n\r\nkeyId = \"your_aws_access_key_id\"\r\nsKeyId= \"your_aws_secret_key_id\"\r\nconn = boto.connect_s3(keyId,sKeyId)\r\nbucket = conn.delete_bucket('mybucket002')<\/pre>\n<p>The delete_bucket() call will\u00a0fail, if there are objects inside the bucket.<\/p>\n<h4>4.7 Empty a bucket<\/h4>\n<p>Emptying a bucket can be achieved by deleting all the objects indie the bucket. \u00a0The <em><strong>list()<\/strong><\/em> api of bucket object (bucket.list()) will provide all the objects inside the bucket. \u00a0By calling the <em><strong>delete()<\/strong> <\/em>api for those objects, we can delete them.<\/p>\n<pre class=\"brush:php\">import boto\r\n\r\nkeyId = \"your_aws_access_key_id\"\r\nsKeyId= \"your_aws_secret_key_id\"\r\n\r\nbucketName=\"mybucket002\"\r\nconn = boto.connect_s3(keyId,sKeyId)     #Connect to S3\r\nbucket = conn.get_bucket(bucketName)     #Get the bucket Object\r\n\r\nfor i in bucket.list():\r\n    print(i.key)\r\n    i.delete()                           #Delete the object<\/pre>\n<h3><\/h3>\n<h4>4.8 List All Buckets<\/h4>\n<p>The <strong><em>get_all_buckets()<\/em><\/strong> of the connection object returns list of all buckets for the user. \u00a0This can be used to validate existence of the bucket once you have created or deleted a bucket.<\/p>\n<pre class=\"brush:php\">import boto\r\n\r\nkeyId = \"your_aws_access_key_id\"\r\nsKeyId= \"your_aws_secret_key_id\"\r\n\r\nconn = boto.connect_s3(keyId,sKeyId)      #Connect to S3\r\nbuckets = conn.get_all_buckets()          #Get the bucket list\r\nfor i in buckets:\r\n    print(i.name)<\/pre>\n<h2>5 Summary<\/h2>\n<p>The boto library provides <strong><em>connection<\/em><\/strong> object, <strong><em>bucket<\/em><\/strong> object and <strong><em>key<\/em> <\/strong>object which exactly represents the design of S3. \u00a0By understanding various methods of these objects we can perform all the possible operations on S3 using this boto library.<\/p>\n<p>Hope this helps.<\/p>\n<h2>6. References<\/h2>\n<p>[1] Boto S3 API Documentation \u2013\u00a0<a href=\"http:\/\/boto.cloudhackers.com\/en\/latest\/ref\/s3.html\">http:\/\/boto.cloudhackers.com\/en\/latest\/ref\/s3.html<\/a><\/p>\n<p>[2] Amazon S3 Documention \u2013\u00a0<a href=\"https:\/\/aws.amazon.com\/documentation\/s3\/\">https:\/\/aws.amazon.com\/documentation\/s3\/<\/a><\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/techietweak.wordpress.com\/2016\/05\/16\/file-handling-in-aws-s3-with-python-boto-library\/\">File Handling in Amazon S3 with Python Boto Library<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Saravanan Subramanian at the <a href=\"http:\/\/techietweak.wordpress.com\/\">Saravanan Subramanian Tech Notes<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the objects are grouped under a name space called as \u201cbuckets\u201d. \u00a0The buckets are unique across entire AWS S3. Boto library is the official Python SDK for software development. \u00a0It provides &hellip;<\/p>\n","protected":false},"author":143,"featured_media":1651,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[325],"class_list":["post-12562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-amazon-aws"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/saravanan.subramanian.31\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-20T09:15:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Saravanan Subramanian\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tosarvan\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Saravanan Subramanian\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\"},\"author\":{\"name\":\"Saravanan Subramanian\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/56779276fba995e603f50ea6f18bdd8a\"},\"headline\":\"File Handling in Amazon S3 with Python Boto Library\",\"datePublished\":\"2016-05-20T09:15:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\"},\"wordCount\":867,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"keywords\":[\"Amazon AWS\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\",\"name\":\"File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"datePublished\":\"2016-05-20T09:15:34+00:00\",\"description\":\"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"File Handling in Amazon S3 with Python Boto Library\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/56779276fba995e603f50ea6f18bdd8a\",\"name\":\"Saravanan Subramanian\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5b5095370698b8a3f2dfd7ade5444c1b7ec66ed3f549b8a9dcda5580c3a80dd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5b5095370698b8a3f2dfd7ade5444c1b7ec66ed3f549b8a9dcda5580c3a80dd?s=96&d=mm&r=g\",\"caption\":\"Saravanan Subramanian\"},\"description\":\"Saravanan Subramanian is a System Architect cum Agile Product Owner for developing cloud based applications for service provider back office enterprise applications using open source technologies. He is passionate about Cloud Technology and Big Data Analytics.\",\"sameAs\":[\"http:\/\/techietweak.wordpress.com\/\",\"https:\/\/www.facebook.com\/saravanan.subramanian.31\",\"https:\/\/in.linkedin.com\/in\/tosarvan\",\"https:\/\/x.com\/tosarvan\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/saravanan-subramanian\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026","description":"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the","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:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/","og_locale":"en_US","og_type":"article","og_title":"File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026","og_description":"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the","og_url":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/saravanan.subramanian.31","article_published_time":"2016-05-20T09:15:34+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","type":"image\/jpeg"}],"author":"Saravanan Subramanian","twitter_card":"summary_large_image","twitter_creator":"@tosarvan","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Saravanan Subramanian","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/"},"author":{"name":"Saravanan Subramanian","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/56779276fba995e603f50ea6f18bdd8a"},"headline":"File Handling in Amazon S3 with Python Boto Library","datePublished":"2016-05-20T09:15:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/"},"wordCount":867,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","keywords":["Amazon AWS"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/","url":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/","name":"File Handling in Amazon S3 with Python Boto Library - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","datePublished":"2016-05-20T09:15:34+00:00","description":"1.Introduction Amazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. \u00a0It a general purpose object store, the","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/python\/file-handling-amazon-s3-python-boto-library\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/www.webcodegeeks.com\/category\/python\/"},{"@type":"ListItem","position":3,"name":"File Handling in Amazon S3 with Python Boto Library"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/56779276fba995e603f50ea6f18bdd8a","name":"Saravanan Subramanian","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5b5095370698b8a3f2dfd7ade5444c1b7ec66ed3f549b8a9dcda5580c3a80dd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5b5095370698b8a3f2dfd7ade5444c1b7ec66ed3f549b8a9dcda5580c3a80dd?s=96&d=mm&r=g","caption":"Saravanan Subramanian"},"description":"Saravanan Subramanian is a System Architect cum Agile Product Owner for developing cloud based applications for service provider back office enterprise applications using open source technologies. He is passionate about Cloud Technology and Big Data Analytics.","sameAs":["http:\/\/techietweak.wordpress.com\/","https:\/\/www.facebook.com\/saravanan.subramanian.31","https:\/\/in.linkedin.com\/in\/tosarvan","https:\/\/x.com\/tosarvan"],"url":"https:\/\/www.webcodegeeks.com\/author\/saravanan-subramanian\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/12562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/143"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=12562"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/12562\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/1651"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=12562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=12562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=12562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}