# Credit Card Validator
This Python module provides a function to validate credit card numbers using the Luhn algorithm.
## Installation
No installation is required. Simply copy the `validator.py` file into your project.
## Usage
Import the `validate` function from the module and use it to check if a credit card number is valid.
### Example
```python
from validator import validatorLuhn
# Example credit card numbers
card_number1 = "4539 1488 0343 6467" # Valid Visa card number
card_number2 = "8273 1232 7352 0569" # Invalid card number
# Validate the card numbers
is_valid1 = validatorLuhn.validate(card_number1)
is_valid2 = validatorLuhn.validate(card_number2)
print(f"Card number {card_number1} is valid: {is_valid1}")
print(f"Card number {card_number2} is valid: {is_valid2}")
Raw data
{
"_id": null,
"home_page": "https://github.com/teanus/Validator-Luhn",
"name": "validator-luhn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "teanus",
"author_email": "teanus.ti@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2a/aa/12423cc3647fad561f5eb331b7a61e2ccb4c7633800a23c2a5d151e076e0/validator_luhn-0.1.1.tar.gz",
"platform": null,
"description": "# Credit Card Validator\r\n\r\nThis Python module provides a function to validate credit card numbers using the Luhn algorithm.\r\n\r\n## Installation\r\n\r\nNo installation is required. Simply copy the `validator.py` file into your project.\r\n\r\n## Usage\r\n\r\nImport the `validate` function from the module and use it to check if a credit card number is valid.\r\n\r\n### Example\r\n\r\n```python\r\nfrom validator import validatorLuhn\r\n\r\n# Example credit card numbers\r\ncard_number1 = \"4539 1488 0343 6467\" # Valid Visa card number\r\ncard_number2 = \"8273 1232 7352 0569\" # Invalid card number\r\n\r\n# Validate the card numbers\r\nis_valid1 = validatorLuhn.validate(card_number1)\r\nis_valid2 = validatorLuhn.validate(card_number2)\r\n\r\nprint(f\"Card number {card_number1} is valid: {is_valid1}\")\r\nprint(f\"Card number {card_number2} is valid: {is_valid2}\")\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Simple credit card validator using Luna algorithm",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/teanus/Validator-Luhn"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dda0caeda40636497c2b440e789f17492f0c3af9749e5ad98b7524f9b775f592",
"md5": "4b7212d12a913ef25347e31719241e91",
"sha256": "fd3d871b398de53b27417a86a21a399a5a8a2bf07caeea86f8cf7da3e4ebe3ff"
},
"downloads": -1,
"filename": "validator_luhn-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4b7212d12a913ef25347e31719241e91",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 2928,
"upload_time": "2024-08-06T18:16:25",
"upload_time_iso_8601": "2024-08-06T18:16:25.203927Z",
"url": "https://files.pythonhosted.org/packages/dd/a0/caeda40636497c2b440e789f17492f0c3af9749e5ad98b7524f9b775f592/validator_luhn-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2aaa12423cc3647fad561f5eb331b7a61e2ccb4c7633800a23c2a5d151e076e0",
"md5": "2925793dd1f7f2020d225235a2391342",
"sha256": "0ab35b82fa1b3b96924b0627391ab0746323414ce491d7791999ca68ee730f08"
},
"downloads": -1,
"filename": "validator_luhn-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "2925793dd1f7f2020d225235a2391342",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 2481,
"upload_time": "2024-08-06T18:16:27",
"upload_time_iso_8601": "2024-08-06T18:16:27.093925Z",
"url": "https://files.pythonhosted.org/packages/2a/aa/12423cc3647fad561f5eb331b7a61e2ccb4c7633800a23c2a5d151e076e0/validator_luhn-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-06 18:16:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "teanus",
"github_project": "Validator-Luhn",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "validator-luhn"
}