BMECat.net 4.6.0

dotnet add package BMECat.net --version 4.6.0
                    
NuGet\Install-Package BMECat.net -Version 4.6.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.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BMECat.net" Version="4.6.0" />
                    
Directory.Packages.props
<PackageReference Include="BMECat.net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BMECat.net --version 4.6.0
                    
#r "nuget: BMECat.net, 4.6.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.
#:package BMECat.net@4.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BMECat.net&version=4.6.0
                    
Install as a Cake Addin
#tool nuget:?package=BMECat.net&version=4.6.0
                    
Install as a Cake Tool

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 reads both version 1.2 and 2005 (including 2005fd), including extended data structures like product features, MIME infos, references, logistics details, parties and catalog structures. Catalogs are written as BMEcat 2005 documents conforming to the official schema, including the extended data structures listed above. If you are looking for writing further special elements, 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.

Sponsoring

Implementing and maintaining this library is a lot of hard work. I'm doing this in my spare time, there is no company behind developing BMECat.net. Support me in this work and help making this library better:

:heart: Sponsor me on github

In particular, I am searching for sponsors for:

  • Comprehensive write support

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 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.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.6.0 132 10/28/2026
4.5.0 1,859 11/23/2023
4.4.0 627 8/16/2023
4.3.0 298 8/16/2023
4.2.1 305 8/7/2023
4.2.0 327 7/2/2023
4.1.0 312 6/26/2023
4.0.1 326 6/17/2023
4.0.0 317 6/17/2023
3.2.0 392 4/12/2023
3.1.0 374 4/4/2023
3.0.0 384 3/28/2023
2.4.1 386 3/28/2023
2.4.0 358 3/28/2023
2.3.0 361 3/27/2023
2.2.1 1,791 3/26/2023
2.2.0 369 3/25/2023
2.1.0 401 3/19/2023
2.0.0 409 3/19/2023

4.6.0:
- Writer: buyer and supplier as parties incl. contact details, product features and classification, MIME infos, catalog structure with product to group mappings, product references and logistics details
- Writer: documents conform to the BMEcat 2005 schema, uses the BMEcat 2005 namespace instead of 2005fd, STOCK and the deprecated EAN element are no longer written (the EAN is written as INTERNATIONAL_PID)
- Reader: fixes for parties, product order, encodings, German dates and the catalog name of BMEcat 2005 documents
- Reading and writing of numbers and dates independent from the machine culture
- Non-seekable streams are rejected with IllegalStreamException, temporary files are always cleaned up
- New target frameworks: netstandard2.0, net8.0 and net10.0