Skip to content

Commit ce8a624

Browse files
committed
Add publish workflow.
1 parent f1aab16 commit ce8a624

File tree

3 files changed

+69
-3
lines changed

3 files changed

+69
-3
lines changed

.github/workflows/python-publish.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.x"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install poetry
24+
- name: Build and publish
25+
env:
26+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
27+
run: |
28+
poetry build
29+
poetry publish

README.md

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Θ ThetaGang
1+
# Θ ThetaGang Θ
22

33
ThetaGang is an [IBKR](https://www.interactivebrokers.com/) trading bot for
44
collecting premium by selling options using "The Wheel" strategy. The Wheel
@@ -17,10 +17,42 @@ gateway.
1717

1818
To use the bot, you'll need an Interactive Brokers account with a working installation of IBC. Additionally, you'll need an installation of Python 3.8 or newer with the [`poetry`](https://python-poetry.org/) package manager.
1919

20-
## Getting Started
20+
## Installation
21+
22+
```shell
23+
$ pip install thetagang
24+
```
25+
26+
## Usage
27+
28+
```shell
29+
$ thetagang -h
30+
```
31+
32+
## Running with Docker
33+
34+
My preferred way for running ThetaGang is to use a cronjob to execute Docker
35+
commands. I've built a Docker image as part of this project, which you can
36+
use with your installation.
37+
38+
To run ThetaGang within Docker, you'll need to pass `config.ini` for [IBC configuration](https://github.com/IbcAlpha/IBC/blob/master/userguide.md) and [`thetagang.toml`](/thetagang.toml) for ThetaGang.
39+
40+
The easiest way to get the config files into the container is by mounting a volume. For example, you can use the following command:
41+
42+
```shell
43+
$ docker run --rm -it \
44+
-v ~/ibc:/ibc \
45+
docker.pkg.github.com/brndnmtthws/thetagang/thetagang:latest \
46+
--config /ibc/thetagang.toml
47+
```
48+
49+
## Development
2150

2251
Check out the code to your local machine and install the Python dependencies:
2352

2453
```shell
2554
$ poetry install
55+
$ poetry run thetaging -h
56+
...
2657
```
58+

thetagang/main.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"--config", help="Path to toml config", required=True, default="thetagang.toml"
1919
)
2020
def cli(config):
21-
"""ThetaGang is an IBKR bot for collecting money."""
21+
"""ThetaGang is an IBKR bot for collecting money.
22+
23+
You can configure this tool by supplying a toml configuration file.
24+
There's a sample config on GitHub, here:
25+
https://github.com/brndnmtthws/thetagang/blob/main/thetagang.toml
26+
"""
2227

2328
from .thetagang import start
2429

0 commit comments

Comments
 (0)