{"id":20268277,"url":"https://github.com/officedev/excel-io","last_synced_at":"2025-07-01T03:06:24.406Z","repository":{"id":54919052,"uuid":"136516133","full_name":"OfficeDev/Excel-IO","owner":"OfficeDev","description":"A utility library that makes it easy to read and write Excel workbooks using C#","archived":false,"fork":false,"pushed_at":"2024-03-20T00:19:31.000Z","size":98,"stargazers_count":68,"open_issues_count":1,"forks_count":31,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-11T03:41:07.411Z","etag":null,"topics":["excel","office"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/OfficeDev.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,"zenodo":null}},"created_at":"2018-06-07T18:27:43.000Z","updated_at":"2024-11-08T13:26:52.000Z","dependencies_parsed_at":"2024-02-02T22:25:16.297Z","dependency_job_id":"34fb23d5-9817-4da4-9c90-767c099c34e3","html_url":"https://github.com/OfficeDev/Excel-IO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OfficeDev/Excel-IO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficeDev%2FExcel-IO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficeDev%2FExcel-IO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficeDev%2FExcel-IO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficeDev%2FExcel-IO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OfficeDev","download_url":"https://codeload.github.com/OfficeDev/Excel-IO/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OfficeDev%2FExcel-IO/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262887190,"owners_count":23379768,"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","office"],"created_at":"2024-11-14T12:17:22.738Z","updated_at":"2025-07-01T03:06:24.365Z","avatar_url":"https://github.com/OfficeDev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\r\ntopic: sample\r\nproducts:\r\n- office-excel\r\n- office-365\r\nlanguages:\r\n- csharp\r\nextensions:\r\n  contentType: tools\r\n  createdDate: 6/7/2018 11:27:43 AM\r\n---\r\n# Excel.IO\r\n\r\nThe goal of this project is to simplify reading and writing Excel workbooks so that the developer needs only pass a collection of objects to write a workbook. Likewise, when reading a workbook the developer supplies a class with properties that map to column names to read a collection of those objects from the workbook. \r\n\r\nExcel.IO takes a single dependency on the [Open XML SDK](https://github.com/OfficeDev/Open-XML-SDK) and targets .NET Standard 2.0\r\n\r\n## Features\r\n\r\n* Easy to use developer API\r\n* Write one or more worksheets per workbook by passing a collection of strongly typed objects\r\n* Read one or more worksheets from a workbook into a collection of strongly typed objects\r\n\r\n## Limitations\r\n\r\n* Assumes workbook structure where the first row has column headers\r\n* Reading multiple worksheets is a little inefficient\r\n* Localisation isn't currently supported \r\n\r\n## Example: Writing a worksheet\r\n\r\nImplement [IExcelRow](../master/src/Excel.IO/IExcelRow.cs) and define the columns of the spreadsheet as public properties:\r\n\r\n```csharp\r\npublic class Person : IExcelRow\r\n{\r\n    public string SheetName { get =\u003e \"People Sheet\"; }\r\n\r\n    public string EyeColour { get; set; }\r\n\r\n    public int Age { get; set; }\r\n\r\n    public int Height { get; set; }\r\n}\r\n```\r\n\r\nThen create instances and pass a collection to an instance of [ExcelConverter](../master/src/Excel.IO/ExcelConverter.cs) to write a single sheet workbook with several rows:\r\n\r\n```csharp\r\nvar people = new List\u003cPerson\u003e();\r\n\r\nfor (int i = 0; i \u003c 10; i++) \r\n{\r\n  people.Add(new Person\r\n  {\r\n    EyeColour = Guid.NewGuid().ToString(),\r\n    Age = new Random().Next(1, 100),\r\n    Height = new Random().Next(100, 200)\r\n  });\r\n}\r\n\r\nvar excelConverter = new ExcelConverter();\r\nexcelConverter.Write(people, \"C:\\\\somefolder\\\\people.xlsx\");\r\n```\r\n\r\n## Example: Reading a worksheet\r\n\r\nImplement [IExcelRow](../master/src/Excel.IO/IExcelRow.cs) and define public properties with the same name as columns of the spreadsheet (we'll just reuse the same class from above):\r\n\r\n```csharp\r\npublic class Person : IExcelRow\r\n{\r\n    public string SheetName { get =\u003e \"People Sheet\"; }\r\n\r\n    public string EyeColour { get; set; }\r\n\r\n    public int Age { get; set; }\r\n\r\n    public int Height { get; set; }\r\n}\r\n```\r\n\r\nThen, ask an instance of [ExcelConverter](../master/src/Excel.IO/ExcelConverter.cs) to read an IEnumerable\u003cPerson\u003e from disk:\r\n\r\n```csharp\r\nvar excelConverter = new ExcelConverter();\r\nvar people = excelConverter.Read\u003cPerson\u003e(\"C:\\\\somefolder\\\\people.xlsx\");\r\n\r\nforeach(var person in people)\r\n{\r\n  //do something useful with the data\r\n}\r\n```\r\n\r\n## Feedback\r\n\r\nFor feature requests or bugs, please [post an issue on GitHub](https://github.com/OfficeDev/Excel-IO/issues).\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficedev%2Fexcel-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofficedev%2Fexcel-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofficedev%2Fexcel-io/lists"}