A Python library for the Bitbutter API.
- Convenient methods for making calls to the API
chainbridge
is available on PyPi. Install it with pip
:
pip install chainbridge
or with easy_install
:
easy_install chainbridge
The library is currently tested against Python versions 3.4+.
Create a partner Client
object for interacting with the API:
# Exposes partner routes
from bitbutter.client import Client
partner_client = Client(api_key, api_secret, base_uri, partnership_id, partner_id)
Create a user Client
object for interacting with the API:
# Exposes user routes
from bitbutter.client import Client
user_client = Client(api_key, api_secret, base_uri, partnership_id, user_id)
Follow the partner or user API documentation to see all endpoints. Chainbridge API reference documentation is available here.
Any and all contributions are welcome! The process is simple: fork this repo, make your changes, run the test suite, and submit a pull request. Tests are run via nosetests. To run the tests, clone the repository and then:
# Install the requirements
pip install -r requirements.txt
pip install -r test-requirements.txt
# Run the tests for your current version of Python
make tests
If you'd also like to generate an HTML coverage report (useful for figuring out which lines of code are actually being tested), make sure the requirements are installed and then run:
make coverage
We use tox to run the test suite against multiple versions of Python. You can install tox with pip
or easy_install
:
pip install tox
easy_install tox
Tox requires the appropriate Python interpreters to run the tests in different environments. We recommend using pyenv for this. Once you've installed the appropriate interpreters, running the tests in every environment is simple:
tox
Documentation is built with MkDocs. You can install mkdocs
(>=17.3) with pip
:
pip install mkdocs
You can start the development server with the mkdocs serve
command:
mkdocs serve
The documentation will be live at http://127.0.0.1:8000
.
Documentation is built with the mkdocs build
.
You should have a .pyirc
configuration file in your home folder (~/.pyirc
) containing authentication credentials for TestPyPI and PyPI
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
username=your_username
password=your_password
[testpypi]
repository=https://testpypi.python.org/pypi
username=your_username
password=your_password
Ideally, with strict permissions:
chmod 600 ~/.pyirc
Also make sure wheel
is installed:
pip install wheel
Update the version in bitbutter/__init__.py
python setup.py sdist bdist_wheel upload -r testpypi
The latest version will be available here
python setup.py sdist bdist_wheel upload -r pypi
The latest version will be available here