Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ousret/payment-card-identifier
A Python library for determining credit card type.
https://github.com/ousret/payment-card-identifier
amex card card-identifier card-types credit-card mastercard visa
Last synced: about 2 months ago
JSON representation
A Python library for determining credit card type.
- Host: GitHub
- URL: https://github.com/ousret/payment-card-identifier
- Owner: Ousret
- License: mit
- Created: 2017-07-17T15:43:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-05T16:17:07.000Z (over 7 years ago)
- Last Synced: 2024-11-01T10:42:06.474Z (2 months ago)
- Topics: amex, card, card-identifier, card-types, credit-card, mastercard, visa
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 9
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
payment-card-identifier [![Build Status](https://travis-ci.org/Ousret/payment-card-identifier.svg?branch=master)](https://travis-ci.org/Ousret/payment-card-identifier) [![codecov](https://codecov.io/gh/Ousret/payment-card-identifier/branch/master/graph/badge.svg)](https://codecov.io/gh/Ousret/payment-card-identifier)
-----------------------Payment card identifier provides a useful utility method for determining a credit card type from both fully qualified numbers.
Same as braintree/credit-card-type but in Python.#### Installation
##### From PyPi
```sh
$ pip install payment-card-identifier
```##### From git-master
```sh
$ git clone https://github.com/Ousret/payment-card-identifier.git
$ cd payment-card-identifier
$ python setup.py install
```#### How to
```python
from payment_card_identifier import CardIdentifiermy_card = CardIdentifier.from_numbers('4532040524589053')
print(my_card)
#
print(my_card.json)
# {
# "_name": "VISA",
# "_numbers": "4532040524589053",
# "_regex": "^4[0-9]{12}(?:[0-9]{3})?$"
# }
```#### Currently supported cards
- VISA
- MasterCard
- Amex
- BCGLOBAL
- CarteBlanche
- DinersClub
- Discover
- InstaPayment
- JCB
- KoreanLocal
- Laser
- Maestro
- Solo
- Switch
- UnionPay#### WiP
This is still work in progress project.
Currently under dev.*Todo list:*
- Create .from_partials(numbers)