🏠 back to Observable

writing from Observable to AWS S3 *CSV (or other object)

Inspired by database failed to fetch, I’d like to delve deeper into capacities for Observable to help quickly create interfaces for editing / updating data.

Let’s say that I have data stored as a *CSV file, and I’d like to change this data from time to time. Following @bgchen, I can do this by storing the data on a Google Spreadsheet, and edit it there, which will effect changes in my notebook. Similarly, I can host this data on GitHub and edit it there. But I would really like to make changes from within the notebook itself.

Using AWS S3 with an open CORS policy, I believe that any public user can theoretically ammend information on that objects (in this case, our .CSV file). Following @mike’s clarification, I can also limit my CORS policy to allow edits from only my notebook user. So this seems promising.

But now what?

Without added complications of security keys and secrets, is it correct that an AWS S3 open CORS data object can readily be edited within a notebook? If so, how?

If anyone has any suggestions, I’d really appreciate it. Also, if someone needs an open CORS bucket and random object, here’s one:

https://s3.amazonaws.com/testing.cors/object.csv

Thanks in advance for any help!

It looks like the AWS JS SDK will help, but I haven’t yet gotten any of the online examples working…

Some other references:

Also, just to note - Tom’s module debugger suggested first to try the global leak pattern for require

AWS = require('aws-sdk@2.519.0/lib/aws.js').catch(() => window["AWS"])

…but I found that just requiring the URL worked better:

AWS = require('https://sdk.amazonaws.com/js/aws-sdk-2.519.0.js')

… More soon!