[![python](https://img.shields.io/badge/python-2.7%20%26%203-blue.svg)![licence](https://img.shields.io/badge/licence-GPL%20v2-blue.svg)](https://github.com/s4w3d0ff/python-poloniex/blob/master/LICENSE) [![release](https://img.shields.io/github/release/s4w3d0ff/python-poloniex.svg)![release build](https://travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=v0.5.1)](https://github.com/s4w3d0ff/python-poloniex/releases)  
[![master](https://img.shields.io/badge/branch-master-blue.svg)![master build](https://api.travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=master)](https://github.com/s4w3d0ff/python-poloniex/tree/master) [![dev](https://img.shields.io/badge/branch-dev-blue.svg)![dev build](https://api.travis-ci.org/s4w3d0ff/python-poloniex.svg?branch=dev)](https://github.com/s4w3d0ff/python-poloniex/tree/dev)  
Inspired by [this](http://pastebin.com/8fBVpjaj) wrapper written by 'oipminer'  
> I (s4w3d0ff) am not affiliated with, nor paid by [Poloniex](https://poloniex.com). I have been an active trader there since 2014 and love python. I found the linked python wrapper on the poloniex support page to be incomplete and buggy so I decided to write this wrapper and create this git repository. If you wish to contribute to this repository please read [CONTRIBUTING.md](https://github.com/s4w3d0ff/python-poloniex/blob/master/CONTRIBUTING.md). All and any help is appreciated.
## Install latest release:
Python 2:
```
pip install https://github.com/s4w3d0ff/python-poloniex/archive/v0.5.1.zip
```

Python 3:
```
pip3 install https://github.com/s4w3d0ff/python-poloniex/archive/v0.5.1.zip
```

## Usage:
See the [wiki](https://github.com/s4w3d0ff/python-poloniex/wiki) or `help(poloniex)` for more.
#### Basic Public Setup (no api Key/Secret):
```python
from poloniex import Poloniex
polo = Poloniex()
```
Ticker
```python
print(polo('returnTicker')['BTC_ETH'])
# or
print(polo.returnTicker()['BTC_ETH'])
```
**Public** trade history:
```python
print(polo.marketTradeHist('BTC_ETH'))
```

#### Basic Private Setup (Api key/secret required):
```python
import poloniex
polo = poloniex.Poloniex('your-Api-Key-Here-xxxx','yourSecretKeyHere123456789')
# or
polo.key = 'your-Api-Key-Here-xxxx'
polo.secret = 'yourSecretKeyHere123456789'
```
Get all your balances
```python
balance = polo.returnBalances()
print("I have %s ETH!" % balance['ETH'])
# or
balance = polo('returnBalances')
print("I have %s BTC!" % balance['BTC'])
```
**Private** trade history:
```python
print(polo.returnTradeHistory('BTC_ETH'))
```

**Examples of how to use websocket push API can be found [here](https://github.com/s4w3d0ff/python-poloniex/tree/master/examples).**
