LoslegenKostenlos loslegen

Uploading a public report

As you saw in Chapter 1, Get It Done is an App that lets residents report problems like potholes and broken sidewalks.

The data from the app is a very hot topic political issue. Residents keep saying that the City does not distribute work evenly across neighborhoods when issues are reported. The City Council wants to be transparent with the public and has asked Sam to publish the aggregated Get It Done reports and make them publicly available.

Sam has initialized the boto3 S3 client and assigned it to the s3 variable.

In this exercise, you will help her increase government transparency by uploading public reports to the gid-staging bucket.

Diese Übung ist Teil des Kurses

Introduction to AWS Boto in Python

Kurs anzeigen

Anleitung zur Übung

  • Upload 'final_report.csv' to the 'gid-staging' bucket.
  • Set the key to '2019/final_report_2019_02_20.csv'.
  • Set the ACL to 'public-read'.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Upload the final_report.csv to gid-staging bucket
s3.upload_file(
  # Complete the filename
  Filename='./____', 
  # Set the key and bucket
  Key='____', 
  Bucket='____',
  # During upload, set ACL to public-read
  ____ = {
    '____': '____'})
Code bearbeiten und ausführen