Skip to content

Commit

Permalink
Merge pull request #7 from tastyware/rewrite
Browse files Browse the repository at this point in the history
rewrite to use new SDK
  • Loading branch information
Graeme22 authored Jul 2, 2024
2 parents a63f5d0 + 510fa74 commit eaf4ec3
Show file tree
Hide file tree
Showing 36 changed files with 887 additions and 1,555 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# If you want to support this project, you can just sign up using my referral code!
github: tastyware
custom: ['https://start.tastytrade.com/#/login?referralCode=YYGKBEQ2EX']
12 changes: 6 additions & 6 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Sorting...
run: isort --check --diff twcli/ tests/
run: isort --check --diff ttcli/
- name: Linting...
run: flake8 --count --show-source --statistics --ignore=E501 twcli/ tests/
- name: Testing...
run: python -m pytest --cov=src --cov-report=term-missing tests/
run: flake8 --count --show-source --statistics ttcli/
- name: Type checking...
run: mypy -p ttcli/
6 changes: 0 additions & 6 deletions .readthedocs.yaml

This file was deleted.

18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
.PHONY: clean venv test

clean:
find . -name '*.py[co]' -delete
.PHONY: venv lint

venv:
python -m venv --prompt 'twcli' env
env/bin/pip install -r requirements.txt
python -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/pip install -e .

test:
isort --check --diff twcli/ tests/
flake8 --count --show-source --statistics --ignore=E501 twcli/ tests/
python -m pytest --cov=twcli --cov-report=term-missing tests/
lint:
isort --check --diff ttcli/
flake8 --count --show-source --statistics ttcli/
mypy -p ttcli/
12 changes: 0 additions & 12 deletions PULL_REQUEST_TEMPLATE.md

This file was deleted.

31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ An easy-to-use command line interface for Tastyworks!
## Installation

```
$ pip install tastyworks-cli
$ pip install tastytrade-cli
```

## Usage

Available commands:
```
twcli option buy, sell, and analyze options
twcli plot chart your portfolio's net liquidity or profit/loss over time
tt option buy, sell, and analyze options
```
Unavailable commands pending development:
```
twcli crypto buy, sell, and analyze cryptocurrencies
twcli future buy, sell, and analyze futures
twcli order view, replace, and cancel orders
twcli pairs analyze and size pairs trades
twcli portfolio view statistics and risk metrics for your portfolio
twcli quant mathematical and statistical analysis
twcli stock buy, sell, and analyze stock
twcli watchlist view current prices and other data for symbols in your watchlists
tt crypto buy, sell, and analyze cryptocurrencies
tt future buy, sell, and analyze futures
tt stock buy, sell, and analyze stock
tt order view, replace, and cancel orders
tt pf (portfolio) view statistics and risk metrics for your portfolio
tt wl (watchlist) view current prices and other data for symbols in your watchlists
```
For more options, run `twcli --help` or `twcli <subcommand> --help`.
For more options, run `tt --help` or `tt <subcommand> --help`.

## Development/Contributing

Expand All @@ -37,18 +34,12 @@ This project includes a number of helpers in the `Makefile` to streamline common
Creating a virtualenv for development:
```
$ make venv
$ source env/bin/activate
```

Install the package:

```
$ pip install -e .
$ source .venv/bin/activate
```

It's usually a good idea to make sure you're passing tests locally before submitting a PR:
```
$ make test
$ make lint
```

If you have a feature suggestion, find a bug, or would like to contribute, feel free to open an issue or create a pull request.
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions docs/conf.py

This file was deleted.

20 changes: 0 additions & 20 deletions docs/index.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

12 changes: 9 additions & 3 deletions etc/twcli.cfg → etc/ttcli.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
username = foo
password = bar
default-account = example
# username = foo
# password = bar
# default-account = example

[portfolio]
bp-target-percent-vix-low = 15
Expand All @@ -12,3 +12,9 @@ portfolio-delta-variation = 5

[order]
bp-warn-above-percent = 5

[option]
chain-show-delta = true
chain-show-volume = false
chain-show-open-interest = false
chain-show-theta = false
20 changes: 6 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
git+https://github.com/Graeme22/[email protected]#egg=aiocometd
anyio==3.5.0
asyncclick==8.0.3.2
flake8==4.0.1
isort==5.10.1
matplotlib==3.5.1
pandas==1.4.0
petl==1.7.7
pytest==7.0.0
pytest-cov==3.0.0
python-dateutil==2.8.2
QuantLib==1.25
rich==11.1.0
tastyworks-api==4.2.2
asyncclick==8.1.7.2
flake8==7.1.0
isort==5.13.2
mypy==1.10.1
tastytrade==7.7
rich==13.7.1
33 changes: 11 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
import os

from setuptools import find_packages, setup

from twcli.utils import VERSION


f = open('README.md', 'r')
LONG_DESCRIPTION = f.read()
f.close()

setup(
name='tastyworks-cli',
version=VERSION,
description='An easy-to-use command line interface for Tastyworks!',
name='tastytrade-cli',
version='2.0',
description='An easy-to-use command line interface for Tastytrade!',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
author='Graeme Holliday',
author_email='[email protected]',
url='https://github.com/Graeme22/tastyworks-cli/',
url='https://github.com/tastyware/tastytrade-cli',
license='MIT',
install_requires=[
'anyio>=3.5.0',
'asyncclick>=8.0.3.2',
'matplotlib>=3.5.1',
'pandas>=1.4.0',
'petl>=1.7.7',
'python-dateutil>=2.8.2',
'rich>=11.1.0',
'QuantLib>=1.25',
'tastyworks-api>=4.2.2',
'asyncclick>=8.1.7.2',
'rich>=13.7.1',
'tastytrade>=7.7',
],
data_files = [('etc', ['etc/twcli.cfg'])],
packages=find_packages(exclude=['ez_setup', 'tests*']),
data_files = [('etc', ['etc/ttcli.cfg'])],
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
entry_points="""
[console_scripts]
twcli = twcli.app:main
""",
tt = ttcli.app:main
"""
)
1 change: 0 additions & 1 deletion tests/data/transactions.json

This file was deleted.

32 changes: 0 additions & 32 deletions tests/test_pairs.py

This file was deleted.

Loading

0 comments on commit eaf4ec3

Please sign in to comment.