Skip to main content

Data validator for Flask using SQL-Alchemy, working at Model component with events

Project description

Travis Code Climate Documentation Status PyPI version Coverage Status PyPi status Licence


Description

Data validator for Flask using SQL-Alchemy, working at Model component with events, preventing invalid data in the columns.

Instalation

pip install flask-validator

Documentation

For the online documentation, follow this link

Basic usage

from flask_validator import ValidateInteger, ValidateString

class User(db.Model):
    __tablename__ = 'user'
    id = db.Column(db.Integer, primary_key=True)
    string = db.Column(db.String(80))
    integer = db.Column(db.Integer())

    def __init__(self, string, integer):
        self.string = string
        self.integer = integer

    @classmethod
    def __declare_last__(cls):
        ValidateInteger(User.integer)
        ValidateString(User.string)

Available Constraints

  • Types

  • ValidateInteger

  • ValidateNumeric

  • ValidateString

  • ValidateBoolean

  • Numeric

  • ValidateLenght

  • Comparision

  • ValidateLessThan

  • ValidateLessThanOrEqual

  • ValidateGreaterThan

  • ValidateGreaterThanOrEqual

  • Internet

  • ValidateEmail

  • ValidateRegex

  • ValidateIP

  • ValidateURL

  • Location

  • ValidateCountry

  • ValidateTimezone

  • ValidateLocale

  • Finantial

  • ValidateCreditCard

  • ValidateCurrency

  • ValidateIBAN

  • Others

  • ValidateUUID

  • ValidateISBN

  • ValidateRegex

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

Flask-Validator-0.8.tar.gz (4.9 kB view hashes)

Uploaded Source

Supported by

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