You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

CSVW-validator-lib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

CSVW-validator-lib

CSV on the Web validator according to the W3C recommendations. Validate your CSV files with associated metadata files and download the results in multiple formats (CSV,RDF)! We provide the full functionality with regards to the integration tests: https://w3c.github.io/csvw/tests/#manifest-validation More about W3C recommendations: https://www.w3.org/TR/tabular-data-primer/

1.0.3
nugetNuGet
Version published
Maintainers
1
Created
Source

Validate IT

Welcome to Validate IT - your solution for validating CSV tabular data and metadata, adhering to CSV on the Web recommendations.

Features:

  • validate local CSV files
  • validate local metadata files
  • validate remote CSV files
  • validate remote metadata files
  • save the validation results as CSV!
  • save the validation results as RDF!
  • much more to come!

Documentation (Beta)

You can check all types of documentation (user, developer, administrator) here.

You can also check the main repository of this project.

Main repository

You can find the main repository of the code base here.

Examples from documentation

// Create controller
IController controller = ControllerFactory.CreateController();

string remoteMetadataURL = "https://w3c.github.io/csvw/tests/test011/tree-ops.csv-metadata.json";
string remoteTabularURL = "https://w3c.github.io/csvw/tests/test011/tree-ops.csv";
string localMetadaPath = @"/data/my.csv";
string localTabularPath = @"/data/schema.json";

// starts remote tabular validation
IResult result1 = controller.ProcessTabularData(remoteTabularURL);

// start local tabular validation
IResult result2 = controller.ProcessTabularData(localTabularPath);

// start remote metadata validation
IResult result3 = controller.ProcessMetadata(remoteMetadataURL);

// start local metadata validation
IResult result4 = controller.ProcessMetadata(localMetadaPath);

// review validation result
switch (result1.GetValidationResultType)
{
    case ValidationResultType.VALID:
        Console.WriteLine("Validated files were valid!");
        break;
    case ValidationResultType.WARNING:
        Console.WriteLine("Warnings occurred during the validation!");
        break;
    case ValidationResultType.ERROR:
        Console.WriteLine("Errors occurred during the validaiton!");
        break;
}

// iterate through general errors
foreach (var error in result1.GetValidationDetails.GeneralErrors)
{
    Console.WriteLine(error.GetMessage(CultureInfo.CurrentCulture));
}

// foreach errors related to specific table
foreach(var tableDetails in result1.GetValidationDetails.TableValidationDetails)
{
    foreach(var error in tableDetails.Errors)
    {
        Console.WriteLine(error.GetMessage(CultureInfo.CurrentCulture));
    }
}

// write the results to a file
string resultPath = @"/data/result.csv";
IResultWriter csvResultWriter = ResultWriterFactory.CreateResultWriter(ResultFileFormat.CSV);
csvResultWriter.GenerateResult(resultPath, result1.GetValidationDetails);

Student project

This is student bachelor thesis project and we do not MAKE ANY PROFIT as it is fully open-source project.

Keywords

CSV

FAQs

Package last updated on 27 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.