Skip to main content

A python library for the Coinspot API

Project description

Python Coinspot API Library

Build Status

A python library for the Coinspot API.

Copyright (C) 2014 Peter Dyson pete@geekpete.com

Source: http://github.com/geekpete/py-coinspot-api

PyPi: https://pypi.python.org/pypi/py-coinspot-api/

Please see https://www.coinspot.com.au/api for documentation on the CoinSpot API.

NOTE: All requests and responses will be JSON

Installation

pip install py-coinspot-api --user

or

sudo pip install py-coinspot-api

Configuration

You have two options for configuration, using os environment variables or a yaml file

Option 1

Windows:

set COINSPOT_API_KEY=XXXXXX
set COINSPOT_API_SECRET=XXXXXXXXXX

Linux:

export COINSPOT_API_KEY=XXXXXX
export COINSPOT_API_SECRET=XXXXXXXXXX

Option 2

The config.yml.sample needs to be copied to config.yml and your unique api key and secret values need to be inserted. Extra options like debug and logging file name can only be configured using the yaml file.

api:
 key: 'PUT_YOUR_KEY_HERE'
 secret: 'PUT_YOUR_SECRET_HERE'
 endpoint: 'www.coinspot.com.au'
debug: True
logfile: 'coinspot.log'

Class Documentation

http://py-coinspot-api.readthedocs.org/en/latest/

TODO

  • Extend test cases and requirements.

Example Usage

After you have your config.yml in place, test it out

from coinspot import CoinSpot

# initialise the library
client = CoinSpot()

# get the spot prices
print client.spot()

# get your coin wallet balances
print client.balances()

# get the last 1000 orders for Dogecoins
print client.orderhistory('DOGE')

# get a list of all the current buy and sell orders
print client.orders('DOGE')

# put an order in to sell 20 Dogecoins at 0.000280 per coin
print client.sell('DOGE', '20', '0.000280')

# Get a quote on buying a billion Dogecoins, with estimation of timeframe
print client.quotebuy('DOGE', 1000000000)

# Donate a craptonne of Dogecoins
# to the author of this library! Much Appreciate!!!
print client.send('DOGE', 'DJrHRxurwQoBUe7r9RsMkMrTxj92wXd5gs', 1000)

Send Dogecoins of appreciation

If you like this software, you can always send cold hard cryptocoin my way

Dogecoin: DJrHRxurwQoBUe7r9RsMkMrTxj92wXd5gs
Bitcoin: 1LybpYphZJqSAxjNFqjfYHB8pWxKcBmFkf

You can do this using the library like this:

# Donate a craptonne of Dogecoins to the author of this library!
# Much Appreciate!!!
print client.send('DOGE', 'DJrHRxurwQoBUe7r9RsMkMrTxj92wXd5gs', 10000)

or send Bitcoins:

# Donate a craptonne of Bitcoins to the author of this library!
print client.send('BTC', '1LybpYphZJqSAxjNFqjfYHB8pWxKcBmFkf', 1)

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Change Log

  • 0.1.1 Initial Release

  • 0.2.0 Logging Support, Initial Test Cases, Exception Handling, Travis Support, Configuration File

Project details


Download files

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

Source Distributions

py-coinspot-api-0.2.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

py_coinspot_api-0.2.2-py2.7.egg (9.1 kB view details)

Uploaded Source

File details

Details for the file py-coinspot-api-0.2.2.tar.gz.

File metadata

File hashes

Hashes for py-coinspot-api-0.2.2.tar.gz
Algorithm Hash digest
SHA256 569eff7b15057f75dd1dccd0f65ea5e33a48dc31df1f2f0981d5e2d73e38da03
MD5 c198659937d8dc2bbb45739000a28534
BLAKE2b-256 6870fc9987d375ed33946ad32aba417835e29781072b610cf4d0b77fa65926f6

See more details on using hashes here.

File details

Details for the file py-coinspot-api-0.2.2.macosx-10.9-x86_64.tar.gz.

File metadata

File hashes

Hashes for py-coinspot-api-0.2.2.macosx-10.9-x86_64.tar.gz
Algorithm Hash digest
SHA256 2269bc111259fab4b9602c823a833d1b9c1e7a6eae6ad3171318f11558758fe6
MD5 01732998447e03b9b60ff9958f738af9
BLAKE2b-256 ee15199436ff2f4cc34ef2dea50598fd5363d9696c3a37abf27669e397c77363

See more details on using hashes here.

File details

Details for the file py_coinspot_api-0.2.2-py2.7.egg.

File metadata

File hashes

Hashes for py_coinspot_api-0.2.2-py2.7.egg
Algorithm Hash digest
SHA256 994f2620f51eaecc043241b9e6b556f0ab419dce9789891c815721547fae09f8
MD5 c236395d2e016dd7a344fdaca87e1975
BLAKE2b-256 fca55b634f39e9e4fc79d76747940aeb8e8b2c6a27dfb49e9ca3f33297d4568e

See more details on using hashes here.

Supported by

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