diff --git a/ibkr/__init__.py b/ibkr/__init__.py new file mode 100644 index 0000000..3ead93a --- /dev/null +++ b/ibkr/__init__.py @@ -0,0 +1 @@ +from .client import Client \ No newline at end of file diff --git a/client.py b/ibkr/client.py similarity index 97% rename from client.py rename to ibkr/client.py index 144f27c..1d6bec3 100644 --- a/client.py +++ b/ibkr/client.py @@ -1,10 +1,10 @@ import pandas as pd from datetime import datetime -from exchange import SMART +from .exchange import SMART from ib_insync import IB, Index, Option from ib_insync.util import isNan -from market_data_type import LIVE +from .market_data_type import LIVE from typing import Callable class Client: diff --git a/exchange.py b/ibkr/exchange.py similarity index 100% rename from exchange.py rename to ibkr/exchange.py diff --git a/market_data_type.py b/ibkr/market_data_type.py similarity index 100% rename from market_data_type.py rename to ibkr/market_data_type.py diff --git a/option_chain_example.py b/option_chain_example.py index e30def9..4d9e4b1 100644 --- a/option_chain_example.py +++ b/option_chain_example.py @@ -1,5 +1,5 @@ -from client import Client from datetime import datetime +from ibkr.client import Client ibkr_client = Client(host = '127.0.0.1', port = 7497) diff --git a/option_chain_example_old.py b/option_chain_example_old.py index 11713d2..aab13d7 100644 --- a/option_chain_example_old.py +++ b/option_chain_example_old.py @@ -5,8 +5,8 @@ import datetime import pandas as pd -from exchange import SMART from ib_insync import * +from ibkr.exchange import SMART ib = IB() ib.connect('127.0.0.1', 7497, clientId=1) # Assuming TWS is running on the current machine. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..873f0f5 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +from setuptools import setup, find_packages + +setup( + name="ibkr", + version="1.0", + packages=find_packages(), + install_requires=[ + 'ib_insync', + 'pandas' + ], +) \ No newline at end of file