Bitcoin Forum
April 26, 2024, 12:56:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoinica API Python Interface  (Read 1730 times)
area (OP)
Full Member
***
Offline Offline

Activity: 177
Merit: 100


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.
1714093007
Hero Member
*
Offline Offline

Posts: 1714093007

View Profile Personal Message (Offline)

Ignore
1714093007
Reply with quote  #2

1714093007
Report to moderator
1714093007
Hero Member
*
Offline Offline

Posts: 1714093007

View Profile Personal Message (Offline)

Ignore
1714093007
Reply with quote  #2

1714093007
Report to moderator
1714093007
Hero Member
*
Offline Offline

Posts: 1714093007

View Profile Personal Message (Offline)

Ignore
1714093007
Reply with quote  #2

1714093007
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
stochastic
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500


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: 960
Merit: 1028


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
Merit: 500


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
Newbie
*
Offline Offline

Activity: 41
Merit: 0



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: 854
Merit: 500


Nope..


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: 1904
Merit: 1002


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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!