Git Product home page Git Product logo

dlnvalidation's Introduction

=============
DLNValidation
=============

A python library for validation of USA drivers license numbers.
Dl-number-validation validates if a drivers license is a valid format for the two letter postal code for the state.

Formats are defined by http://www.deverusdemos.com/Help/FlashHelp/Search_Types/Formats_for_MVR_license_numbers.htm

Installation
============
`pip install DLNValidation`

Usage
=====
Typical usage often looks like this::

    from dlnvalidation import is_valid

    if is_valid('C1234567', 'CA'):
        print "Your drivers license number is valid! Yay!"

If you want US territories to be used for validation call `is_valid` with `allow_territories=True`. Be warned, currently these additional territories accept any format of drivers license.

dlnvalidation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dlnvalidation's Issues

Python3 support

Hi @samstr. Thanks for this library. It has been very useful for me. Would you be willing to accept a pull request to add Python3 support?

Thanks

Indiana phone of 10 digits not validated properly?

Thanks for the module.

The validation for Indiana seems to have an issue?

from dlnvalidation import is_valid

is_valid("8922153212", "ID")
False

Where Indiana it is supposed to be valid with 10 digits.
Indiana | 10 digits, or 1 letter + 9 digits
ย 

West Virginia licenses not handled correctly

I recently encountered a WV license in the wild of the form [A-Z]{1}[0-9]{6} which does not match the indicated pattern of 'WV': r'^[0-9]{7}$'. I was sent a picture of it, so I'm confident this is the correct pattern, but obviously I can't share it with you.

Other sources which suggest this is a real pattern:

So the pattern should probably be updated to be something like 'WV': r'^[0-9]{7}$|^[a-z]{1}[0-9]{6}$'

Anyway, if you're accepting PR's, I'm happy to create one. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.