An Elementary Introduction to the Wolfram Language
43Storing Things
Cloud objects are immediately assigned a UUID:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
If youve made definitions using = and :=, you can save these using CloudSave. (If your definitions depend on other definitions, these will get saved too.) You can load your definitions into a new session using CloudGet.
Make a definition:
In[4]:=
Click for copyable input
Save it in the cloud to be retrieved later using CloudGet:
In[5]:=
Click for copyable input
Out[5]=
CloudPut lets you store single Wolfram Language expressions. But what if you want to progressively accumulate expressionscoming either from within the Wolfram Language, or, say, from an outside device or sensor?
The Wolfram Data Drop lets you do exactly this. You start by creating a databin. You can do this in the Wolfram Language using CreateDatabin.
Create a databin:
In[6]:=
Click for copyable input
Out[6]=
Add an entry to a databin:
In[7]:=
Click for copyable input
Out[7]=
Add another entry to the same databin:
In[8]:=
Click for copyable input
Out[8]=
In[9]:=
Click for copyable input
Out[9]=
Use a short ID to reference a databin connected to sensors on my desk:
In[10]:=
Click for copyable input
Out[10]=
In[11]:=
Click for copyable input
Out[11]=
Wolfram Data Drop, like CloudPut and CloudSave, saves data into the cloud. But particularly if youre not connected to the cloud, you may instead want to store things on a local computer. If you figure out where in your filesystem you want the files to go, you can use Put, Save and Get to store and retrieve them.
In[12]:=
Click for copyable input
Out[12]=
Put an image to the location:
In[13]:=
Click for copyable input
Out[13]=
Get the image back:
In[14]:=
Click for copyable input
Out[14]=
CloudObject[] create a cloud object
CloudPut[expr] put into the cloud
CloudGet[obj] get from the cloud
CloudSave[s] save definitions to the cloud
Databin["id"] a databin with accumulated data
CreateDatabin[] create a new databin
DatabinAdd[obj,value] add something to a databin
DateListPlot[data] make a date list plot
LocalObject[] create a local object
Put[expr,obj] put into a local object
Get[obj] get from a local object
What do the letters and numbers in UUIDs mean?
How does the number of possible UUIDs compare to other things?
All short IDs as generated by URLShorten are explicitly registered, and guaranteed to be unique, a bit like domain names on the internet. UUIDs are long enough that they can be assumed to be unique, even without any kind of central registration.
Yes. And the file name will be taken to be relative to your home directory in the cloud. The file will also get a URL, that includes the base of the cloud youre using, and your user ID.
Not usually. But if you set the option Permissions"Public" then everyone can access it, just like we discussed for web apps in Section 36. You can also define exactly who you want to allow to do what with it.
Can I work with databins without using the Wolfram Language?
Yes. You can use the web and many other systems to create and add to databins.
Yes. Make it a cloud expression (using CreateCloudExpression). Then all the usual ways of getting and setting parts of the expression will work, but the expression will be persistently stored in the cloud.
 
Download Notebook Version