<commit_before>Peewee Validates
################

A simple and flexible model and data validator for `Peewee ORM <http://docs.peewee-orm.com/>`_.

.. image:: http://img.shields.io/travis/timster/peewee-validates.svg?style=flat-square
    :target: http://travis-ci.org/timster/peewee-validates
    :alt: Build Status

.. image:: http://img.shields.io/coveralls/timster/peewee-validates.svg?style=flat-square
    :target: https://coveralls.io/r/timster/peewee-validates
    :alt: Code Coverage

.. image:: http://img.shields.io/pypi/v/peewee-validates.svg?style=flat-square
    :target: https://pypi.python.org/pypi/peewee-validates
    :alt: Version

.. image:: http://img.shields.io/pypi/dm/peewee-validates.svg?style=flat-square
    :target: https://pypi.python.org/pypi/peewee-validates
    :alt: Downloads

Requirements
============

* python >= 3.3
* peewee >= 2.8.0
* python-dateutil >= 2.5.0

Installation
============

This package can be installed using pip:

    pip install peewee-validates

Usage
=====

Here's a quick teaser of what you can do with peewee-moves:

.. code:: python

    import peewee
    from peewee_validates import ModelValidator

    class Category(peewee.Model):
        code = peewee.IntegerField(unique=True)
        name = peewee.CharField(null=False, max_length=250)

    obj = Category(code=42)

    validator = ModelValidator(obj)
    validator.validate()

    print(validator.errors)

    {'name': 'is required', 'code': 'must be unique'}

In fact, there is also a generic validator that does not even require a model:

.. code:: python

    from peewee_validates import Validator, Field

    class SimpleValidator(Validator):
        name = Field('str', required=True, max_length=250)
        code = Field('str', required=True, max_length=4)

    validator = SimpleValidator(obj)
    validator.validate({'code': 'toolong'})

    print(validator.errors)

    {'name': 'is required', 'code': 'too long'}

Todo
====

* More documentation
* More examples

Feedback
========

This package is very immature. If you have any comments, suggestions, feedback, or issues, please
feel free to send me a message or submit an issue on Github.
<commit_msg>Corrected readme.<commit_after>Peewee Validates
################

A simple and flexible model and data validator for `Peewee ORM <http://docs.peewee-orm.com/>`_.

.. image:: http://img.shields.io/travis/timster/peewee-validates.svg?style=flat-square
    :target: http://travis-ci.org/timster/peewee-validates
    :alt: Build Status

.. image:: http://img.shields.io/coveralls/timster/peewee-validates.svg?style=flat-square
    :target: https://coveralls.io/r/timster/peewee-validates
    :alt: Code Coverage

.. image:: http://img.shields.io/pypi/v/peewee-validates.svg?style=flat-square
    :target: https://pypi.python.org/pypi/peewee-validates
    :alt: Version

.. image:: http://img.shields.io/pypi/dm/peewee-validates.svg?style=flat-square
    :target: https://pypi.python.org/pypi/peewee-validates
    :alt: Downloads

Requirements
============

* python >= 3.3
* peewee >= 2.8.0
* python-dateutil >= 2.5.0

Installation
============

This package can be installed using pip:

::

    pip install peewee-validates

Usage
=====

Here's a quick teaser of what you can do with peewee-validates:

.. code:: python

    import peewee
    from peewee_validates import ModelValidator

    class Category(peewee.Model):
        code = peewee.IntegerField(unique=True)
        name = peewee.CharField(null=False, max_length=250)

    obj = Category(code=42)

    validator = ModelValidator(obj)
    validator.validate()

    print(validator.errors)

    {'name': 'is required', 'code': 'must be unique'}

In fact, there is also a generic validator that does not even require a model:

.. code:: python

    from peewee_validates import Validator, Field

    class SimpleValidator(Validator):
        name = Field('str', required=True, max_length=250)
        code = Field('str', required=True, max_length=4)

    validator = SimpleValidator(obj)
    validator.validate({'code': 'toolong'})

    print(validator.errors)

    {'name': 'is required', 'code': 'too long'}

Todo
====

* More documentation
* More examples

Feedback
========

This package is very immature. If you have any comments, suggestions, feedback, or issues, please
feel free to send me a message or submit an issue on Github.

{'fraction_non_alphanumeric': 0.14648080438756855, 'fraction_numerical': 0.007769652650822669, 'mean_word_length': 3.731891891891892, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5465474', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1448, 'n_words': 351}