All Projects → brianloveswords → airtable

brianloveswords / airtable

Licence: MPL-2.0 license
Airtable API Client for Go

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to airtable

airtabler
R interface to the Airtable API
Stars: ✭ 84 (+236%)
Mutual labels:  api-client, airtable
redash-api-client
Redash API Client written in Python
Stars: ✭ 36 (+44%)
Mutual labels:  api-client
jacky
🐄 HTTP JSON API Client for Laravel & Lumen
Stars: ✭ 17 (-32%)
Mutual labels:  api-client
Jib.jl
A Julia implementation of Interactive Brokers API
Stars: ✭ 42 (+68%)
Mutual labels:  api-client
ssc-restapi-client
Communicate with Fortify Software Security Center through REST API in java, a swagger generated client
Stars: ✭ 13 (-48%)
Mutual labels:  api-client
wporg-client
Standalone HTTP client for public WordPress.org API.
Stars: ✭ 73 (+192%)
Mutual labels:  api-client
bitflyer-api-dotnet-client
bitFlyer HTTP APIs Client Library for .NET (C#)
Stars: ✭ 23 (-8%)
Mutual labels:  api-client
connectapi
An R package for interacting with the RStudio Connect Server API
Stars: ✭ 26 (+4%)
Mutual labels:  api-client
jellyfin-apiclient-python
Python API Client for Jellyfin
Stars: ✭ 30 (+20%)
Mutual labels:  api-client
pywnedpasswords
Checkt pwnedpasswords.com in a secure way
Stars: ✭ 22 (-12%)
Mutual labels:  api-client
dnsimple-python
The DNSimple API client for Python.
Stars: ✭ 66 (+164%)
Mutual labels:  api-client
backlog kit
Client library for the Nulab's Backlog API version 2 written in Ruby.
Stars: ✭ 28 (+12%)
Mutual labels:  api-client
NClient
💫 NClient is an automatic type-safe .Net HTTP client that allows you to call web service API methods using annotated interfaces or controllers without boilerplate code.
Stars: ✭ 25 (+0%)
Mutual labels:  api-client
Clamor
The Python Discord API Framework
Stars: ✭ 14 (-44%)
Mutual labels:  api-client
tiktok-scraper-php
Tiktok (Musically) PHP scraper
Stars: ✭ 65 (+160%)
Mutual labels:  api-client
pyFireEye
Python API bindings for FireEye Products
Stars: ✭ 12 (-52%)
Mutual labels:  api-client
braze-php-sdk
A PHP client to interact with Braze API
Stars: ✭ 15 (-40%)
Mutual labels:  api-client
closeio-api
Python API Client for Close
Stars: ✭ 53 (+112%)
Mutual labels:  api-client
go-typetalk
go-typetalk is a GO client library for accessing the Typetalk API.
Stars: ✭ 19 (-24%)
Mutual labels:  api-client
echovr api docs
Unofficial documentation for Echo VR's HTTP API
Stars: ✭ 19 (-24%)
Mutual labels:  api-client

airtable

Go package for interacting with the Airtable API.

License

Mozilla Public License 2.0

Install

$ go get github.com/brianloveswords/airtable

API Documentation

See airtable package documentation on godoc.org

Example Usage

package main

import (
    "fmt"
    "strings"
    "time"

    "github.com/brianloveswords/airtable"
)

type PublicDomainBookRecord struct {
    airtable.Record // provides ID, CreatedTime
    Fields          struct {
        Title       string `json:"Book Title"`
        Author      string
        Publication time.Time `json:"Publication Date"`
        FullText    string
        Rating      int
        Tags        airtable.MultiSelect
    }
}

// String shows the book record like "<title> by <author> [<rating>]"
func (r *PublicDomainBookRecord) String() string {
    f := r.Fields
    return fmt.Sprintf("%s by %s %s", f.Title, f.Author, r.Rating())
}

// Rating outputs a rating like [***··]
func (r *PublicDomainBookRecord) Rating() string {
    var (
        max    = 5
        rating = r.Fields.Rating
        stars  = strings.Repeat("*", rating)
        dots   = strings.Repeat("·", max-rating)
    )
    return fmt.Sprintf("[%s%s]", stars, dots)
}

func Example() {
    // Create the Airtable client with your APIKey and BaseID for the
    // base you want to interact with.
    client := airtable.Client{
        APIKey: "keyXXXXXXXXXXXXXX",
        BaseID: "appwNa5g4gHCVZQPm",
    }

    books := client.Table("Public Domain Books")

    bestBooks := []PublicDomainBookRecord{}
    books.List(&bestBooks, &airtable.Options{
        // The whole response would be huge because of FullText so we
        // should just get the title and author. NOTE: even though the
        // field is called "Book Title" in the JSON, we should use field
        // by the name we defined it in our struct.
        Fields: []string{"Title", "Author", "Rating"},

        // Only get books with a rating that's 4 or higher.
        Filter: `{Rating} >= 4`,

        // Let's sort from highest to lowest rating, then by author
        Sort: airtable.Sort{
            {"Rating", airtable.SortDesc},
            {"Author", airtable.SortAsc},
        },
    })

    fmt.Println("Best Public Domain Books:")
    for _, bookRecord := range bestBooks {
        fmt.Println(bookRecord.String())
    }

    // Let's prune our library of books we aren't super into.
    badBooks := []PublicDomainBookRecord{}
    books.List(&badBooks, &airtable.Options{
        Fields: []string{"Title", "Author", "Rating"},
        Filter: `{Rating} < 3`,
    })
    for _, badBook := range badBooks {
        fmt.Println("deleting", badBook)
        books.Delete(&badBook)
    }
}

Contributing

TBD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].