Bitcoin Forum
November 18, 2017, 06:20:46 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoinica API Python Interface  (Read 1633 times)
area
Full Member
***
Offline Offline

Activity: 177


View Profile
January 22, 2012, 11:23:56 AM
 #1

As I mentioned here, I've written an interface for the Bitcoinica API in Python, after not finding one out in the wild. I've now cleaned it up a little, and put it up on GitHub for all to use. It's fairly bare-bones, but hopefully some people here will find it useful. Any suggestions to improve it will be welcomed.
1511029246
Hero Member
*
Offline Offline

Posts: 1511029246

View Profile Personal Message (Offline)

Ignore
1511029246
Reply with quote  #2

1511029246
Report to moderator
A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511029246
Hero Member
*
Offline Offline

Posts: 1511029246

View Profile Personal Message (Offline)

Ignore
1511029246
Reply with quote  #2

1511029246
Report to moderator
1511029246
Hero Member
*
Offline Offline

Posts: 1511029246

View Profile Personal Message (Offline)

Ignore
1511029246
Reply with quote  #2

1511029246
Report to moderator
stochastic
Hero Member
*****
Offline Offline

Activity: 532


View Profile
January 25, 2012, 07:57:17 AM
 #2

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?

Introducing constraints to the economy only serves to limit what can be economical.
Qoheleth
Legendary
*
Offline Offline

Activity: 927


Spurn wild goose chases. Seek that which endures.


View Profile WWW
January 25, 2012, 08:12:45 AM
 #3

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?
"quotes" here is a tuple, which means it has numbered entries. for instance, quotes[0] is 200, and quotes[1] is {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541}
the thing in braces is a dictionary, which means it has named entries. for instance, quotes[1]['selling'] will give you 6.3806, and quotes[1]['buying'] will give you 6.25541

If there is something that will make Bitcoin succeed, it is growth of utility - greater quantity and variety of goods and services offered for BTC. If there is something that will make Bitcoin fail, it is the prevalence of users convinced that BTC is a magic box that will turn them into millionaires, and of the con-artists who have followed them here to devour them.
stochastic
Hero Member
*****
Offline Offline

Activity: 532


View Profile
January 25, 2012, 08:17:10 AM
 #4

I have been playing around with this.  It works fine.  I have not found any bugs.

I wanted to know how would you extract the returned objects.  For example:

Code:
quotes = exchange.get_quotes
quotes
(200, {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541})

I am am just learning python, so how would you extract the selling and buying prices?
"quotes" here is a tuple, which means it has numbered entries. for instance, quotes[0] is 200, and quotes[1] is {u'pair': u'BTCUSD', u'selling': 6.3806, u'buying': 6.25541}
the thing in braces is a dictionary, which means it has named entries. for instance, quotes[1]['selling'] will give you 6.3806, and quotes[1]['buying'] will give you 6.25541

Thanks Qoheleth!

Introducing constraints to the economy only serves to limit what can be economical.
take5
Jr. Member
*
Offline Offline

Activity: 41



View Profile
February 03, 2012, 03:08:16 AM
 #5

Just what I was looking for! I've been learning python on and off for awhile, maybe this is what I needed to give me some motivation.  Grin Thanks for posting this!
jc01480
Hero Member
*****
Offline Offline

Activity: 756



View Profile
March 12, 2017, 07:54:57 PM
 #6

So how has this been working for everyone?  Haven't gotten the code yet.  Learning python myself and its kind of fun. 

notme
Legendary
*
Offline Offline

Activity: 1848


View Profile
March 12, 2017, 09:24:29 PM
 #7

So how has this been working for everyone?  Haven't gotten the code yet.  Learning python myself and its kind of fun. 

Bitcoinica went tits up years ago, so it probably didn't work out well at all.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!