{"id":21748205,"url":"https://github.com/voronchuk/elixir_google_spreadsheets","last_synced_at":"2025-10-26T14:05:26.456Z","repository":{"id":13395686,"uuid":"74303755","full_name":"Voronchuk/elixir_google_spreadsheets","owner":"Voronchuk","description":"Elixir library to read and write data of Google Spreadsheets.","archived":false,"fork":false,"pushed_at":"2025-02-22T20:50:14.000Z","size":178,"stargazers_count":82,"open_issues_count":4,"forks_count":37,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T03:04:10.902Z","etag":null,"topics":["elixir","elixir-library","google-spreadsheets","service-accounton"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/Voronchuk.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,"publiccode":null,"codemeta":null}},"created_at":"2016-11-20T21:28:59.000Z","updated_at":"2025-02-22T20:46:32.000Z","dependencies_parsed_at":"2024-11-26T08:12:36.657Z","dependency_job_id":"20f56b6b-6cce-4067-a5e8-71a1cb1cd6d0","html_url":"https://github.com/Voronchuk/elixir_google_spreadsheets","commit_stats":{"total_commits":87,"total_committers":15,"mean_commits":5.8,"dds":0.5287356321839081,"last_synced_commit":"7cd46b70a4584cc29f5296ec481cef8ce832bab7"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronchuk%2Felixir_google_spreadsheets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronchuk%2Felixir_google_spreadsheets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronchuk%2Felixir_google_spreadsheets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronchuk%2Felixir_google_spreadsheets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voronchuk","download_url":"https://codeload.github.com/Voronchuk/elixir_google_spreadsheets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"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":["elixir","elixir-library","google-spreadsheets","service-accounton"],"created_at":"2024-11-26T08:12:28.833Z","updated_at":"2025-10-26T14:05:26.399Z","avatar_url":"https://github.com/Voronchuk.png","language":"Elixir","readme":"# Elixir Google Spreadsheets\nElixir library to read and write data of Google Spreadsheets.\n\nThis library is based on __Google Cloud API v4__ and uses __Google Service Accounts__ to manage it's content.\n\n## Integration with Ecto\nCheck [ecto_gss](https://github.com/Voronchuk/ecto_gss) if you need to integrate your Google Spreadsheet with Ecto changesets for validation and other features.\n\n# Setup\n1. Use [this](https://console.developers.google.com/start/api?id=sheets.googleapis.com) wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click __Continue__, then __Go to credentials__.\n2. On the __Add credentials to your project page__, create __Service account key__.\n3. Select your project name as service account and __JSON__ as key format, download the created key and rename it to __service_account.json__.\n4. Press __Manage service accounts__ on a credential page, copy your __Service Account Identifier__: _[projectname]@[domain].iam.gserviceaccount.com_\n5. Create or open existing __Google Spreadsheet document__ on your __Google Drive__ and add __Service Account Identifier__ as user invited in spreadsheet's __Collaboration Settings__.\n6. Add `{:elixir_google_spreadsheets, \"~\u003e 0.4\"}` to __mix.exs__ under `deps` function, add `:elixir_google_spreadsheets` in your application list.\n7. Add __service_account.json__ in your `config.exs` or other config file, like `dev.exs` or `prod.secret.exs`.\n    config :elixir_google_spreadsheets,\n        json: \"./config/service_account.json\" |\u003e File.read!\n8. Run `mix deps.get \u0026\u0026 mix deps.compile`.\n\n## Testing\nThe [following Google Spreadsheet](https://docs.google.com/spreadsheets/d/1h85keViqbRzgTN245gEw5s9roxpaUtT7i-mNXQtT8qQ/edit?usp=sharing) is used to run tests locally, it can be copied to run local tests.\n\n## API limits\nAll Google API limits, suggested params are the following:\n\n```elixir\nconfig :elixir_google_spreadsheets, :client,\n  request_workers: 50,\n  max_demand: 100,\n  max_interval: :timer.minutes(1),\n  interval: 100,\n  result_timeout: :timer.minutes(10),\n  request_opts: [] # See Finch request options\n```\n\n# Usage\nInitialise spreadsheet thread with it's id which you can fetch from URL:\n\n```elixir\n    {:ok, pid} = GSS.Spreadsheet.Supervisor.spreadsheet(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXX\")\n```\n\nOr if you wish to edit only a specific list:\n\n```elixir\n    {:ok, pid} = GSS.Spreadsheet.Supervisor.spreadsheet(\n        \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXX\",\n        list_name: \"my_list3\"\n    )\n```\n\nSample operations:\n\n* `GSS.Spreadsheet.id(pid)`\n* `GSS.Spreadsheet.properties(pid)`\n* `GSS.Spreadsheet.get_sheet_id(pid)`\n* `GSS.Spreadsheet.sheets(pid)`\n* `GSS.Spreadsheet.rows(pid)`\n* `GSS.Spreadsheet.update_sheet_size(pid, 10, 5)`\n* `GSS.Spreadsheet.read_row(pid, 1, column_to: 5)`\n* `GSS.Spreadsheet.read_rows(pid, 1, 10, column_to: 5, pad_empty: true)`\n* `GSS.Spreadsheet.read_rows(pid, [1, 3, 5], column_to: 5, pad_empty: true)`\n* `GSS.Spreadsheet.read_rows(pid, [\"A1:E1\", \"A2:E2\"])`\n* `GSS.Spreadsheet.write_row(pid, 1, [\"1\", \"2\", \"3\", \"4\", \"5\"])`\n* `GSS.Spreadsheet.write_rows(pid, [\"A2:E2\", \"A3:F3\"], [[\"1\", \"2\", \"3\", \"4\", \"5\"], [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]])`\n* `GSS.Spreadsheet.append_row(pid, 1, [\"1\", \"2\", \"3\", \"4\", \"5\"])`\n* `GSS.Spreadsheet.append_rows(pid, 1, [[\"1\", \"2\", \"3\", \"4\", \"5\"], [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]])`\n* `GSS.Spreadsheet.clear_row(pid, 1)`\n* `GSS.Spreadsheet.clear_rows(pid, 1, 10)`\n* `GSS.Spreadsheet.clear_rows(pid, [\"A1:E1\", \"A2:E2\"])`\n* `GSS.Spreadsheet.set_basic_filter(pid, %{row_from: 0, row_to: 5, col_from: 1, col_to: 10}, %{col_idx: 2, condition_type: \"TEXT_CONTAINS\", user_entered_value: \"test\"})`\n* `GSS.Spreadsheet.set_basic_filter(pid, %{row_from: nil, row_to: nil, col_from: nil, col_to: nil}, %{})`\n* `GSS.Spreadsheet.clear_basic_filter(pid)`\n* `GSS.Spreadsheet.freeze_header(pid, %{dim: :row, n_freeze: 1})`\n* `GSS.Spreadsheet.freeze_header(pid, %{dim: :col, n_freeze: 2})`\n* `GSS.Spreadsheet.update_col_width(pid, %{col_idx: 1, col_width: 200})`\n* `GSS.Spreadsheet.add_number_format(pid, %{row_from: 0, row_to: nil, col_from: 3, col_to: 4}, %{type: \"NUMBER\", pattern: \"#0.0%\"})`\n* `GSS.Spreadsheet.update_col_wrap(pid, %{row_from: 0, row_to: nil, col_from: 5, col_to: 7}, %{wrap_strategy: \"clip\"})`\n* `GSS.Spreadsheet.set_font(pid, %{row_from: nil, row_to: nil, col_from: nil, col_to: nil}, %{font_family: \"Source Code Pro\"})`\n* `GSS.Spreadsheet.add_conditional_format(pid, %{row_from: nil, row_to: nil, col_from: nil, col_to: nil}, %{formula: \"=$E1=\\\"TEST\\\"\", color_map: %{red: 1, green: 0.8, blue: 0.8}})`\n* `GSS.Spreadsheet.update_border(pid, %{row_from: 0, row_to: 10, col_from: 2, col_to: 5}, %{top: %{red: 1, style: \"dashed\"}, bottom: %{green: 1, blue: 0.7}, left: %{blue: 0.8, alpha: 0.75}})`\n\nLast function param of `GSS.Spreadsheet` function calls support the same `Keyword` options (in snake_case instead of camelCase), as defined in [Google API Docs](https://developers.google.com/sheets/reference/rest/v4/spreadsheets.values).\n\nWe also define `column_from` and `column_to` Keyword options which control range of cell which will be queried.\n\nDefault values:\n* `column_from = 1` - default is configurable as `:default_column_from`\n* `column_to = 26` - default is configurable as `:default_column_to`\n* `major_dimension = \"ROWS\"`\n* `value_render_option = \"FORMATTED_VALUE\"`\n* `datetime_render_option = \"FORMATTED_STRING\"`\n* `value_render_option = \"USER_ENTERED\"`\n* `insert_data_option = \"INSERT_ROWS\"`\n\n# Suggestions\n* Recommended columns __26__ (more on your own risk), max rows in a batch __100-300__ depending on your data size per row, configurable as `:max_rows_per_request`;\n* __Pull requests / reports / feedback are welcome.__\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronchuk%2Felixir_google_spreadsheets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoronchuk%2Felixir_google_spreadsheets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronchuk%2Felixir_google_spreadsheets/lists"}