FetchSpreadsheetData
Overview: This module facilitates the automation of fetching transaction data from Google Spreadsheets that are populated by Tiller. Tiller is a tool that aggregates transactional data from various bank accounts into a single spreadsheet. The module provides a mechanism to programmatically retrieve this data, which can be crucial for applications involving financial analysis, budget tracking, or expense management.Functionality: - Securely connects to Google Sheets to retrieve transaction data. - Parses the spreadsheet data to convert it from raw format to structured JSON. - Handles errors gracefully to manage cases where the spreadsheet might be empty or the API call fails.
Args: - `apiKey (Secret)`: The API key required to authenticate requests to the Google Sheets API. It should have the necessary permissions to access the spreadsheet. - `sheet (Secret)`: The ID of the Google Spreadsheet. This ID is typically found in the URL of the spreadsheet when opened in a web browser. - `name (str)`: The name of the specific sheet within the Google Spreadsheet from which to fetch data.
Return: - The function returns a JSON formatted string. If transaction data is present, it returns a JSON string representing an array of transactions, where each transaction is a dictionary with column headers as keys. If no data is found, it returns an empty array '[]' in JSON format.
Example Call: dagger call fetch-data --apiKey=env:[KEY] --sheet=env:[KEY] --name='Sheet1'
Installation
dagger install github.com/EmmS21/daggerverse/fetchSpreadsheetData@v0.0.2
Entrypoint
Return Type
FetchSpreadsheetData !
Example
dagger -m github.com/EmmS21/daggerverse/fetchSpreadsheetData@b690a69b263902262741393552b29042c7bd7087 call \
func (m *myModule) example() *FetchSpreadsheetData {
return dag.
FetchSpreadsheetData()
}
@function
def example() -> dag.FetchSpreadsheetData:
return (
dag.fetch_spreadsheet_data()
)
@func()
example(): FetchSpreadsheetData {
return dag
.fetchSpreadsheetData()
}
Types
FetchSpreadsheetData 🔗
fetchData() 🔗
Fetches transaction data from a Google Spreadsheet.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
apiKey | Secret ! | - | A reference to a secret value, which can be handled more safely than the value itself. |
sheet | Secret ! | - | A reference to a secret value, which can be handled more safely than the value itself. |
name | String ! | - | No description provided |
Example
dagger -m github.com/EmmS21/daggerverse/fetchSpreadsheetData@b690a69b263902262741393552b29042c7bd7087 call \
fetch-data --api-key env:MYSECRET --sheet env:MYSECRET --name string
func (m *myModule) example(ctx context.Context, apiKey *Secret, sheet *Secret, name string) string {
return dag.
FetchSpreadsheetData().
FetchData(ctx, apiKey, sheet, name)
}
@function
async def example(api_key: dagger.Secret, sheet: dagger.Secret, name: str) -> str:
return await (
dag.fetch_spreadsheet_data()
.fetch_data(api_key, sheet, name)
)
@func()
async example(apiKey: Secret, sheet: Secret, name: string): Promise<string> {
return dag
.fetchSpreadsheetData()
.fetchData(apiKey, sheet, name)
}