Skip to content

Add Spain National ID validator #7574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
carlos3dx opened this issue Oct 23, 2022 · 1 comment · Fixed by #7575
Closed
1 task done

Add Spain National ID validator #7574

carlos3dx opened this issue Oct 23, 2022 · 1 comment · Fixed by #7575
Labels
enhancement This PR modified some existing files

Comments

@carlos3dx
Copy link
Contributor

carlos3dx commented Oct 23, 2022

Feature description

In Spain all citizens has a National ID composed by 8 numbers plus a letter. The letter in fact is calculated with a modulus of the number and a lookup table, avoiding mistyping the ID or people faking it on the fly-

https://en.wikipedia.org/wiki/Documento_Nacional_de_Identidad_(Spain)#Number

Create a function that given a string like "12345678X" (or "12345678-X", some systems put a dash) returns True or False if it is a valid or not.

Would you like to work on this feature?

  • Yes, I want to work on this feature!
@carlos3dx carlos3dx added the enhancement This PR modified some existing files label Oct 23, 2022
@carlos3dx
Copy link
Contributor Author

Please assign me to it, I have the work done, just remains to make the PR

carlos3dx added a commit to carlos3dx/Python that referenced this issue Oct 23, 2022
cclauss added a commit that referenced this issue Oct 24, 2022
* Add Spain National ID validator (#7574)

* is_spain_national_id()

* Update is_spain_national_id.py

* Some systems add a dash

Co-authored-by: Christian Clauss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant