A simple class for identifying, validating, and formatting credit card numbers. Maintained fork of alexforster/creditcard.
Project description
creditcard
A simple class for identifying, validating, and formatting credit card numbers.
Maintained fork of alexforster/creditcard.
Changes: droppedpkg_resourcesdependency (fixes Python 3.12+), modernized packaging topyproject.toml.
Install
pip install pycreditcard
Usage
from creditcard import CreditCard
card = CreditCard('4111111111111111', expire_month='03', expire_year='2030', code='123')
print(card.brand) # Visa
print(card.is_valid) # True
Supported Card Families
Note: pull requests for new cards are welcome!
- Visa
- American Expiress
- Mastercard
- Discover
- Diners Club
- UnionPay (China)
- JCB (Japan Credit Beauro)
Changes from Original
| Version | Change |
|---|---|
| 1.1.0 | Replaced pkg_resources with importlib.resources (Python 3.12+ fix) |
| 1.1.0 | Migrated packaging to pyproject.toml |
Credits
Original library authored by Alex Forster.
Copyright 2017 Alex Forster. All rights reserved.
Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycreditcard-1.1.0.tar.gz.
File metadata
- Download URL: pycreditcard-1.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acc5815cb7048cee5e23f82308cc533de232ec357f57251302113bc6b259134c
|
|
| MD5 |
393af674af2c192a6583c0ab64fb65a4
|
|
| BLAKE2b-256 |
9b3a1c70357528078f6557488b05942ddc2b09a74093981248717b937296ebba
|
Provenance
The following attestation bundles were made for pycreditcard-1.1.0.tar.gz:
Publisher:
publish.yml on IFSCM/pycreditcard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycreditcard-1.1.0.tar.gz -
Subject digest:
acc5815cb7048cee5e23f82308cc533de232ec357f57251302113bc6b259134c - Sigstore transparency entry: 1700628765
- Sigstore integration time:
-
Permalink:
IFSCM/pycreditcard@84fa2fdfe339a0b91fcb19b0ff742db2e4e62a91 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/IFSCM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@84fa2fdfe339a0b91fcb19b0ff742db2e4e62a91 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pycreditcard-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pycreditcard-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bc667266893db7f2c130381570c4e120896bf592cbec1e82574fecac96622e7
|
|
| MD5 |
0c70ae8b5bd08542f6ee4b725a883221
|
|
| BLAKE2b-256 |
889c88e29b7b8795c30763c45f673c5d0b65e4cd4962312d0a8d59a24f210a99
|
Provenance
The following attestation bundles were made for pycreditcard-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on IFSCM/pycreditcard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycreditcard-1.1.0-py3-none-any.whl -
Subject digest:
2bc667266893db7f2c130381570c4e120896bf592cbec1e82574fecac96622e7 - Sigstore transparency entry: 1700628829
- Sigstore integration time:
-
Permalink:
IFSCM/pycreditcard@84fa2fdfe339a0b91fcb19b0ff742db2e4e62a91 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/IFSCM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@84fa2fdfe339a0b91fcb19b0ff742db2e4e62a91 -
Trigger Event:
push
-
Statement type: