{"id":28585936,"url":"https://github.com/phusion/sheetsapi","last_synced_at":"2025-06-11T06:12:26.768Z","repository":{"id":56895273,"uuid":"84346167","full_name":"phusion/SheetsAPI","owner":"phusion","description":"A simple API for writing to Google Sheets","archived":false,"fork":false,"pushed_at":"2023-09-10T09:31:49.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-20T11:09:13.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phusion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-08T17:09:40.000Z","updated_at":"2023-09-10T09:31:36.000Z","dependencies_parsed_at":"2022-08-21T01:20:44.615Z","dependency_job_id":null,"html_url":"https://github.com/phusion/SheetsAPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phusion%2FSheetsAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phusion%2FSheetsAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phusion%2FSheetsAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phusion%2FSheetsAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phusion","download_url":"https://codeload.github.com/phusion/SheetsAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phusion%2FSheetsAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259211928,"owners_count":22822385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T06:12:25.442Z","updated_at":"2025-06-11T06:12:26.746Z","avatar_url":"https://github.com/phusion.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Sheets API\n============================\n\nThis gem contains a simple API to insert data into google sheets.\n\nAuthentication\n==============\n\nThis gem needs to authenticate as a Google Service Account to access files.\nFollow these steps to download the credentials you need:\n\n1. Go to https://console.developers.google.com/apis/dashboard\n2. Create a new Project (if you have to)\n2. Enable the Google Sheets API\n3. Go to 'Credentials'\n4. Create Credentials for a 'Service account key'\n6. Under 'Service account' select your Project. Key type JSON.\n7. Save the downloaded file as 'GoogleAPICredentials.json' in the root of your project\n\nTo give the API access to a sheet in Google Sheets, you need to specifically share that document with the Service Account.\nIn the GoogleAPICredentials.json file you will find a `client_email` field. Share a document with that email address to grant access.\n\n\nUsage\n=====\n\n~~~ruby\ndocument = SheetsAPI.document(\"1xuQVCadaMmTPiz_13hXuZHGKDihc41w5aii4DtuxOmU5j_eQ4BD98T-H\")\nsheet = document.sheet(\"Daily Sales\")\nsheet.insert(\n  index: [:Date, :Client],\n  sort: true,\n  upsert: true,\n  rows: [\n    {\n      Date: Date.new(2017,3,9),\n      Client: \"Some Guy\",\n      Email: \"guy@client.com\",\n      Sales: 14,\n      Profit: 5\n    },\n    {\n      Date: Date.new(2017,3,9),\n      Client: \"Other Guy\",\n      Sales: 2,\n      Profit: -1\n    },\n    {\n      Date: Date.new(2017,3,10),\n      Client: \"Some Guy\",\n      Email: \"guy@client.com\",\n      Sales: 8,\n      Margin: 3\n    }\n  ]\n)\n~~~\n\nInsert Parameters\n=================\n\nIndex\n-----\nThe headers to use for upsert matching and sorting. Case sensitive. Default: []\nIf no index is provided, sort and upsert have no effect.\n\nSort\n----\nSort the content of the sheet based on the index after all other operations are completed. Default: false\n\nUpsert\n------\nAttempt to match given inputs to existing rows, based on the index. Default: false\nIf the index fields are the same, the data provided in the row parameter will override the existing row in the sheet.\n\nRows\n----\nAn array of objects that represent rows to be updated. Default: []\nKeys in the objects represent the header for the value. Keys are case sensitive.\nThe default behaviour is to insert new rows in the sheet for all provided rows.\nSet the Upsert parameter to change to update instead.\nIt is not necessary to provide a value for every header value.\nFor the index headers, an empty value is considered \"\" for comparisons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphusion%2Fsheetsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphusion%2Fsheetsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphusion%2Fsheetsapi/lists"}