Categorygithub.com/julianVelandia/golang-sheets
module
0.0.0-20221026034915-e793f4949215
Repository: https://github.com/julianvelandia/golang-sheets.git
Documentation: pkg.go.dev

# README

Google Spreadsheets Golang API

technology Go License

Google sheets API made with golang

Features:

  • Open a spreadsheet by account service.
  • Read cell by ranges.

EndPoints

Read

request

{
  "sheet_name": "Sheet 1",
  "start_column": "A",
  "start_row": "1",
  "end_column": "B",
  "end_row": "2"
}

response

{
  "cells": [
    {
      "cell_position": "A1",
      "information": "Cell A1 Information"
    },
    {
      "cell_position": "A2",
      "information": "Cell A2 Information"
    },
    {
      "cell_position": "B1",
      "information": "Cell B1 Information"
    },
    {
      "cell_position": "B2",
      "information": "Cell B2 Information"
    }
  ]
}

Account Service

To make requests to a Google spreadsheet, you need credential authorization, the simplest way to do this is through an account service

You must first create a project in the Google Cloud console.

2si

Then go to the credentials/create credentials/account service section and follow the instructions for creating the account service.

4si

You should see the following in your credentials panel.

5

Click on that account service and create a new key of type json.

6si 7

Finally look for the Google Sheets API and enable it for your project.

8si 9

Setup credentials

For security reasons this project ignores credential files. To set up credentials, you need to create the environments folder in internal/platform/sheets and add the json file you created in the previous section named credentials.json.

image

You should also create the spreadsheetsID.json file with the id of the sheet.

10 12

Pending features

  • Write in cell.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License - see the LICENSE file for details

# Packages

No description provided by the author