VKCComputing.jl

Documentation for VKCComputing.

Setup environment

VKCComputing.set_airtable_dir!Function
set_airtable_dir!(key)

Sets local preferences for airtable_dir to key (defaults to the environmental variable "AIRTABLE_DIR" if set).

source
VKCComputing.set_readonly_pat!Function
set_readonly_pat!(key)

Sets local preferences for readonly_pat to key (defaults to the environmental variable "AIRTABLE_KEY" if set).

source
VKCComputing.set_readwrite_pat!Function
set_readwrite_pat!(key)

Sets local preferences for readwrite_pat to key (defaults to the environmental variable "AIRTABLE_RW_KEY" if set).

source

Interacting with Airtable

VKCComputing.LocalBaseType
LocalBase(; update=Month(1))

Load the airtable sample database into memory. Requires that an airtable key with read access and a directory for storing local files are set to preferences. (see set_readonly_pat! and set_airtable_dir!.

Updating local base files

The update keyword argument can take a number of different forms.

  1. A boolean value, which will cause updates to all tables if true, and no tables if false.
  2. An AbstractTime from Dates (eg Week(1)), which will update any table whose local copy was last updated longer ago than this value.
  3. A vector of Pairs of the form "$table_name"=> x, where x is either of the options from (1) or (2) above.

For example, to update the "Biospecimens" table if it's older than a week, and to update the "Projects" table no matter what, call

julia> using VKCComputing, Dates

julia> base = LocalBase(; update=["Biospecimens"=> Week(1), "Projects"=> true]);

Indexing

Indexing into the local base can be done either with the name of a table (eg base["Biospecimens"]), which will return a VKCAirtable, or using a record ID hash (eg base["recUqEcu3pM8p2jzQ"]).

Warning

Note that record ID hashes are identified based on the regular expression r"^rec[A-Za-z0-9]{14}$" - that is, a string starting with "rec", followed by exactly 14 alphanumeric characters. In principle, one could name a table as something that matches this regular expression, causing it to be improperly identified as a record hash rather than a table name.

VCKAirtables can also be indexed with the uid column string, so an individual record can be accessed using eg base["Projects"]["khula"], but a 2-argument indexing option is provided for convenience, eg base["Projects", "khula"].

source