MichelMichels.BpostSharp.Excel 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MichelMichels.BpostSharp.Excel --version 1.0.0                
NuGet\Install-Package MichelMichels.BpostSharp.Excel -Version 1.0.0                
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="MichelMichels.BpostSharp.Excel" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MichelMichels.BpostSharp.Excel --version 1.0.0                
#r "nuget: MichelMichels.BpostSharp.Excel, 1.0.0"                
#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 MichelMichels.BpostSharp.Excel as a Cake Addin
#addin nuget:?package=MichelMichels.BpostSharp.Excel&version=1.0.0

// Install MichelMichels.BpostSharp.Excel as a Cake Tool
#tool nuget:?package=MichelMichels.BpostSharp.Excel&version=1.0.0                

<h1 align="center"> ✉️ BpostSharp </h1>

<br />

<div align="center"> This projects is a C# wrapper library to obtain Belgian city data from bpost (Belgian national mail service). </div>

<br /> <br />

<details> <summary>Table of Contents</summary>

</details>


Prerequisites

Building

Use Visual Studio 2022 to build the project.

Installation

Get the NuGet packages from nuget.org or search for MichelMichels.BpostSharp in the GUI package manager in Visual Studio.

You can also use the cli of the package manager with following command:

Install-Package MichelMichels.BpostSharp
Install-Package MichelMichels.BpostSharp.Excel
Install-Package MichelMichels.BpostSharp.Web

<br /> <hr>

Getting started

There are 2 versions of BpostSharp:

Name Nuget Description
MichelMichels.BpostSharp.Excel <a href="https://www.nuget.org/packages/MichelMichels.BpostSharp.Excel"><img src="https://img.shields.io/nuget/v/MichelMichels.BpostSharp.Excel"/></a> Excel cache (offline)
MichelMichels.BpostSharp.Web <a href="https://www.nuget.org/packages/MichelMichels.BpostSharp.Web"><img src="https://img.shields.io/nuget/v/MichelMichels.BpostSharp.Web"/></a> Html cache (online)

These 2 versions have following dependency:

Name Nuget Description
MichelMichels.BpostSharp <a href="https://www.nuget.org/packages/MichelMichels.BpostSharp"><img src="https://img.shields.io/nuget/v/MichelMichels.BpostSharp"/></a> This is the core package which contains all interfaces and models.

Example code

Creating a web instance:

ICacheBuilder<CityData> webCacheBuilder = new WebCacheBuilder(BpostWebConstants.DutchEndpoint);
ICityDataService cityDataService = new BelgianCityDataService(webCacheBuilder);

Creating an excel instance:

ICacheBuilder<CityData> webCacheBuilder = new ExcelCacheBuilder("excel-from-bpost.xls");
ICityDataService cityDataService = new BelgianCityDataService(webCacheBuilder);

Querying data:

// Querying by postal code
CityData data = await cityDataService.GetByPostalCode("9000");

// Querying by city name
CityData data = await cityDataService.GetByCityName("Gent");

Code explanation

The querying uses StartsWith(...) and ignores casing.

Data is saved into cache after executing Build() on the ICacheBuilder or after first query, whichever comes earlier. You can clear the cache with Clear().

Credits

Written by Michel Michels.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.2 496 5/13/2024
1.0.1 562 1/15/2024
1.0.0 127 1/13/2024