Set of classes for validating, identifying and formatting do credit cards and debit cards.
Project description
# Pycards
[![Build Status](https://travis-ci.org/MrLucasCardoso/pycards.svg?branch=master)](https://travis-ci.org/MrLucasCardoso/pycards) [![Code Health](https://landscape.io/github/MrLucasCardoso/pycards/master/landscape.svg?style=flat)](https://landscape.io/github/MrLucasCardoso/pycards/master) [![Coverage Status](https://coveralls.io/repos/github/MrLucasCardoso/pycards/badge.svg?branch=master)](https://coveralls.io/github/MrLucasCardoso/pycards?branch=master)
Set of classes for validating, identifying and formatting do credit cards and debit cards.
```shell
$ pip install python-cards
```
#### Example
```python
from pycards import CreditCard
card = CreditCard(number='375371850275506',
cardholder='Charles Smith',
expire_month='3',
expire_year='2017',
code=2887)
if card.is_valid:
print(card.brand) # Amex
print(card.cardholder) # Charles Smith
print(card.number) # 375371850275506
print('Expires: {} ({})' # Expires: 03/17 (2017-03-01)
.format(card.expires_string, card.expires))
print('{}: {}' # CVV: 2887
.format(card.code_name, card.code))
if card.is_expired:
print('EXPIRED') # EXPIRED
```
**Note:** Debit cards not avaliable yet.
### Supported Cards
* Visa -> Visa
* American Expiress -> Amex
* Mastercard -> Master
* Discover -> Discover
* Diners Club -> Diners
* JCB (Japan Credit Bureau) -> JCB
* Aura -> Aura
* ELO -> Elo
[![Build Status](https://travis-ci.org/MrLucasCardoso/pycards.svg?branch=master)](https://travis-ci.org/MrLucasCardoso/pycards) [![Code Health](https://landscape.io/github/MrLucasCardoso/pycards/master/landscape.svg?style=flat)](https://landscape.io/github/MrLucasCardoso/pycards/master) [![Coverage Status](https://coveralls.io/repos/github/MrLucasCardoso/pycards/badge.svg?branch=master)](https://coveralls.io/github/MrLucasCardoso/pycards?branch=master)
Set of classes for validating, identifying and formatting do credit cards and debit cards.
```shell
$ pip install python-cards
```
#### Example
```python
from pycards import CreditCard
card = CreditCard(number='375371850275506',
cardholder='Charles Smith',
expire_month='3',
expire_year='2017',
code=2887)
if card.is_valid:
print(card.brand) # Amex
print(card.cardholder) # Charles Smith
print(card.number) # 375371850275506
print('Expires: {} ({})' # Expires: 03/17 (2017-03-01)
.format(card.expires_string, card.expires))
print('{}: {}' # CVV: 2887
.format(card.code_name, card.code))
if card.is_expired:
print('EXPIRED') # EXPIRED
```
**Note:** Debit cards not avaliable yet.
### Supported Cards
* Visa -> Visa
* American Expiress -> Amex
* Mastercard -> Master
* Discover -> Discover
* Diners Club -> Diners
* JCB (Japan Credit Bureau) -> JCB
* Aura -> Aura
* ELO -> Elo
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
python-cards-1.3.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file python-cards-1.3.tar.gz
.
File metadata
- Download URL: python-cards-1.3.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a34e120d211cd01b6c801891b16d2b976051b0dac73e2578166a18b29441a85 |
|
MD5 | 862e1e8bffc8e95ce26aa1af2abe149b |
|
BLAKE2b-256 | a8f52a64c56bb55104912a8f8e85b3eb6c4b2f3f5d62054bc3503ca6550e2a9a |
File details
Details for the file python_cards-1.3-py3-none-any.whl
.
File metadata
- Download URL: python_cards-1.3-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7824b76870ab157ba2f3fabdd90be17b36cbdeb3448676c7d0a86e22a104e31b |
|
MD5 | 7bfb1242fda3336748e9a0539296fe94 |
|
BLAKE2b-256 | 3cff12e77365601e4734a52825c90a4b672a616414ee4d34e208c1d6d8b11f05 |