<commit_before># Google Spreadsheets API Connector

## Overview
The Google Spreadsheet API Connector allows to import Tests list as well as Export their Results to Google Spreadsheet files via the [Google Sheets API](https://developers.google.com/sheets/api).


## How to use

In order to use the [Google Sheets API](https://developers.google.com/sheets/api) via npm you need to complete these steps:


1. Create or use an existing [Google Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts).

2. Create a Google Sheets file and share it with Editor permission with the previously created Google Service Account email address.
⋅⋅1. This file should have Tab names useful to be used for both Tests information fetching and to write the Tests results.Example: you can have a Tab "Tests" and one other "Results" below:

[example1]: img/sheets-connector-doc.png "Google Sheets with Tests Tab"

⋅⋅2. Save the Google Sheet ID, identified in the URL between d/ and before /edit.
Example for this URL https://docs.google.com/spreadsheets/d/GOOGLE_SHEET_ID/edit the Google Sheet ID would be "GOOGLE_SHEET_ID".

3. Download the service-account.json credentials from the [Service accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts) and store them safely. In this example the file is stored inside a "tmp" folder.

4. Run the command selecting the appropriate tests and results connector. In this example 2 URLs are being tested via PSI API defined into a Google Sheet file Tab "Tests" and Results" will be printed into the "Results" Tab.<commit_msg>drafted sheets-connector.md<commit_after># Google Spreadsheets API Connector

## Overview
The Google Spreadsheet API Connector allows to import Tests list as well as Export their Results to Google Spreadsheet files via the [Google Sheets API](https://developers.google.com/sheets/api).


## How to use

In order to use the [Google Sheets API](https://developers.google.com/sheets/api) via npm you need to complete these steps:


1. Create or use an existing [Google Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts).

2. Create a Google Sheets file and share it with Editor permission with the previously created Google Service Account email address.
    1. This file should have Tab names useful to be used for both Tests information fetching and to write the Tests results.Example: you can have a Tab "Tests" and one other "Results" below:

    [example1]: img/sheets-connector-doc.png "Google Sheets with Tests Tab"

    2. Save the Google Sheet ID, identified in the URL between d/ and before /edit.
Example for this URL https://docs.google.com/spreadsheets/d/GOOGLE_SHEET_ID/edit the Google Sheet ID would be "GOOGLE_SHEET_ID".

3. Download the service-account.json credentials from the [Service accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts) and store them safely. In this example the file is stored inside a "tmp" folder.

4. Run the command selecting the appropriate tests and results connector. In this example 2 URLs are being tested via PSI API defined into a Google Sheet file Tab "Tests" and Results" will be printed into the "Results" Tab.
{'fraction_non_alphanumeric': 0.07218419415059116, 'fraction_numerical': 0.004978220286247666, 'mean_word_length': 4.486348122866894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7426755', 'n_tokens_mistral': 871, 'n_tokens_neox': 830, 'n_words': 422}