Giter Club home page Giter Club logo

ib_async's Introduction

Codeship Status for ondergetekende/ib_async

An asynchronous implementation of an Interactive Brokers API client.

Design

This library grew out of frustration of the quality of ib_api and ibridgepy. These libraries are direct ports from the official IB C++/Java client library, and as a result, don't fit well in the python world.

In contrast, ib_async was designed from the perspective of an end user. It attempts to be easy to use and easy to learn. At the moment, this library does not attempt to be feature complete. Instead, it tries to implement commonly used functionality well.

Examples

Obtain an instrument:

import ib_async

client = ib_async.IBClient()
client.connect('127.0.0.1', 4001, 100)  # 100 is the client_id.
instrument = client.get_instrument_by_id('US0378331005', 'ISIN') 

Receiving market data for said instrument:

async for tick_type in instrument.on_market_data:
    print(tick_type)

Or, if you prefer event handlers:

def handle(tick_type):
    pass

instrument.on_market_data += handle

Features

  • Fully asyncio-based
  • All simple calls are awaitable (no need to register callbacks)
  • Fully type annotated
  • Support for python >= 3.5
  • High test coverage

API Stability

This project uses semantic versionions. Starting with the release of 1.0.0, the API will be backward compatible within a major version, and forward compatible within a minor version. This applies to public methods, attributes and enums. Log messages and exact mypy types may change between versions, though. The protocol itself is not considered a public API.

Contributing

At the moment, development is mostly guided by the needs of the developer. If you need specific functionality, feel free to open an issue. If you need functionality urgently, feel free to contact the author for paid support.

Of course, pull-requests are always welcome. Pull requests are expected to pass the test suite, and not reduce test coverage.

License

Copyright 2018 Koert van der Veer

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License here.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note depending on your jurisdiction, this library may be considered a derived work of Interactive Brokers intellectual property, and may need to be licensed from them accordingly.

ib_async's People

Contributors

kvdveer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.