ExcelShaper 1.0.1

dotnet add package ExcelShaper --version 1.0.1
NuGet\Install-Package ExcelShaper -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExcelShaper" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExcelShaper --version 1.0.1
#r "nuget: ExcelShaper, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ExcelShaper as a Cake Addin
#addin nuget:?package=ExcelShaper&version=1.0.1

// Install ExcelShaper as a Cake Tool
#tool nuget:?package=ExcelShaper&version=1.0.1

ExcelShaper

ExcelShaper is a .NET library designed to facilitate reading and shaping Excel files. It provides convenient methods for extracting data from Excel files based on sheet index or header names and offers custom conversion capabilities to convert Excel data into custom types.

Table of Contents

Installation

ExcelShaper is available as a NuGet package. You can install it via NuGet Package Manager or .NET CLI.

dotnet add package ExcelShaper

Usage

Reading Excel Files

By Sheet Index
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByIndex(filePath);
By Header Names
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath);

Custom Conversion

public class Person
{
    public int Index { get; set; }
    public string FirstName { get; set; } = "";

    //more properties
}

string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath, (rowData) =>
            {
                return new Person
                {
                    Age = int.Parse(rowData["age"]),
                    Country = rowData["country"],
                    
                    //more properties
                };
            });

Handling Date Formats

string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath, (rowData) =>
{
    // Define your conversion logic here
},sheetIndex : 1,dateFormat : "dd/MM/yyyy");

Contributing

Contributions are welcome! If you encounter any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.

To contribute to ExcelShaper, follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/improvement).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add new feature').
  5. Push to the branch (git push origin feature/improvement).
  6. Create a new Pull Request.

Please make sure to follow the code style and conventions used in the project and ensure that your changes pass all tests.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 87 5/22/2024
1.0.0 76 5/22/2024