RaptorLoggerEngine.Gig
1.0.0
dotnet add package RaptorLoggerEngine.Gig --version 1.0.0
NuGet\Install-Package RaptorLoggerEngine.Gig -Version 1.0.0
<PackageReference Include="RaptorLoggerEngine.Gig" Version="1.0.0" />
paket add RaptorLoggerEngine.Gig --version 1.0.0
#r "nuget: RaptorLoggerEngine.Gig, 1.0.0"
// Install RaptorLoggerEngine.Gig as a Cake Addin #addin nuget:?package=RaptorLoggerEngine.Gig&version=1.0.0 // Install RaptorLoggerEngine.Gig as a Cake Tool #tool nuget:?package=RaptorLoggerEngine.Gig&version=1.0.0
RaptorLoggerEngine
Badge Name | Status |
---|---|
Latest Build Status | |
RLE.Gig Nuget Version |
Project Description
This project is a library used to handle the interactions between a custom API service and Google Sheets API. It offers the following features:
- Appending data to trips and shifts sheets
- Creating, formatting, and styling all sheets in the worksheet.
- Getting data from all the sheets in the worksheet (individually, group, and batch)
- Getting worksheet properties like title and sheet tab names
Using Library
Auth Modes
To authenticate you can use either of the following:
Simple
Using the GoogleSheetManager
allows you to skip referencing Google.Apis.Sheets.v4
package and just call the functions and receive data with common objects.
Create a new instance of the GoogleSheetManager
with auth mode and spreadsheet id
var googleSheetManager = new GoogleSheetManager(authMode, spreadsheetId);
You can create all sheets, formats, and layouts in a new worksheet by calling CreateSheets()
await googleSheetManager.CreateSheets();
You can get all sheets and information by calling GetSheets()
var data = await googleSheetManager.GetSheets();
You can retrieve specific sheets and information by calling GetSheets()
and passing in the sheet enums you want.
var sheets = [SheetEnum.Trips, SheetEnum.Shifts]
var data = await googleSheetManager.GetSheets(sheets);
Advanced
Using the GoogleSheetService
allows you to change format, colors, and other options by referencing the Google.Apis.Sheets.v4
package.
Testing
Create Service Account
You'll need to create your own service account and use the credentials to access your Google Sheet:
- Google Cloud Console
- Create New Project or use existing one
- Visit API Library and enable Google Sheets API
- APIs & Services → Create Credentials → Service Accounts
- Give the service account a
name
andid
- Once created select the service account and go to the
Keys
tab - Add/Create a new key and select type
JSON
- The key will download to your computer where you will have access to the values needed for the properties below.
Local Setup
Add Google JSON Credentials
by right clicking on RaptorLoggerEngine.tests
and selecting Manage User Secrets
(secrets.json)
Add the following JSON properties to it:
{
"google_credentials": {
"type": "service_account",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
},
"spreadsheet_id": ""
}
Create a new spreadsheet and add the service account/client email to it.
Update the user secrets with the spreadsheeet id.
Once that is completed you'll be able to run all tests including integration tests.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Google.Apis.Sheets.v4 (>= 1.68.0.3547)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0)
- RLE.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 119 | 9/28/2024 |