Skip to main content

Python data validation library

Project description

PyDataValidator

Documentation PyPI

Introduction

PyDataValidator is a powerful and flexible Python library designed to streamline data validation processes. Whether you're building data pipelines, developing web applications, or handling complex datasets, PyDataValidator offers a comprehensive suite of tools to ensure your data is clean, consistent, and reliable.

Key Features

  • Comprehensive Rule Set:
    • Validate data with a wide range of built-in rules, including checks for required fields, conditional presence, format validation, and more.
    • Examples include rules for ensuring fields are present, validating email formats, checking numeric ranges, and enforcing unique constraints.
  • Custom Validators:
    • Easily create and integrate custom validation rules tailored to your specific needs.
    • Extend the library with your own validation logic to handle any specific data requirements.
  • Chainable Validation:
    • Build complex validation logic by chaining multiple rules together for more nuanced data integrity checks.
    • Combine rules like Required, Min, and Email in a single, readable chain to enforce multiple conditions on a single field.
  • Detailed Error Reporting:
    • Generate clear, actionable error messages that help you quickly identify and resolve data issues.
    • Each validation failure is accompanied by descriptive messages indicating the nature of the error and the affected data fields.
  • Ease of Use:
    • Designed with simplicity in mind, PyDataValidator's intuitive API allows you to validate data with minimal code.
    • Quickly set up validations using a declarative syntax that integrates seamlessly into your Python projects.
  • Highly Extensible:
    • Flexible architecture that integrates seamlessly with other libraries and frameworks, making it ideal for use in a variety of projects.
    • Whether you're working with Flask, Django, or standalone scripts, PyDataValidator adapts to your environment.

Installation

pip install py_data_validator
from py_data_validator.validator import Validator

# Define the data to be validated
data = {"name": "John Doe", "email": "johndoe@example.com"}

# Define the validation rules
rules = {
    "name": ["required"],
    "email": ["required", "email"],
}

# Create a Validator instance
validator = Validator(data,rules)

# Perform the validation
response = validator.validate()

# Check if validation failed and print the errors if any
if response.validated:
    print("Validation passed!", response.data)
else:
    print("Validation failed with errors:", response.errors)

After installing the PyDataValidator package, providing a list of available validation rules is a great way to help users quickly understand the capabilities of the library..

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

More Information

For more information, visit the documentation or view the package on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_data_validator-0.1.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_data_validator-0.1.4-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file py_data_validator-0.1.4.tar.gz.

File metadata

  • Download URL: py_data_validator-0.1.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for py_data_validator-0.1.4.tar.gz
Algorithm Hash digest
SHA256 85ea9c8fbdb6334ba4cef86c27178916f8e56a498d62a3793fb9ba9d9f519684
MD5 f176ca3cb549ba89d3f2ee618653d53f
BLAKE2b-256 8283dd2d4035c1815fa7b021f09ddc7763d131852c1518ac1ed439484e1c3508

See more details on using hashes here.

File details

Details for the file py_data_validator-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: py_data_validator-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for py_data_validator-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c70d98f5ad23f0fc0805678fc08cea60e534e52487543cd27c777bbcc3f5bc57
MD5 006332503c7e833edcecdf28389e9ca8
BLAKE2b-256 606c71e704f94c7c2dc3ce516ab367c334115c6abf3289469a9a43dacbbc073d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page