This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Overview

Interactive Brokers Python API, auto generated from C++ API using SWIG.

Latest version: 0.4.1 (TWS API v9.68)

Install

Use pip (recommended):

$ pip install swigibpy

Alternatively download your archive of choice and run:

$ python setup.py install

Notes for Windows Users

swigibpy just provides a wrapper around the TWS C++ API so this needs to be compiled for your target platform during installation. While this should ‘just work’ for Linux and OSX, Windows users might need to do some extra work.

Compile with MinGW

Download and install MinGW and follow the steps to add MinGW to your path. Note there is a compatability problem between the latest version of MinGW and disutils so it is recommended to install an older version until this is resolved (mingw-get-inst-20110802.exe has been known to work).

To get pip to use MinGW as the compiler edit or create a file named distutils.cfg in [PYTHON LOCATION]\Lib\distutils where [PYTHON LOCATION] is the path to your Python install, e.g. C:\Python27. Add the following to distutils.cfg:

[build]
compiler=mingw32

then use the pip command above and with a bit of luck, you’re done!

Alternatively you can download and build the package directly. To build and install use:

$ python setup.py build -c mingw32
$ python setup.py install

This has been verified to work using MinGW and Python 2.7 on Windows 7, Vista, and XP.

Compile with Visual Studio

Several users have reported success building swigibpy with Visual Studio, with a few caveats:

  • Distutils has issues building with anything later than Visual Studio 2008 (version 9).
  • Visual Studio 11 doesn’t like the /MD compile flag, which distutils adds. For a workaround see here.

Usage

To use simply import the swigibpy module. The minimum you will need to do is define an EWrapper sub-class whose methods will be invoked when a message is received from TWS, see the examples for more.

By default swigibpy will automatically poll TWS for messages, see Notes for more about this.

For API reference refer to the C++ API documentation.

Notes

The yield parameter in CommissionReport clashes with a Python reserved keyword so it is renamed to _yield.

By default swigibpy will create a background thread to automatically poll TWS for messages. If you wish to disable this behaviour and handle polling yourself use the poll_auto argument when calling eConnect:

tws.eConnect("", 7496, 42, poll_auto=False)

The TWS C++ API performs synchronous I/O using socket receive, swigibpy does not alter this behaviour (hence the background thread).

Apart from a few trivial patches to aid compilation and interoperability with Python swigibpy does not alter the TWS C++ API code in any way.

Develop

Contributions are welcome! For development you can build the extension in the current dir:

$ python setup.py build_ext --build-lib .

The majority of the swigibpy code is auto-generated by SWIG and swigibpy also includes a number of trivial patches for TWS’s C++ code. The TWS API included in the repository has already been patched and the SWIG code has already been generated, but if you need to rerun these steps the commands are:

$ python setup.py swigify

to regenerate the SWIG wrappers (SWIG 2.0+ required), and:

$ python setup.py patchify

to reapply the patches to the TWS API (specify the option -r if you want to un-apply the patches and get back to unaltered TWS code).

License

swigibpy original code is free software under the New BSD license.

Interactive Brokers propriety C++ API is copyright Interactive Brokers LLC. swigibpy is in no way supported or endorsed by Interactive Brokers LLC.


Release History

Release History

0.4.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
swigibpy-0.4.1.tar.gz (169.9 kB) Copy SHA256 Checksum SHA256 Source May 4, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting