Skip to main content

Form validation library for python

Project description

DontTrust

Don't trust your users! Form validation library for Python.

Quick install

pip install donttrust

Usage

Donttrust is not limited to any framework and has no dependencies. Just import it and you're good to go!

# Example usage
from donttrust import DontTrust, Schema, ValidationError

trust = DontTrust(username=Schema().string().required().alphanum(),
                  password=Schema().string().required(),
                  remember_me=Schema().boolean().default(False))

try:
    data = trust.validate(username="hello123", password="abcdefg")
    # data["username"], data["password"] ...
except ValidationError as e:
    print(e.field, e.message)
    # Other error handling

For more info and examples, visit the docs

Development

  1. Clone or fork this repo
  2. Make your changes

    Note: Do NOT change the version number in setup.py. I'll do that myself.

  3. Run the tests in the /tests directory (Done automatically with Github Actions)
  4. PR and away!

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

donttrust-0.1.5.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

donttrust-0.1.5-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

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