DataValidator

A completely offline, privacy-focused data format validator for JSON, YAML, XML, and TOML files.
π Try it online: https://freedatavalidator.xyz
Quick Links
Privacy Guarantee
π 100% Private & Secure:
- β No data logging, tracking, or retention
- β No network connections
- β No clipboard access
- β No telemetry or analytics
- β
All validation happens locally on your machine
- β
Your data never leaves your computer
Features
- Multi-format support: JSON, YAML, XML, TOML
- Auto-detection: Automatically detects file format
- Batch processing: Validate multiple files or entire directories
- CLI friendly: Supports piping and stdin input
- Zero configuration: Works out of the box
- Fast: Built in Go for performance
- Cross-platform: Works on Linux, macOS, and Windows
Installation
As a Go Module
go get github.com/akhilesharora/datavalidator/pkg/validator
go install github.com/akhilesharora/datavalidator/cmd/datavalidator@latest
Download Binary
Download the latest release from the releases page.
From Source
git clone https://github.com/akhilesharora/datavalidator
cd datavalidator
go build -o datavalidator ./cmd/datavalidator
Usage
CLI Usage
# Validate a single file
datavalidator validate config.json
# Validate multiple files
datavalidator validate config.json data.yaml settings.toml
# Validate all files in a directory
datavalidator validate ./configs/
# Pipe data through stdin
echo '{"name": "test"}' | datavalidator validate
# Specify format explicitly
datavalidator validate --format json config.txt
# Start web interface
datavalidator web --port 8080
Go Module Usage
package main
import (
"fmt"
"github.com/akhilesharora/datavalidator/pkg/validator"
)
func main() {
// Validate with auto-detection
result := validator.ValidateAuto([]byte(`{"test": true}`))
fmt.Printf("Valid: %v, Format: %s\n", result.Valid, result.Format)
// Validate with specific format
v, _ := validator.NewValidator(validator.FormatJSON)
result = v.ValidateString(`{"test": true}`)
if !result.Valid {
fmt.Printf("Error: %s\n", result.Error)
}
}
Options
-f, --format string Format to validate (json, yaml, xml, toml, auto) (default "auto")
-q, --quiet Only show errors
-j, --json Output results as JSON
-h, --help Help for validate
Examples
Validate JSON file:
datavalidator validate config.json
β config.json: Valid json
Validate with errors:
datavalidator validate broken.json
β broken.json: Invalid json - invalid character '}' looking for beginning of object key string
JSON output for automation:
datavalidator validate --json config.json
[
{
"valid": true,
"format": "json",
"filename": "config.json"
}
]
Quiet mode (only errors):
datavalidator validate --quiet ./configs/
β configs/broken.yaml: Invalid yaml - yaml: line 5: mapping values are not allowed in this context
Stdin validation:
curl -s https://api.example.com/data | datavalidator validate --format json
| Format |
Extensions |
Auto-detection |
| JSON |
.json |
β
|
| YAML |
.yaml, .yml |
β
|
| XML |
.xml |
β
|
| TOML |
.toml |
β
|
Exit Codes
0 - All files are valid
1 - One or more files are invalid or errors occurred
Use Cases
- CI/CD pipelines: Validate configuration files before deployment
- Development: Check data files during development
- Data processing: Validate input files before processing
- Configuration management: Ensure config files are well-formed
- API testing: Validate API responses
Privacy & Security
This tool is designed with privacy as the top priority:
- No network access: The binary makes zero network connections
- No data persistence: No temporary files, logs, or caches are created
- No external dependencies: All validation is done with standard libraries
- Memory safety: Data is processed in memory and immediately discarded
- Open source: Full source code available for audit
Development
Building from Source
# Clone the repository
git clone https://github.com/akhilesharora/datavalidator.git
cd datavalidator
# Install dependencies
go mod download
# Build
go build -o datavalidator ./cmd/datavalidator
# Run tests
go test ./...
# Run locally
./datavalidator web --port 8080
Project Structure
datavalidator/
βββ cmd/
β βββ datavalidator/ # CLI application
βββ pkg/
β βββ validator/ # Go module package
βββ web/
β βββ static/ # Web interface
βββ go.mod # Go module file
βββ go.sum # Go dependencies
βββ README.md # This file
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Key principles:
- π Maintain privacy-first approach
- π« No tracking, analytics, or data collection
- β‘ Keep it fast and lightweight
- π Document your changes
License
MIT License - see LICENSE file for details.
Author
Created by Akhilesh Arora
β Star this repo if you find it useful!