项目作者: promptapi

项目描述 :
Python package for Prompt API's BIN Checker API
高级语言: Python
项目地址: git://github.com/promptapi/bin-checker-py.git
创建时间: 2020-08-27T17:56:15Z
项目社区:https://github.com/promptapi/bin-checker-py

开源协议:MIT License

下载


Python
Version
Code style: black
Build Status

Prompt API - BIN Checker - Python Package

pa-bin-checker is a simple python wrapper for bincheck-api.

Requirements

  1. You need to signup for Prompt API
  2. You need to subscribe bincheck-api, test drive is free!!!
  3. You need to set PROMPTAPI_TOKEN environment variable after subscription.

then;

  1. $ pip install pa-bin-checker

Example Usage

  1. from bin_checker import get_bin
  2. bin_information = get_bin('302596') # example BIN
  3. if bin_information.get('error', False):
  4. print(bin_information['bank_name']) # you have a dict!

You’ll have a dict of data:

  1. {
  2. 'bank_name': 'Diners Club International',
  3. 'country': 'United States Of America',
  4. 'url': 'www.dinersclub.com',
  5. 'type': 'Credit',
  6. 'scheme': 'Discover',
  7. 'bin': '302596',
  8. }

If you receive an error, payload will contain error key. Example error
response:

  1. {
  2. 'error': 'You need to set PROMPTAPI_TOKEN environment variable',
  3. }

Development

Create your virtual environment, then use rake tasks:

  1. $ rake -T
  2. rake build # Build package
  3. rake bump[revision] # Bump version
  4. rake clean # Remove/Delete build..
  5. rake default # Default task => :install
  6. rake install # Install package for local development purpose
  7. rake test # Run test
  8. rake upload:main # Upload package to main distro (release)
  9. rake upload:test # Upload package to test distro

You need ruby to run rake tasks. Rake tasks are just helper functions for
automation. You don’t need to install anything to proceed. If you are on
macOS, you’ll already have ruby installed.

If you are on Ubuntu:

  1. # install ruby on Ubuntu
  2. $ sudo apt-get update -y
  3. $ sudo apt-get install -y ruby-full

You need bumpversion to manage package versioning. If you are on
macOS:

  1. $ brew install bumpversion

If you are on Ubuntu:

  1. # install bumpversion on Ubuntu
  2. $ sudo apt-get update -y
  3. $ sudo apt-get -y bumpversion

To install and test package locally, just call rake or rake install.
Tests are available under tests/ folder. Run rake test to run tests.

To continue without ruby or rake:

  • Install package locally: pip install -e .[development]
  • Build package: python setup.py sdist bdist_wheel
  • Install bumpversion: pip install bumpversion

For uploading package to pypi registry you need to install:

  1. $ pip install -U wheel setuptools

You need to put pypi credentials to ~/.pypirc:

  1. [distutils]
  2. index-servers=
  3. pypi-promptapi
  4. testpypi-promptapi
  5. [pypi-promptapi]
  6. repository = https://upload.pypi.org/legacy/
  7. username: __token__
  8. password: TOKEN
  9. [testpypi-promptapi]
  10. repository: https://test.pypi.org/legacy/
  11. username: __token__
  12. password: TOKEN
  • Upload to main registry: twine upload --repository pypi-promptapi dist/*
  • Upload to test repository: twine upload --repository testpypi-promptapi dist/*

License

This project is licensed under MIT


Contributer(s)


Contribute

All PR’s are welcome!

  1. fork (https://github.com/promptapi/bin-checker-py/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'Add awesome features...')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to
the code of conduct.