Px.Utils 1.0.0

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

// Install Px.Utils as a Cake Tool
#tool nuget:?package=Px.Utils&version=1.0.0

Px.Utils

Px.Utils is a .NET library for reading and processing px files and processing data in px-type cube format. The goal of this library is to offer a high performance and easy to use library that can be integrated into any .NET project. This project aims to follow these core design principles:

High performance

Everything is designed with performance in mind. Px files are commonly used in webserver environments where performance and low memory usage is important.

Be as unopinionated as possible

We do not want to limit the user if not absolutely necessary. There are variations in the metadata between users and we want to support as many as possible.

High modularity

Extending the library with a new features should be as easy as possible and every module should be useable on its own.

Features

Reading the px files

TBA

Validation

Px file validation

Px files can be validated either as a whole by using PxFileValidator or by using individual validators - SyntaxValidator, ContentValidator and DataValidator - for different parts of the file. Custom validation functions or validator classes can be added to the validation processes.

PxFileValidator

PxFileValidator is a class that validates the whole px file including its data, metadata syntax and metadata contents. The class can be instantiated with the following parameters:

  • stream (Stream): The stream of the px file to be validated
  • filename (string): Name of the file to be validated
  • encoding (Encoding, optional): Encoding of the px file. Default is Encoding.Default
  • syntaxConf (PxFileSyntaxConf, optional): Object that contains px file syntax configuration tokens and symbols.

Custom validator objects can be injected by calling the SetCustomValidatorFunctions or SetCustomValidators methods of the PxFileValidator object. Custom validators must implement either the IPxFileValidator or IPxFileValidatorAsync interface. Custom validation methods are stored in CustomSyntaxValidationFunctions and CustomContentValidationFunctions objects for syntax and content validation processes respectively.

Once the PxFileValidator object is instantiated, either the Validate or ValidateAsync method can be called to validate the px file. The Validate method returns a ValidationResult object that contains the validation results as ValidationFeedbackItem object array.

SyntaxValidator

SyntaxValidator is a class that validates the syntax of a px file's metadata. It needs to be run before other validators, because both the ContentValidator and DataValidator require information from the SyntaxValidationResult object that SyntaxValidator Validate and ValidateAsync methods return. The class can be instantiated with the following parameters:

  • stream (Stream): The stream of the px file to be validated
  • encoding (Encoding): Encoding of the px file.
  • filename (string): Name of the file to be validated
  • syntaxConf (PxFileSyntaxConf, optional): Object that contains px file syntax configuration tokens and symbols.
  • customValidationFunctions (CustomSyntaxValidationFunctions, optional): Object that contains custom validation functions for the syntax validation process.
  • leaveStreamOpen (bool, optional): If true, the stream will not be closed after the validation process. Default is false.
ContentValidator

ContentValidator class validates the integrity of the contents of a px file's metadata. It needs to be run after the SyntaxValidator, because it requires information from the SyntaxValidationResult object that SyntaxValidator Validate and ValidateAsync methods return. The class can be instantiated with the following parameters:

  • filename (string): Name of the file to be validated
  • encoding (Encoding): Encoding of the px file.
  • entries (ValidationStructuredEntry[]): Array of ValidationStructuredEntry objects that contain the metadata entries of the px file. This object is returned by the SyntaxValidator Validate and ValidateAsync methods.
  • customContentValidationFunctions (CustomContentValidationFunctions, optional): Object that contains custom functions for validating the px file metadata contents.
  • syntaxConf (PxFileSyntaxConf, optional): Object that contains px file syntax configuration tokens and symbols.
DataValidator

DataValidator class is used to validate the data section of a px file. It needs to be run after the SyntaxValidator, because it requires information from both the SyntaxValidationResult and ContentValidationResult objects that SyntaxValidator and ContentValidator Validate and ValidateAsync methods return. The class can be instantiated with the following parameters:

  • stream (Stream): Px file stream to be validated
  • rowLen (int): Length of one row of Px file data. ContentValidationResult object contains this information.
  • numOfRows (int): Amount of rows of Px file data. This information is also stored in ContentValidationResult object.
  • filename (string): Name of the file being validated
  • startRow (long): The row number where the data section starts. This information is stored in the SyntaxValidationResult object.
  • encoding (Encoding, optional): Encoding of the stream
  • conf (PxFileSyntaxConf, optional): Syntax configuration for the Px file
Database validation

TBA

Data models

TBA

Computing

TBA

Installing

TBA when published to NuGet

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.0 66 6/10/2024