The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Download Edit And Upload A CSV to S3

TODO: Pull subtitle into page object

TODO: scrub this to verify the includes are setup and pull it out of a function

code_start_default_section code_end_default_section

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Download Edit And Upload A CSV to S3

-- p

TODO: scrub this to verify the includes are setup and pull it out of a function

-- code/

import boto3
import csv

from io import StringIO


    def process_csv_files(self):
        print("-- Processing CSV Files")
        for attachment in self.attachments:
            print(attachment['name'])
            raw_string = s3.get_object(Bucket=self.bucket, Key=attachment['original_key'])['Body'].read().decode('utf-8')
            lines = raw_string.splitlines()
            csv_reader = csv.reader(lines)
            new_csv_data = StringIO()
            csv_writer = csv.writer(new_csv_data)
            for row in csv_reader:
                csv_writer.writerow(['asdf'])
            s3.put_object(Body=new_csv_data.getvalue(), Bucket=self.bucket, Key=attachment['finalized_key'])

-- /code


-- categories
-- Python

-- metadata
-- date: 2021-12-08 23:42:47
-- id: 2229lqoh
-- status: draft
-- type: post
-- SCRUBBED_NEO: false
-- site: aws