Public
Edited
Oct 22, 2024
19 forks
21 stars
Insert cell
Insert cell
region = "us-east-1"
Insert cell
bucket = "pinyin"
Insert cell
Insert cell
Inputs.table(contents, {
columns: ["Key", "LastModified", "Owner", "Size"],
format: {
Owner: (d) => d.DisplayName,
Key: (d) => html`<a href="https://${bucket}.s3.amazonaws.com/${d}">${d}</a>`
}
})
Insert cell
// Either load the bucket contents or load the sample cached data
contents = client
? (await client.send(
new AWS.ListObjectsCommand({ Bucket: bucket, MaxKeys: 100 })
)).Contents
: FileAttachment("contents.json").json()
Insert cell
Insert cell
AWS = import("https://cdn.skypack.dev/@aws-sdk/client-s3@3.39.0")
Insert cell
client = {
try {
return new AWS.S3Client({
region,
credentials: {
accessKeyId: Secret("AWS_ACCESS_KEY_ID"),
secretAccessKey: Secret("AWS_SECRET_ACCESS_KEY")
}
})
} catch {
return false;
}
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more