{"id":17740589,"url":"https://github.com/rusq/xls2sheets","last_synced_at":"2025-05-07T01:48:47.683Z","repository":{"id":57503708,"uuid":"188651680","full_name":"rusq/xls2sheets","owner":"rusq","description":"Import or partially refresh your Google Sheets from Excel files","archived":false,"fork":false,"pushed_at":"2025-03-13T00:31:51.000Z","size":6480,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T10:18:13.207Z","etag":null,"topics":["api","authorisation","automation","excel","export-to-excel","golang","google","google-api","google-authentication","google-sheets","office-tools","pdf","sheets","sheets-api","spreadsheet","worksheet","xls","xlsx"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rusq.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":"2019-05-26T07:13:59.000Z","updated_at":"2024-12-30T22:24:15.000Z","dependencies_parsed_at":"2024-10-26T15:12:44.757Z","dependency_job_id":null,"html_url":"https://github.com/rusq/xls2sheets","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusq%2Fxls2sheets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusq%2Fxls2sheets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusq%2Fxls2sheets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rusq%2Fxls2sheets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rusq","download_url":"https://codeload.github.com/rusq/xls2sheets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418641,"owners_count":20773938,"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":["api","authorisation","automation","excel","export-to-excel","golang","google","google-api","google-authentication","google-sheets","office-tools","pdf","sheets","sheets-api","spreadsheet","worksheet","xls","xlsx"],"created_at":"2024-10-26T03:06:41.436Z","updated_at":"2025-03-31T23:30:27.776Z","avatar_url":"https://github.com/rusq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Excel To Google Sheets Importer #\n\n[![Build Status](https://travis-ci.com/rusq/xls2sheets.svg?branch=master)](https://travis-ci.com/rusq/xls2sheets)\n\nPurpose: Import Microsoft Excel or Google Spreadsheet files from arbitrary\nlocation to Google Sheets workbook.\n\nSupported Sources:\n\n  * Files types:\n    * Google Sheets spreadsheet.\n    * Microsoft Excel: **xls, xlsx**\n    * Plain CSV: **csv** (NOTE: don't worry about specifying address range, it\n      will be populated automatically for CSV files).\n    * Open Office Spreadsheet: **ods**\n    * Maybe others (supported by Google Sheets)\n  * Local files or Remote (can fetch from URLs).\n\nSupported Targets:\n\n  * Google Sheets spreadsheet;\n  * Save file to the local disk (all supported by Google Sheets formats, i.e.\n    XLSX, XLS, ODS, PDF, TXT, CSV, HTML).\n\n## Features ##\n\n* Many-to-One: Multiple Source spreadsheets can be combined into one Google\n  Sheets Document;\n* One-to-Many: One source file can be split into several different Google\n  Sheets Documents;\n* Allows to specify the Range within the source to copy and a target\n  worksheet, i.e. copy \"Rates!A1:H20\" from source to \"Rates\" worksheet in\n  target GS document;\n* Copy multiple worsheets (or ranges) to multiple target worksheets, i.e.:\n  * Range \"Rates!A1:H12\" in source file to \"Rates2019\" worksheet in target;\n  * Range \"Rates!A13:H24\" in source file to \"Rates2020 worksheet in target;\n* Exporting files to disk in a number of formats.\n\n### Quick install ###\nIf you have **Go** installed, run the following:\n\n```sh\ngo get -u github.com/rusq/xls2sheets\ngo install github.com/rusq/xls2sheets/cmd/sheets-refresh\n```\n\nOtherwise, you can download the executable for your Operating System from\n[Releases][1] page.\n\n### Quickstart ###\n1. Turn on the Google Sheets API described in Golang [quickstart][2], and\n   download the `credentials.json` file.  If you need to tweak access, you\n   can always do so in [Google API \u0026 Services Console][3]\n2. Turn on the Google Drive API as described in [drive quickstart][4].  No\n   need to download `credentials.json` again, as it has already been\n   downloaded on Step 1.\n3. Copy or move it to `$HOME/.refresh-credentials.json` and set mode 400 or\n   600 on the file.\n4. Create a configuration file that will list the required source files and\n   target spreadsheets (see [Sample configuration](#example)).\n5. During the first start you will be prompted to authorise application with\n   your Google account.  There's no risk, as it is the application that was\n   created on Step 1.  Once authorised, copy and paste the authorisation\n   code from the browser into the prompt.\n\n### Configuration ###\n* Configuration file describes a **Job** to be performed.\n* A **Job** consists of one or more **Tasks**.\n* Each **Task** has a name, and **Source** and **Target** sections.\n  * In **Source** one must specify a *URI of the Spreadsheet file*  or ID\n    of source Google Sheets Document and one or more *Address Ranges* to be\n    processed, i.e. \"*Workbook!A1:C1000*\" or \"*Sheet1!A2:U*\".  No need to\n    specify the address range for *CSV* file.\n  * In **Target** - a *Google SpreadsheetID* and one or more *Address* to copy\n    to, i.e. \"Backup!A1\".  Optionally, one can specify whether to *Create* the\n    worksheet or *Clear* the destination worksheet before copying.\n    Additionally, one can specify a filename for export in *Location*\n    parameter (see example below).\n  * It is important to have exactly same number of **Source Address Range**\n    entries and **Target Addresses**.  I.e. if you're about to copy\n    two sheets from an Excel file, make sure that you specify two target\n    Google Spreadsheet Sheet addresses.\n\nThe Example file below contains all possible configuration entries.\n\n#### Example ####\n\nIn the example two source files are combined into one Google Sheets Document:\n\n* The range \"Data!A1:U\" of file *hb1-monthly.xlsx* is imported into \"Monthly\n  Rates\" worksheet of Google Sheets Document\n\n```yaml\n# \n# Sample job for fetching RBNZ exchange sheets and load them into a\n# test spreadsheet from https://www.rbnz.govt.nz/statistics/b1\n#\n# To use this file:\n#   1. Create an empty Google Spreadsheet.\n#   2. Copy and Paste the spreadsheet_id into this configuration file.\n#   3. Compile and run sheets-refresh\n#\n# This should populate the empty spreadsheet with data from RBNZ website.\n01_monthly_rates:\n  source:\n    location: https://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-monthly.xlsx\n    address_range:\n      - Data!A1:U   # address range for Data sheet.\n      - Data        # complete import of Data sheet.\n  target:\n    spreadsheet_id: 1Qq9dCCj_DcnLE9lAOStEhhC37Crf7a77nBrKM-xhZZQ\n    address:\n      - Monthly Rates\n      - Another Monthly Rates (full)\n    create: true\n    clear: true\n  leave_junk: false     # leave temporary files.  May be used for debugging.\n02_daily_rates:\n  source:\n    location: https://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-daily.xlsx\n    address_range:\n      - Data!A1:T\n  target:\n    spreadsheet_id: 1Qq9dCCj_DcnLE9lAOStEhhC37Crf7a77nBrKM-xhZZQ\n    location: ./sample.ods    # save the file locally too.\n    address:\n      - Daily Rates\n    create: true\n    clear: true\n\n```\n\n### Sample Run ###\n```\n$ ./sheets-refresh -job rbrates.yaml\n2019/12/09 20:07:56 callback server listening on localhost:6061\nPlease follow the Instructions in your browser to authorize sheets-refresh\nor press [Ctrl]+[C] to cancel...\n2019/12/09 20:08:07 Saving token file to: /Users/rustamgilyazov/Library/Caches/rusq/sheets-refresh/auth-token.bin\n2019/12/09 20:08:07 starting task: \"01_monthly_rates\"\n2019/12/09 20:08:07 + type detected as: remote file\n2019/12/09 20:08:07 + opening: https://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-monthly.xlsx\n2019/12/09 20:09:16 updating data in target spreadsheet 1Qq9dCCj_DcnLE9lAOStEhhC37Crf7a77nBrKM-xhZZQ\n2019/12/09 20:09:16   * retrieving information about the spreadsheet\n2019/12/09 20:09:17   * validating target configuration\n2019/12/09 20:09:17   * copy range \"Data!A1:U\" to \"Monthly Rates\"\n2019/12/09 20:09:18     * clearing target sheet\n2019/12/09 20:09:20     * OK: 5356 cells updated\n2019/12/09 20:09:20   * exporting to ./sample.ods\n2019/12/09 20:09:27     * export OK\n2019/12/09 20:09:28 task \"01_monthly_rates\": success\n2019/12/09 20:09:28 starting task: \"02_daily_rates\"\n2019/12/09 20:09:28 + type detected as: remote file\n2019/12/09 20:09:28 + opening: https://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-daily.xlsx\n2019/12/09 20:09:34 updating data in target spreadsheet 1Qq9dCCj_DcnLE9lAOStEhhC37Crf7a77nBrKM-xhZZQ\n2019/12/09 20:09:34   * retrieving information about the spreadsheet\n2019/12/09 20:09:34   * validating target configuration\n2019/12/09 20:09:34   * copy range \"Data!A1:T\" to \"Daily Rates\"\n2019/12/09 20:09:35     * clearing target sheet\n2019/12/09 20:09:37     * OK: 9841 cells updated\n2019/12/09 20:09:38 task \"02_daily_rates\": success\n```\n\n[1]: https://github.com/rusq/xls2sheets/releases\n[2]: https://developers.google.com/sheets/api/quickstart/go\n[3]: https://console.developers.google.com/apis/dashboard?authuser=0\n[4]: https://developers.google.com/drive/api/v3/quickstart/go\n[5]: https://developers.google.com/sheets/api/guides/concepts","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusq%2Fxls2sheets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusq%2Fxls2sheets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusq%2Fxls2sheets/lists"}