Track Topic
: rss

Topic: API access from Python

posts 1–6 of 6
Page 1
?
62 posts

I had some success accessing the BF API with the ZSI library yesterday evening, although like all the Python SOAP tools the documentation seesm shockingly thin. I only got as far as I did because googling wsdl2py and betfair brought up some useful information from one Brendan Sleight. ;-)

And don't get me started on the fact that ZSI - which is apparently one of the better-supported Python SOAP libraries - depends on another library that's no longer maintained.

Assuming I do actually get to the stage of having some useful functions for calling the free API, I'm going to post them up somewhere (and add a link here) for the benefit of any other poor souls who find themselves stumbling along these poorly-lit roads.

?
47 posts

I going to upload my library to:-
http://code.google.com/p/pythonbetfairlibrary/

I am just making sure which parts are library and which part are using the library for bots.

No need to re-invent the wheel.

BMS aka barwap

?
62 posts

Thanks barwap - that's awesome.

In the absence of any code on the internet I'd slowly started posting some myself (http://www.bivariate.co.uk/betfair_api_zsi.php), but I think now I'll just use yours.  Wink

?
47 posts
JPL - Any feedback on the code ?


I am thinkg of making the next layer up I use, (database/reviewing markets/ matched-unmatched) GPL.

BMS
?
62 posts

Brendan,

The following feedback comes with a couple of caveats: I've only looked at portions of the server-access code (python.py), and I'm a relative Python newbie (gradually migrating my bot and related data warehousing / data analysis programs from PHP5 to Python).

Your code for accessing the Betfair server has been really helpful - a clearly written, easy to follow, fairly 'thin' wrapper around the BF API calls, which is exactly what I was looking for.  The amount of work it has (and will) save me in combing through the WSDL file working out how to code up the SOAP call for each service has been huge.

Of course, everyone writing a bot will have their own views on the right way to structure it.  Personally, for example, I like my BF access methods to abstract away the throttling issue (by noting how long it is since they were last called, and sleeping before making the SOAP call if necessary) rather than leaving it to the calling program to sort out.  For these sorts of reason, I wouldn't myself make much use of open source functionality for higher-level stuff.  I've got my own strong views on how a bot should be structured, how it should interact with the database, how it should be made robust to connectivity failure, and so on.  I'm sure your ideas on the matter are just as valid (or more so!), but I like to do it my way.

It would be a very generous gesture to open source your higher-level code, and not one I'd be willing to do myself.  All those decisions about how to structure things seem quite personal (in a way that code for fairly mechanical SOAP accesses don't), so while I'd always be very happy to do what I could to help people with the mechanics of the exchange APIs, sharing the higher-level stuff isn't a road I'll be going down.  Kudos to you if you're generous enough to do that though.

Thanks again for posting your code - greatly appreciated.

?
47 posts

Thanks for the feedback.

The API code was not mine. It was originally posted by a member of fred's forum. (I think it was nadat). I only tweaked one function.

I am a python newbie, I wanted to learn python, a betfair bot is a fun way to learn.

Quiet interesting feedback on the higher-level code. I think you are right the higher layer code, (throttling, db interaction, etc) does have an impact on the bot. I can just strip out the logic and expect the rest of the bot to be generic.

However, I have a strong open-source background. I can't help it.

posts 1–6 of 6
Page 1

This Topic Is Locked To Guest Posts

It's been a while since this topic was active, if you'd like to get it going again, please post as a registered member

join now