{"action":"created","issue":{"url":"https://api.github.com/repos/cloudyr/aws.s3/issues/56","repository_url":"https://api.github.com/repos/cloudyr/aws.s3","labels_url":"https://api.github.com/repos/cloudyr/aws.s3/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/cloudyr/aws.s3/issues/56/comments","events_url":"https://api.github.com/repos/cloudyr/aws.s3/issues/56/events","html_url":"https://github.com/cloudyr/aws.s3/issues/56","id":155518334,"number":56,"title":"Write CSV into Amazon S3 bucket without storing it on local machine.","user":{"login":"pruthvireddy","id":14994526,"avatar_url":"https://avatars2.githubusercontent.com/u/14994526?v=4","gravatar_id":"","url":"https://api.github.com/users/pruthvireddy","html_url":"https://github.com/pruthvireddy","followers_url":"https://api.github.com/users/pruthvireddy/followers","following_url":"https://api.github.com/users/pruthvireddy/following{/other_user}","gists_url":"https://api.github.com/users/pruthvireddy/gists{/gist_id}","starred_url":"https://api.github.com/users/pruthvireddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pruthvireddy/subscriptions","organizations_url":"https://api.github.com/users/pruthvireddy/orgs","repos_url":"https://api.github.com/users/pruthvireddy/repos","events_url":"https://api.github.com/users/pruthvireddy/events{/privacy}","received_events_url":"https://api.github.com/users/pruthvireddy/received_events","type":"User","site_admin":false},"labels":[{"id":158788145,"url":"https://api.github.com/repos/cloudyr/aws.s3/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"leeper","id":3505428,"avatar_url":"https://avatars3.githubusercontent.com/u/3505428?v=4","gravatar_id":"","url":"https://api.github.com/users/leeper","html_url":"https://github.com/leeper","followers_url":"https://api.github.com/users/leeper/followers","following_url":"https://api.github.com/users/leeper/following{/other_user}","gists_url":"https://api.github.com/users/leeper/gists{/gist_id}","starred_url":"https://api.github.com/users/leeper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeper/subscriptions","organizations_url":"https://api.github.com/users/leeper/orgs","repos_url":"https://api.github.com/users/leeper/repos","events_url":"https://api.github.com/users/leeper/events{/privacy}","received_events_url":"https://api.github.com/users/leeper/received_events","type":"User","site_admin":false},"assignees":[{"login":"leeper","id":3505428,"avatar_url":"https://avatars3.githubusercontent.com/u/3505428?v=4","gravatar_id":"","url":"https://api.github.com/users/leeper","html_url":"https://github.com/leeper","followers_url":"https://api.github.com/users/leeper/followers","following_url":"https://api.github.com/users/leeper/following{/other_user}","gists_url":"https://api.github.com/users/leeper/gists{/gist_id}","starred_url":"https://api.github.com/users/leeper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leeper/subscriptions","organizations_url":"https://api.github.com/users/leeper/orgs","repos_url":"https://api.github.com/users/leeper/repos","events_url":"https://api.github.com/users/leeper/events{/privacy}","received_events_url":"https://api.github.com/users/leeper/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-05-18T14:38:20Z","updated_at":"2018-02-01T17:48:14Z","closed_at":"2016-05-20T05:03:08Z","author_association":"NONE","body":"Can anyone help me on how to save a .csv file directly into Amazon s3 without saving it in local ?\n- Save a data frame directly into S3 as a csv.\n\nI tried this-\n\nput_object(file = \"sub_loc_imp.csv\", object = \"sub_loc_imp\", bucket = \"dev-sweep\")\n\nit popped an error-\n\nWarning message:\nIn parse_aws_s3_response(r, Sig) : Forbidden (HTTP 403).\n"},"comment":{"url":"https://api.github.com/repos/cloudyr/aws.s3/issues/comments/362346927","html_url":"https://github.com/cloudyr/aws.s3/issues/56#issuecomment-362346927","issue_url":"https://api.github.com/repos/cloudyr/aws.s3/issues/56","id":362346927,"user":{"login":"abhishekupadhyaya","id":8761854,"avatar_url":"https://avatars3.githubusercontent.com/u/8761854?v=4","gravatar_id":"","url":"https://api.github.com/users/abhishekupadhyaya","html_url":"https://github.com/abhishekupadhyaya","followers_url":"https://api.github.com/users/abhishekupadhyaya/followers","following_url":"https://api.github.com/users/abhishekupadhyaya/following{/other_user}","gists_url":"https://api.github.com/users/abhishekupadhyaya/gists{/gist_id}","starred_url":"https://api.github.com/users/abhishekupadhyaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhishekupadhyaya/subscriptions","organizations_url":"https://api.github.com/users/abhishekupadhyaya/orgs","repos_url":"https://api.github.com/users/abhishekupadhyaya/repos","events_url":"https://api.github.com/users/abhishekupadhyaya/events{/privacy}","received_events_url":"https://api.github.com/users/abhishekupadhyaya/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T17:48:14Z","updated_at":"2018-02-01T17:48:14Z","author_association":"NONE","body":"I use Pandas to save data as csv. So, the following code works in saving data as csv file in S3 bucket without saving locally.\r\n```\r\nfrom io import BytesIO\r\n\r\ncsv_buffer = BytesIO()\r\ncsv_df.to_csv(csv_buffer, index=False)\r\n\r\ns3client = boto3.client(\"s3\")\r\nresponse = s3client.put_object(\r\n\tBody=csv_buffer.getvalue(),\r\n\tContentType='application/vnd.ms-excel',\r\n\tBucket=bucket,\r\n\tKey=output_file_path,\r\n)\r\n```\r\n\r\n_Note: csv_df is pandas dataframe object_"}}
{"actor":{"display_login":"abhishekupadhyaya"}}