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 details)

Uploaded Source

File details

Details for the file Flask-Validator-0.8.tar.gz.

File metadata

  • Download URL: Flask-Validator-0.8.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Flask-Validator-0.8.tar.gz
Algorithm Hash digest
SHA256 38f6f4db7e2dae16134b09d53b767bc078c95088e177ae3636f3b9eca7e59342
MD5 8c72bf3fb9c4d63e4a9d98b70e9e5046
BLAKE2b-256 9a9344a10a97f9922a8fa6974b82663f2be2fbbd66a44aef1885dff5e8bcb0e6

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