Hi jpl
I had already downloaded the file from the link, when I opened it I found 2 wsdl files how did they get in there ?
Opened them with 2008 web developer and found they contained all the betfair xml,
1 for global and 1 for exchange.
This made cross referencing how he came to the code in his scripts a lot easier.
I didnt get these files with the 4 files I got
.
Do I need a compiler ?
Or just use the python script editor ? .(just seem to get nowhere with this)
Or the cmd box?
as there are also 5 files ending in .pyc
Shouldnt be too hard reverse engineering the code.(famous last words)
Just want to make sure Ive got all the bits and bobs before I start rather than waste hours running up a blind alley
only to be told you need this or that later.
Can't help you with the soap stuff as i prefer web scraping, however you might find this website useful for decompiling .pyc files:
deano - I'm at my work PC now (and can't access the ZIP file), but .PYC files are compiled Python. You need to be looking at the .PY files that are the source. I don't remember the Zip file containing any PYC files without the corresponding PY files?
To put all this in context, the structure you're aiming for is as follows:
1) At the top-level will be one or more Python modules that contain the betting logic for your bot. These will be normal Python modules that you run in whatever way you normally run a Python program (which could be from the DOS command line, or from an interactive Python shell, or whatever). Personally I would want to write this stuff myself, but there may be some useful examples in nadat's Zip file. However, you probably don't want to complicate this module with all the nitty gritty of talking to exchanges, so when your bot wants to contact an exchange, it should do it with a call to ...
2) A helpful utility module, that contains easy-to-use functions (or classes) for making API calls. For example, this module might define a class representing the Betfair exchange, with a method for getting price data for a market. Exchange.py in the zip file is an example of such a helpful utility module, so it's up to you whether you use that as is, or use it as an example to build your own.
3) Your utility module (exchange.py or equivalent) won't actually contain the nuts-and-bolts code for building SOAP requests and parsing the results. That will be in the Python modules generated by wsdl2py.exe (i.e. BFExchangeService_services.py and the others). You can either get these out of the zip file, or build your own using wsdl2py. Personally I'd prefer the latter (so I know what's going on, and can rebuild them when the WSDL files change) although I note there's some information in the ZIP file about having to tweak the WSDL files to deal with empty arrays.
4) Finally the WSDL files themselves. Your bot won't need these to run, but wsdl2py will need them to generate the Python classes (and you'll also probably find them helpful in understanding what's going on as you write your utility module). Again you can either get these from the ZIP file or - if you want to be sure you've got up-to-date ones - from the Betfair URLs you already know e.g. https://api.betfair.com/global/v3/BFGlobalService.wsdl
Good luck - I'm sure it's a bit daunting. The worst bit by far I think is the initial bit of working out how to access the exchange - after that first hurdle it becomes more straightforward.
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