John Kitchin has another excellent post on leveraging Emacs and Org-mode. This time, he considers sharing data between Org-mode code blocks. Most Org-mode users know about naming code blocks and using the results of the computation in another code block but it turns out that the facilities for data sharing are much richer than that.
You can, for example, arrange that the results of a code block are not recalculated no matter how many times it’s called. Or if the block generates a huge amount of data or binary data, you can save it to a file and access the file from another block.
Kitchin covers these and other techniques. As he says, which technique you should use depends on the situation and what your data looks like. He lays out ways of sharing the data among blocks and leaves it to the users to pick the one most appropriate for their use case.
As is often the case with posts involving Org files, I found it easier to follow Kitchin’s post by reading actual Org source file. Happily, Kitchin always provides a link to those files so if you also like to see the original file, he makes it easy.
This is a great post and I recommend everyone using Org code blocks read it.