Skip to main content

schema-resume-validator

PyPI version Python versions License: MIT

Official Python package for validating resumes against the Schema Resume JSON Schema.

Installation

pip install schema-resume-validator

For XML validation support:

pip install schema-resume-validator[xml]

Usage

Basic Validation

from schema_resume import validate_resume

resume = {
    "$schema": "https://schema-resume.org/schema.json",
    "basics": {
        "name": "John Doe",
        "label": "Software Engineer",
        "email": "john.doe@example.com"
    },
    "work": [
        {
            "name": "Tech Corp",
            "position": "Senior Developer",
            "startDate": "2020-01"
        }
    ]
}

result = validate_resume(resume)

if result["valid"]:
    print("✓ Resume is valid!")
else:
    print("✗ Validation errors:")
    for error in result["errors"]:
        print(f"  - {error['path']}: {error['message']}")

Using the Validator Class

from schema_resume import ResumeValidator

# Create validator instance
validator = ResumeValidator()

# Validate from dictionary
resume_data = {"basics": {"name": "Jane Doe"}}
result = validator.validate(resume_data)

# Validate from JSON file
result = validator.validate("path/to/resume.json")

# Validate from JSON string
json_string = '{"basics": {"name": "John Smith"}}'
result = validator.validate(json_string)

# Access schema files
schema = validator.get_schema()
meta_schema = validator.get_meta_schema()
context = validator.get_context()

Custom Schema

from pathlib import Path
from schema_resume import ResumeValidator

# Use custom schema file
validator = ResumeValidator(schema_path=Path("custom-schema.json"))
result = validator.validate(resume_data)

API Reference

validate_resume(resume)

Convenience function to validate a resume.

Parameters:

  • resume: Resume data as dict, JSON string, or Path to JSON file

Returns: Dictionary with:

  • valid (bool): Whether the resume is valid
  • errors (list): List of validation errors (empty if valid)

ResumeValidator

Main validator class.

__init__(schema_path=None)

Initialize validator with optional custom schema.

Parameters:

  • schema_path (optional): Path to custom schema file

validate(resume)

Validate a resume document.

Parameters:

  • resume: Resume data as dict, JSON string, or Path to JSON file

Returns: Dictionary with validation results

get_schema()

Returns the JSON Schema dictionary.

get_meta_schema()

Returns the meta-schema dictionary.

get_context()

Returns the JSON-LD context dictionary.

Validation Examples

Complete Resume Example

from schema_resume import validate_resume

resume = {
    "$schema": "https://schema-resume.org/schema.json",
    "basics": {
        "name": "Jane Smith",
        "label": "Full Stack Developer",
        "email": "jane@example.com",
        "phone": "+1-555-123-4567",
        "url": "https://janesmith.dev",
        "summary": "Experienced developer with 8+ years in web development",
        "location": {
            "city": "San Francisco",
            "countryCode": "US",
            "region": "California"
        }
    },
    "work": [
        {
            "name": "Tech Company",
            "position": "Senior Developer",
            "startDate": "2020-03",
            "highlights": [
                "Led team of 5 developers",
                "Improved performance by 40%"
            ]
        }
    ],
    "education": [
        {
            "institution": "University of Technology",
            "area": "Computer Science",
            "studyType": "Bachelor",
            "startDate": "2012",
            "endDate": "2016"
        }
    ],
    "skills": [
        {
            "name": "Web Development",
            "level": "Expert",
            "keywords": ["JavaScript", "React", "Node.js"]
        }
    ]
}

result = validate_resume(resume)
print(f"Valid: {result['valid']}")

Handling Validation Errors

from schema_resume import ResumeValidator

validator = ResumeValidator()

invalid_resume = {
    "basics": {
        "email": "not-an-email"  # Invalid email format
    }
}

result = validator.validate(invalid_resume)

if not result["valid"]:
    for error in result["errors"]:
        print(f"Field: {error['path']}")
        print(f"Error: {error['message']}")
        print(f"Validator: {error['validator']}")
        print()

Validating from File

from schema_resume import validate_resume
from pathlib import Path

# Validate from file path
result = validate_resume(Path("resume.json"))

# Or using string path
result = validate_resume("resume.json")

if result["valid"]:
    print("Resume file is valid!")

Development

Running Tests

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=schema_resume --cov-report=html

Code Formatting

# Format code with black
black src/

# Check with flake8
flake8 src/

# Type checking with mypy
mypy src/

Schema Files Included

This package includes all necessary schema files:

  • schema.json - Main JSON Schema for resume validation
  • meta-schema.json - Meta-schema for self-validation
  • context.jsonld - JSON-LD context for semantic web integration
  • schema-resume.xsd - XML Schema Definition (XSD) for XML validation

Support

For questions or issues:

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please see the Contributing Guide.

Metadata

Release files for schema-resume-validator 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schema-resume-validator 1.3.3
File Size Uploaded Provenance Actions
schema_resume_validator-1.3.3.tar.gz 20.7 kB Without provenance Details for schema_resume_validator-1.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schema-resume-validator 1.3.3
File Interpreter ABI Platform Actions
schema_resume_validator-1.3.3-py3-none-any.whl Python 3 none any Details for schema_resume_validator-1.3.3-py3-none-any.whl

Total release size: 40.4 kB

Release files / schema_resume_validator-1.3.3.tar.gz

Download URL schema_resume_validator-1.3.3.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7d4ab8698c17ba8629ed27ec8475a833ca4cc7e00762b41eb185db95ef9ac6a3
BLAKE2b-256 checksum
How to use checksums
a8ca450eff10627eb562b717218316a438865516f96e866bab38ab379f41ebb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / schema_resume_validator-1.3.3-py3-none-any.whl

Download URL schema_resume_validator-1.3.3-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dde85e2e18b152b7e3503d7e17c5df4e978e878f1730357e2137e7cae7035bf6
BLAKE2b-256 checksum
How to use checksums
98b53a5d959f5fd70c88f4c55bf27a0ad4b99ecfb71869da43b314a9f0f005c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for schema-resume-validator 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page