google

Version, currently main branch1 version
  • main branchlatestMay 20, 2025

github.com/jgaskins/google

Crystal implementation of various Google APIs

5 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  google:
    github: jgaskins/google
    branch: main

main is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
1.13.0
License
MIT
Author
Jamie Gaskins

Dependencies

Runtime Dependencies

  • jwt*github: crystal-community/jwt
  • msgpack*github: crystal-community/msgpack-crystal
  • http_client*github: jgaskins/http_client
  • json-schema*github: spider-gazelle/json-schema
  • openssl_ext*github: spider-gazelle/openssl_ext

README

google

Crystal implementations of various Google API clients.

Currently supported APIs:

  • Auth (limited)
  • Calendar (getting there)
  • Cloud Storage/GCS
  • Drive (limited)
  • GenerativeAI/Gemini
  • Gmail
  • Maps (vestigial)
  • People (self-identification only)
  • Places
  • Tasks

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      google:
        github: jgaskins/google
  2. Run shards install

Usage

require "google"

Load the specific Google API you need to use:

require "google/auth"
require "google/calendar"
require "google/cloud/storage"
require "google/drive"
require "google/gemini"
require "google/maps"
require "google/people"
require "google/tasks"

Using the GenerativeAI API (Gemini)

require "google/gemini"

client = Google::GenerativeAI::Client.new(gemini_api_key)

gemini = client.model(
  "models/gemini-2.0-flash-exp",
  system_instruction: [<<-PROMPT],
    You are a helpful assistant.
    PROMPT
  temperature: 0.4,
)

puts gemini.generate(<<-PROMPT)
  Write a limerick about the Crystal programming language.
  PROMPT

Contributing

  1. Fork it (https://github.com/jgaskins/google/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors