{"id":21920181,"url":"https://github.com/nthings/debts","last_synced_at":"2026-05-06T23:36:58.141Z","repository":{"id":35727294,"uuid":"193556237","full_name":"nthings/Debts","owner":"nthings","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-27T04:24:39.000Z","size":8720,"stargazers_count":0,"open_issues_count":25,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T10:11:44.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://debts-tau.vercel.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nthings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-24T18:13:47.000Z","updated_at":"2024-08-27T04:25:03.000Z","dependencies_parsed_at":"2024-11-28T20:13:45.579Z","dependency_job_id":"ace1529f-eeee-4139-8c51-c6b6cc59c544","html_url":"https://github.com/nthings/Debts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthings%2FDebts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthings%2FDebts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthings%2FDebts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthings%2FDebts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nthings","download_url":"https://codeload.github.com/nthings/Debts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244939226,"owners_count":20535381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T20:13:33.481Z","updated_at":"2026-05-06T23:36:58.112Z","avatar_url":"https://github.com/nthings.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Google Sheets Integration\n\nThis project is a Flask-based web application that interacts with Google Sheets. The application allows you to dynamically add rows to a specific range in a Google Spreadsheet through a REST API. The `SPREADSHEET_ID` and `RANGE_NAME` can be controlled via query parameters.\n\n## Features\n\n- **Add Data to Google Sheets**: Receive JSON data via a POST request and append it as a new row in a specified range of a Google Spreadsheet.\n- **Dynamic Control**: Use query parameters to specify the target Google Spreadsheet and the range of cells to update.\n- **Environment Variable Management**: Sensitive data such as Google Service Account credentials are securely managed using environment variables and a `.env` file.\n\n## Requirements\n\n- Python 3.6+\n- Google Cloud Project with Sheets API enabled\n- A Google Spreadsheet to interact with\n- Flask\n- Google API Client\n- Python Dotenv\n\n## Installation\n\n1. **Clone the Repository**:\n    ```bash\n    git clone https://github.com/yourusername/yourprojectname.git\n    cd yourprojectname\n    ```\n\n2. **Create a Virtual Environment**:\n    ```bash\n    python3 -m venv venv\n    source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n    ```\n\n3. **Install Dependencies**:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. **Setup Google Cloud Credentials**:\n    - Create a service account in your Google Cloud project and download the JSON credentials file.\n    - Save the JSON credentials in your project directory or store the contents in an environment variable.\n\n5. **Create a `.env` File**:\n    Create a `.env` file in the root of your project and add the following environment variables:\n\n    ```bash\n    GOOGLE_SERVICE_ACCOUNT_JSON='{\"type\": \"service_account\", ...}'  # Your JSON credentials here\n    ```\n\n6. **Run the Flask App**:\n    ```bash\n    python app.py\n    ```\n\n## Usage\n\n### Adding a Row to Google Sheets\n\nTo add a row to a Google Sheet, send a POST request to the `/add_row` endpoint with the following parameters:\n\n- **Query Parameters**:\n    - `spreadsheet_id`: The ID of the Google Spreadsheet.\n    - `range_name`: The range of the cells you want to update (e.g., `Sheet1!B:E`).\n\n- **Request Body**:\n    - JSON data representing the values to insert. Ensure that the number of values matches the number of columns in the specified range.\n\n#### Example Request\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"column1\":\"value1\",\"column2\":\"value2\"}' \\\n\"http://127.0.0.1:5000/add_row?spreadsheet_id=1qGS2gSPCuFgZGRh7yIZXvtibJtrqQ9rrqNfLhIhBJTE\u0026range_name=Transacciones!B:E\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthings%2Fdebts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnthings%2Fdebts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthings%2Fdebts/lists"}