Giter Club home page Giter Club logo

pypoloniex's Introduction

Pypoloniex

Python wrapper for calling cryptocurrency data from Poloniex API

PyPI version Dependencies GitHub Issues License

Install

pip install pypoloniex

Code Examples

Get Coin Information in Realtime

from pypoloniex import LoadPairs

# Load realtime data from Poloniex
sess = LoadPairs()

# Returns coin object
LTC = sess.getPair(market = 'BTC', coin = 'LTC')

# Quickview
print LTC
Coin: LTC | Last Price: 0.00381908 btc
          | Percent Change: 1.155355% btc
          | ---
          | Low 24hr: 0.00333333 btc
          | High 24hr: 0.00386786 btc
          | ---
          | Base Volume: 985.88726255 btc
          | Quote Volume: 262468.09577289 ltc
# All Coin object attributes
print LTC.id
print LTC.coin
print LTC.market
print LTC.lowestAsk
print LTC.low24hr
print LTC.highestBid
print LTC.high24hr
print LTC.last
print LTC.percentChange
print LTC.baseVolume
print LTC.quoteVolume
print LTC.isFrozen
50
LTC
BTC
0.00381900
0.00333333
0.00381581
0.00386786
0.00381908
0.01155355
985.88726255
262468.09577289
0

Get Time Series Data

# Create TimeSeries object
sess = TimeSeries()

# Parameters
pair = ('BTC', 'LTC')	 # (market, coin)
period = 86400           # candle stick period in seconds
start = '4/2/2014'		 # dd/mm/year
end =  '11/2/2014'       # dd/mm/year

# Get time series data from Poloniex and load into pandas dataframe
sess.getData(pair, period, start, end)

# Show dataframe with parameters
sess.show()
Variables
Pair: ('BTC', 'LTC')
Period: 86400
Start: 4/2/2014
End: 11/2/2014

                  date    open     low    high   close  weightedAverage     volume  quoteVolume
0  04/02/2014 19:00:00  0.0252  0.0212  0.0268  0.0267         0.023584  10.866362   460.749730 
1  05/02/2014 19:00:00  0.0267  0.0250  0.0276  0.0266         0.025958   1.733980    66.798961  
2  06/02/2014 19:00:00  0.0276  0.0028  0.0276  0.0269         0.025350   8.315254   328.018899 
3  07/02/2014 19:00:00  0.0268  0.0203  0.0268  0.0263         0.025250   3.234224   128.087917 
4  08/02/2014 19:00:00  0.0263  0.0242  0.0263  0.0261         0.025720   2.392802    93.031692  
5  09/02/2014 19:00:00  0.0261  0.0248  0.0261  0.0261         0.025562   2.367759    92.628872  
6  10/02/2014 19:00:00  0.0256  0.0248  0.0262  0.0259         0.025384   2.292572    90.315636   
# Export dataframe to csv
sess.toCSV('data.csv')

# Import dataframe from csv
sess = TimeSeries()
sess.fromCSV('data.csv')

# Return dataframe from TimeSeries object for manipulation
df = sess.data

Available Trading Pairs from Poloniex

| BTC, RBY       | BTC, GRC       | BTC, BLK      | BTC, BBR       | XMR, NXT       
| BTC, UNITY     | BTC, NXC       | BTC, XRP      | BTC, XMR       | XMR, BLK       
| BTC, PINK      | BTC, BTCD      | BTC, NEOS     | BTC, SJCX      | XMR, ZEC       
| BTC, SYS       | BTC, LTC       | BTC, QBK      | BTC, VIA       | XMR, QORA      
| BTC, EMC2      | BTC, DASH      | BTC, BTS      | BTC, XEM       | XMR, DASH      
| BTC, C2        | BTC, NAUT      | BTC, DOGE     | BTC, NMC       | XMR, BBR       
| BTC, RADS      | BTC, ZEC       | BTC, SBD      | BTC, SDC       | XMR, BTCD      
| BTC, SC        | BTC, BURST     | BTC, XCP      | BTC, ARDR      | XMR, MAID      
| BTC, MAID      | BTC, XVC       | BTC, BTM      | BTC, HZ        | XMR, LTC       
| BTC, BCN       | BTC, BELA      | BTC, OMNI     | BTC, FLO       | XMR, BCN       
| BTC, REP       | BTC, STEEM     | BTC, NAV      | BTC, GAME      | USDT, REP      
| BTC, BCY       | BTC, ETC       | BTC, VOX      | BTC, PPC       | USDT, ZEC      
| BTC, FCT       | BTC, ETH       | BTC, XBC      | BTC, FLDC      | USDT, ETH      
| BTC, LBC       | BTC, CURE      | BTC, DGB      | BTC, MYR       | USDT, BTC      
| BTC, DCR       | BTC, HUC       | BTC, NOTE     | BTC, NSR       | USDT, ETC      
| BTC, AMP       | BTC, STRAT     | BTC, BITS     | BTC, IOC       | USDT, DASH     
| BTC, XPM       | BTC, LSK       | BTC, VRC      | ETH, STEEM     | USDT, NXT      
| BTC, NOBL      | BTC, EXP       | BTC, RIC      | ETH, ZEC       | USDT, LTC      
| BTC, NXT       | BTC, CLAM      | BTC, XMG      | ETH, REP       | USDT, XMR      
| BTC, VTC       | BTC, QORA      | BTC, STR      | ETH, LSK       | USDT, XRP      
| BTC, PASC      | BTC, QTL       | BTC, POT      | ETH, ETC       | USDT, STR  

pypoloniex's People

Contributors

anfederico avatar jibidnd avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.