BMECat.net 4.5.0

dotnet add package BMECat.net --version 4.5.0
NuGet\Install-Package BMECat.net -Version 4.5.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="BMECat.net" Version="4.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BMECat.net --version 4.5.0
#r "nuget: BMECat.net, 4.5.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 BMECat.net as a Cake Addin
#addin nuget:?package=BMECat.net&version=4.5.0

// Install BMECat.net as a Cake Tool
#tool nuget:?package=BMECat.net&version=4.5.0

BMECat.net

NuGet

BMECat.net is a .net open source library that allows you to read and write BMEcat descriptions would be a software component that provides developers with a set of tools and functionalities to manipulate BMEcat files programmatically. This library would enable software applications to easily integrate BMEcat support, allowing for the efficient exchange of product information between different systems and partners. Our aim is to support real world BMECat files which often do not match the standard 100%. Developers could use this library to parse, create, and modify BMEcat documents, accessing product data in a standardized and structured way. Overall, this library simplifies the development of software applications that rely on BMEcat for product information exchange.

The library supports both version 1.2 and 2005 (including 2005fd). Reading of extended data structures (like product features, address details) is implemented. If you are looking for writing special elements and extended data structures, I'm happy to accept sponsoring.

Core features:

  • High performance: reads a 10K product catalog with all extensions in under 4 seconds on an average i7 workstation
  • Trading time for memory: focus on execution time instead of memory consumption.
  • Version agnostic: allows to read catalog structures without paying attention to the actual version
  • Non-standard-friendly: supports various non-standard elements, mainly though the mix of 1.2 and 2005 formats that are found in real life

The library has a sister library (https://github.com/stephanstapel/OpenTrans.net) which allows to process order files.

License

Subject to the Apache license http://www.apache.org/licenses/LICENSE-2.0.html

Installation

Just use nuget or Visual Studio Package Manager and download 'BMECat.net'.

You can find more information about the nuget package here:

NuGet

https://www.nuget.org/packages/BMECat.net/

Usage

Loading existing catalogue file is possible in both synchronous and asynchronous way. Synchronously, it works like this:

ProductCatalog catalog = ProductCatalog.Load("test.xml");

while asynchronously, loading works like this:

ProductCatalog catalog = await ProductCatalog.LoadAsync("test.xml");

The library automatically detects if the BMECat file is written in 1.2 format or 2005 standard or a mixture (see below for details about non-standard formats).

If you should want to create a product catalog based on your own data and export it into BMECat, use this code:

ProductCatalog catalog = new ProductCatalog()
{
  Languages = { LanguageCodes.DEU },
  CatalogId = "QA_CAT_002",
  CatalogVersion = "001.002",
  CatalogName = "Office Material",
  GenerationDate = new System.DateTime(2004, 8, 20, 10, 59, 54),
  Currency = CurrencyCodes.EUR
};

catalog.Products.Add(new Product()
{
  No = "Q20-P09",
  PIds = new List<ProductId>() { new ProductId() { Type = ProductIdTypes.EAN, Id = "0000000011" } },    
  DescriptionShort = "Post-Safe Polythene Envelopes Deutsch",
  DescriptionLong = "Deutsch All-weather lightweight envelopes protect your contents and save you money. ALL - WEATHER.Once sealed, Post-Safe envelopes are completely waterproof.Your contents won't get damaged.",
  Stock = 100,
  Prices = new List<ProductPrice>()
  {
      new ProductPrice()
      {
          Currency = CurrencyCodes.EUR,
          Amount = 16.49m,
          Tax = 0.19m
      }
  }
});


catalog.Save("test.xml");

Create a new ProductCatalog object and set the necessary properties to set up the catalogue:

ProductCatalog catalog = new ProductCatalog()
{
  ...
}

Then add products to the product list property:

catalog.Products.Add(new Product()
{
  ...
}

and finally save the catalogue either to stream or to file. This is possible in synchronous and asynchronous way. Synchronously works like this:

catalog.Save("test.xml");

and asynchronously, it works like this:

await catalog.SaveAsync("test.xml");

The standard export format is BMECat 2005. If you should want to export legacy BMECat 1.2 as well, please drop me a message or issue a pull request. I'm more than happy to provide feedback and merge it.

Real world BMECat files

BMECat in the wild is not always what the designers thought it should be. The library currently supports:

  • Missing xml namespace information on <BMECAT> root node (BMECat 2005)
  • Using of buyer and supplier elements instead of parties (BMECat 2005)
  • Handling of different quantity codes via BMECatExtension class (all versions)

Building on your own

Prerequisites:

  • Visual Studio >= 2017
  • .net Framework >= 4.6.1 (for .net Standard 2.0 support)

Open BMECat.net/BMECat.net.sln solution file. Choose Release or Debug mode and hit 'Build'. That's it.

For running the tests, open BMECat.net-Test/BMECat.net-Test.sln and run the unit tests. The tests show good cases on how to use the library.

More information

More information about BMEcat can be found here:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

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
4.5.0 318 11/23/2023
4.4.0 441 8/16/2023
4.3.0 113 8/16/2023
4.2.1 124 8/7/2023
4.2.0 138 7/2/2023
4.1.0 114 6/26/2023
4.0.1 112 6/17/2023
4.0.0 110 6/17/2023
3.2.0 151 4/12/2023
3.1.0 146 4/4/2023
3.0.0 167 3/28/2023
2.4.1 174 3/28/2023
2.4.0 165 3/28/2023
2.3.0 162 3/27/2023
2.2.1 157 3/26/2023
2.2.0 166 3/25/2023
2.1.0 188 3/19/2023
2.0.0 181 3/19/2023

4.5.0: bugfix for reading non-conformant BMECat 2005 files