Skip to content

Commit

Permalink
Update to latest ib_async 1.0.2 release dependency
Browse files Browse the repository at this point in the history
I guess it's time to move over since ib_async now has additional bug
fixes and features not present in any ib_insync release.
  • Loading branch information
mattsta committed Jun 29, 2024
1 parent a26edd5 commit de915c2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions icli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@

locale.setlocale(locale.LC_ALL, "")

import ib_insync
import ib_async

import seaborn
from ib_insync import (
from ib_async import (
Bag,
ComboLeg,
Contract,
Expand Down Expand Up @@ -2927,7 +2927,7 @@ async def prepare(self):
if False:
import logging

ib_insync.util.logToConsole(logging.INFO)
ib_async.util.logToConsole(logging.INFO)

# Attach IB events *outside* of the reconnect loop because we don't want to
# add duplicate event handlers on every reconnect!
Expand Down
11 changes: 8 additions & 3 deletions icli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@
import math
from dataclasses import dataclass, field

import ib_insync # just for UNSET_DOUBLE
import ib_async # just for UNSET_DOUBLE
import numpy as np
import pandas as pd
import pendulum
import questionary
import tradeapis.cal as tcal
import tradeapis.rounder as rounder
from ib_insync import (
from ib_async import (
Bag,
Bond,
CFD,
ComboLeg,
Commodity,
ContFuture,
Contract,
Crypto,
DeltaNeutralContract,
Forex,
Future,
FuturesOption,
Index,
MutualFund,
Option,
Stock,
Warrant,
Expand Down Expand Up @@ -463,7 +468,7 @@ def isset(x: float) -> bool:
So we have to directly compare against another value to see if a returned float
is a _set_ value or just a placeholder for the default value. le sigh."""
return x != ib_insync.util.UNSET_DOUBLE
return x != ib_async.util.UNSET_DOUBLE


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion icli/lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import pandas as pd

from ib_insync import Bag, Contract, Order
from ib_async import Bag, Contract, Order
from loguru import logger
from mutil.dispatch import DArg
from mutil.frame import printFrame
Expand Down
2 changes: 1 addition & 1 deletion icli/orders.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Common order types with reusable parameter configurations."""
from dataclasses import dataclass, field

from ib_insync import (
from ib_async import (
Contract,
Order,
OrderCondition,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ license = "Apache-2.0"
python = ">=3.10,<3.13"

# IB API wrapper with better usability than the IBKR-provided libs
ib-insync = "^0.9.66"
ib_async = ">=1.0.2"
# ib_async = { path = "../../ibkr/ib_insync", develop = true }

# nice printing and data manipulation
pandas = ">2.1.0"
Expand Down

0 comments on commit de915c2

Please sign in to comment.