Dagger
Search

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.

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]

Installation

dagger install github.com/EmmS21/daggerverse/fetchSpreadsheetData@678ae5ba45bae707d1081cda300919b3ff77256c

Entrypoint

Return Type
FetchSpreadsheetData !
Example
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
NameTypeDefault ValueDescription
apiKeySecret !-A reference to a secret value, which can be handled more safely than the value itself.
sheetSecret !-A reference to a secret value, which can be handled more safely than the value itself.
Example
dagger -m github.com/EmmS21/daggerverse/fetchSpreadsheetData@678ae5ba45bae707d1081cda300919b3ff77256c call \
 fetch-data --api-key env:MYSECRET --sheet env:MYSECRET
func (m *myModule) example(ctx context.Context, apiKey *Secret, sheet *Secret) string  {
	return dag.
			FetchSpreadsheetData().
			FetchData(ctx, apiKey, sheet)
}
@function
async def example(api_key: dagger.Secret, sheet: dagger.Secret) -> str:
	return await (
		dag.fetch_spreadsheet_data()
		.fetch_data(api_key, sheet)
	)
@func()
async example(apiKey: Secret, sheet: Secret): Promise<string> {
	return dag
		.fetchSpreadsheetData()
		.fetchData(apiKey, sheet)
}