{"id":23636503,"url":"https://github.com/lozemc/simple-google-sheets","last_synced_at":"2025-11-09T03:30:38.114Z","repository":{"id":215102101,"uuid":"738123902","full_name":"lozemc/simple-google-sheets","owner":"lozemc","description":"An easy way to manage data in Google Sheets using PHP","archived":false,"fork":false,"pushed_at":"2024-02-24T17:19:29.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-25T00:42:04.456Z","etag":null,"topics":["excel","google","google-api-client","google-api-v4","google-sheets","google-sheets-api","google-spreadsheets","helpers-library","library","php","sheet","sheets","sheets-api","spreadsheet","spreadsheets","table","wrapper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lozemc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-02T13:33:57.000Z","updated_at":"2024-04-15T15:17:29.929Z","dependencies_parsed_at":null,"dependency_job_id":"c28653eb-3108-4ada-a345-dff069910ef6","html_url":"https://github.com/lozemc/simple-google-sheets","commit_stats":null,"previous_names":["lozemc/simple-google-sheets"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lozemc%2Fsimple-google-sheets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lozemc%2Fsimple-google-sheets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lozemc%2Fsimple-google-sheets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lozemc%2Fsimple-google-sheets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lozemc","download_url":"https://codeload.github.com/lozemc/simple-google-sheets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565609,"owners_count":19660159,"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":["excel","google","google-api-client","google-api-v4","google-sheets","google-sheets-api","google-spreadsheets","helpers-library","library","php","sheet","sheets","sheets-api","spreadsheet","spreadsheets","table","wrapper"],"created_at":"2024-12-28T06:13:16.470Z","updated_at":"2025-11-09T03:30:38.058Z","avatar_url":"https://github.com/lozemc.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://www.google.ru/intl/ru/sheets/about/\" target=\"_blank\"\u003e\u003cimg src=\"./icon.svg\" width=\"80\" alt=\"Google Sheets\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n# GoogleSheet\n\n`GoogleSheet` is a convenient wrapper for the\nstandard [`google/apiclient`](https://github.com/googleapis/google-api-php-client) package, providing an easy-to-use\ninterface for working with Google Sheets.\n\n## Installation\n\nRequire the package using [Composer](https://packagist.org/packages/lozemc/simple-google-sheets):\n\n```bash\ncomposer require lozemc/simple-google-sheets\n```\n\n## Usage\n\n#### Creating an Instance\n\n```php\n\nuse Lozemc\\GoogleSheet;\n\n// Replace 'your_table_id' and 'path/to/your/credentials-config.json' with actual values\n\n$table_id = 'your_table_id';\n$credentials = 'path/to/your/credentials-config.json';\n\n$table = new GoogleSheet($table_id, $credentials);\n\n```\n\n### Setting the Sheet\n\n```php\n\n$table-\u003eset_sheet('YourSheetName');\n\n```\n\n### Getting Rows\n\n```php\n\n// Get all rows\n$rows = $table-\u003eget_rows();\n\nprint_r($rows);\n\n// [\n//    [ 'A1 value', 'B1 value', 'C1 value' ],\n//    [ 'A2 value', 'B2 value', 'C2 value' ],\n//    [ 'A3 value', 'B3 value', 'C3 value' ]\n// ]\n\n\n// Get rows from a specific range\n$range = 'B2:C3';\n$rows = $table-\u003eget_rows($range);\n\nprint_r($rows);\n\n// [\n//    [ 'B2 value', 'C2 value' ],\n//    [ 'B3 value', 'C3 value' ]\n// ]\n\n```\n\n### Updating Rows\n\n```php\n\n$table-\u003eupdate([['A1 value', 'B1 value']]);\n\n// \n\n$range = 'A4';\n$table-\u003eupdate([['A4 value', 'B4 value']], $range);\n\n// \n\n$table-\u003eupdate([\n    ['A1 value', 'B1 value'],\n    ['A2 value', 'B2 value', 'C3 value'],\n    ['A3 value', 'B3 value', '', 'D4 value'],\n]);\n\n```\n\n### Appending Rows\n\n```php\n$table-\u003eappend([['Value 1', 'Value 2']]);\n\n//\n\n$table-\u003eappend([['Value 1', 'Value 2']], 'A10');\n\n```\n\n### Simple Example\n\n```php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Lozemc\\GoogleSheet;\n\n$table_id = '1gncMRlsonFj2YzYw79QnfVA4Go5UcYkmfgG1T7Vb5Q';\n$credentials = __DIR__ . '/credentials-config.json'; \n\n$table = new GoogleSheet($table_id, $credentials);\n\n\n// Set the sheet name if not provided during initialization\n$table-\u003eset_sheet('Sheet1');\n\n\n// Append new rows\n$table-\u003eappend([\n    ['Lisa', 'Anderson'],\n    ['Jane', 'Jones'],\n]);\n\n\n// Get all rows\n$rows = $table-\u003eget_rows();\n\n// Display the retrieved rows\nprint_r($rows);\n\n\n// Get rows from a specific range in another sheet\n$rows = $table-\u003eset_sheet('Sheet2')-\u003eget_rows('B10:C20');\n\nprint_r($rows);\n\n\n// Update data in a specific range\n$table-\u003eupdate([['New value']], 'B10');\n$row = $table-\u003eget_rows('B10');\n\nprint_r($row);\n\n```\n\n## Requirements\n\n- PHP \u003e=7.4.33\n\n## Dependencies\n\n- [google/apiclient ^2.15.0](https://github.com/googleapis/google-api-php-client)\n\n## License\n\nThis package is licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flozemc%2Fsimple-google-sheets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flozemc%2Fsimple-google-sheets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flozemc%2Fsimple-google-sheets/lists"}