Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Custom cerberus.Validator for phone numbers

Project Description


.. image::

.. image::

Custom `cerberus.Validator` for phone numbers

* Free software: MIT license


* Custom validation mixin for `Cerberus`_ or an `Eve`_ API.
Uses the `phonenumbers`_ package for validation's and formatting.
Tested under Python 2.7, Python 3.3, Python 3.4, and Python 3.5.

Basic Usage

Cerberus Usage:
.. code-block:: python

from phonevalidator import Validator

schema = {
'phone': {
'type': 'phonenumber',
'formatPhoneNumber': True,
'phoneNumberFormat': 'NATIONAL',
'region': 'US',

doc = {'phone': '5135555555'}

v = Validator(schema)
# True
# {'phone': '(513) 555-5555'}

doc = {'phone': 'gibberish'}
# False

Eve Usage:
.. code-block:: python

from phonevalidator import ValidatorMixin
from import Validator
from eve import Eve

class MyValidator(Validator, ValidatorMixin):
""" My custom validator that includes phone number

app = Eve(validator=MyValidtor)


This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

This package also use the `phonenumbers`_ package which is licensed under
the `Apache2`_ license. The `Cerberus`_ package which is an open-source project.
`Eve`_ is licensed under the `BSD`_ license.

.. _Cookiecutter:
.. _`audreyr/cookiecutter-pypackage`:
.. _`Cerberus`:
.. _`Eve`:
.. _`phonenumbers`:
.. _`Apache2`:
.. _`BSD`:


0.0.1 (2016-07-22)

Initial dev package.

1.0.0 (2016-07-23)

Only support's python-3.5

1.1.0 (2016-07-24)

Adds support and tests for python-2.7

Release History

This version
History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(24.4 kB) Copy SHA256 Hash SHA256
Source Oct 16, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting