Help

Airtable.jl - An Airtable package for the julia programming language

Topic Labels: API
933 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Kevin_Bonham
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi Everyone, I’m pleased to present Airtable.jl, a wrapper of the API for the julia programming language.

It’s a pretty simple little package, but it’s my first time working in any depth with a WebAPI, so I’m pretty pleased to have it working as well as it does. Currently, it has support for get, post, patch and delete methods, and a special function query that is basically get, but handles pagination in the response.

Please take a look at the docs, and feel free to open issues if you run into any problems!

Here’s an example of what you can do, using this dummy table:

julia> using Airtable

julia> cred = Airtable.Credential() # Pulls from environmental variable "AIRTABLE_KEY"
Airtable.Credential(<secrets>)

julia> abase = AirBase("appphImnhJO8AXmmo")
Airtable Base 'appphImnhJO8AXmmo'

julia> tab = AirTable("Table 1", abase)
AirTable("Table 1")

julia> records = Airtable.query(tab)
3-element Vector{AirRecord}:
 AirRecord("recMc1HOSIxQPJyyc", AirTable("Table 1"), (Name = "Record 1", Notes = "Keep this\n", Status = "Todo", Keep = true, CI = "N/A"))
 AirRecord("recMwT4P4tKlSLJoH", AirTable("Table 1"), (Name = "Record 2", Notes = "Also keep this", Status = "In progress", Keep = true, CI = "N/A"))
 AirRecord("recSStgr3yJnQc2Wg", AirTable("Table 1"), (Name = "Record 3", Status = "Done", Keep = true, CI = "N/A"))

julia> Airtable.query(tab; filterByFormula="{Status}='Todo'")
1-element Vector{AirRecord}:
 AirRecord("recMc1HOSIxQPJyyc", AirTable("Table 1"), (Name = "Record 1", Notes = "Keep this\n", Status = "Todo", Keep = true, CI = "N/A"))

julia> resp = Airtable.post!(tab, (; Name = "Some record", Status="Todo"))
AirRecord("recktAILkVMB7huKl", AirTable("Table 1"), (Name = "Some record", Status = "Todo"))

julia> Airtable.query(tab; filterByFormula="{Status}='Todo'")
2-element Vector{AirRecord}:
 AirRecord("recMc1HOSIxQPJyyc", AirTable("Table 1"), (Name = "Record 1", Notes = "Keep this\n", Status = "Todo", Keep = true, CI = "N/A"))
 AirRecord("recktAILkVMB7huKl", AirTable("Table 1"), (Name = "Some record", Status = "Todo"))

julia> Airtable.patch!(resp, (; Status = "In progress"))
AirRecord("recktAILkVMB7huKl", AirTable("Table 1"), (Name = "Some record", Status = "In progress"))

julia> Airtable.delete!(resp)
JSON3.Object{Base.CodeUnits{UInt8, String}, Vector{UInt64}} with 2 entries:
  :deleted => true
  :id      => "recktAILkVMB7huKl"
0 Replies 0