postmates / dlnvalidation Goto Github PK
View Code? Open in Web Editor NEWValidation function for the format of drivers license numbers in the USA
License: MIT License
Validation function for the format of drivers license numbers in the USA
License: MIT License
============= 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.
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
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
ย
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.