Skip to main content

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: dropped pkg_resources dependency (fixes Python 3.12+), modernized packaging to pyproject.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycreditcard-1.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycreditcard-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for pycreditcard-1.1.0.tar.gz
Algorithm Hash digest
SHA256 acc5815cb7048cee5e23f82308cc533de232ec357f57251302113bc6b259134c
MD5 393af674af2c192a6583c0ab64fb65a4
BLAKE2b-256 9b3a1c70357528078f6557488b05942ddc2b09a74093981248717b937296ebba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycreditcard-1.1.0.tar.gz:

Publisher: publish.yml on IFSCM/pycreditcard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pycreditcard-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bc667266893db7f2c130381570c4e120896bf592cbec1e82574fecac96622e7
MD5 0c70ae8b5bd08542f6ee4b725a883221
BLAKE2b-256 889c88e29b7b8795c30763c45f673c5d0b65e4cd4962312d0a8d59a24f210a99

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycreditcard-1.1.0-py3-none-any.whl:

Publisher: publish.yml on IFSCM/pycreditcard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page