Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor folder structure and update the clean code tools #209

Merged
merged 5 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Run linter
command: |
. venv/bin/activate
pycodestyle --max-line-length=119 ta && isort --check-only --recursive ta
make lint
- run:
name: Run test
command: |
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- run:
name: Run coverage
command: |
coverage run tests.py
coverage run -m unittest discover
coverage report -m
- run:
name: Publish coverage
Expand Down
2 changes: 0 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[run]
branch = True
source = ta
omit =
ta/tests/*
23 changes: 23 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
output-format: grouped

strictness: veryhigh
doc-warnings: true
test-warnings: true
max-line-length: 120

mypy:
run: true
options:
ignore-missing-imports: true

bandit:
run: true

pep8:
disable:
- E203

pep257:
run: false
disable:
- D213
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
init:
pip install -r requirements.txt

lint:
pycodestyle --max-line-length=119 ta && isort --check-only --recursive ta
isort:
isort --check-only --recursive ta test

format: isort
black --target-version py36 ta test

isort-fix:
isort --recursive ta
isort --recursive ta test

lint: isort
prospector test/
prospector ta/

test: lint
# python -m unittest discover
coverage run tests.py
coverage run -m unittest discover
coverage report -m
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
![CircleCI](https://img.shields.io/circleci/build/github/bukosabino/ta/master)
[![Documentation Status](https://readthedocs.org/projects/technical-analysis-library-in-python/badge/?version=latest)](https://technical-analysis-library-in-python.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/bukosabino/ta/badge.svg)](https://coveralls.io/github/bukosabino/ta)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Linter: Prospector](https://img.shields.io/badge/Linter-Prospector-coral.svg)](http://prospector.landscape.io/en/master/)
![PyPI](https://img.shields.io/pypi/v/ta)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ta)
[![Donate PayPal](https://img.shields.io/badge/Donate%20%24-PayPal-brightgreen.svg)](https://www.paypal.me/guau/3)
Expand All @@ -9,7 +11,7 @@

It is a Technical Analysis library useful to do feature engineering from financial time series datasets (Open, Close, High, Low, Volume). It is built on Pandas and Numpy.

![Bollinger Bands graph example](doc/figure.png)
![Bollinger Bands graph example](static/figure.png)

The library has implemented 42 indicators:

Expand Down Expand Up @@ -132,7 +134,7 @@ df = pd.read_csv('ta/tests/data/datas.csv', sep=',')
df = dropna(df)

# Initialize Bollinger Bands Indicator
indicator_bb = BollingerBands(close=df["Close"], n=20, ndev=2)
indicator_bb = BollingerBands(close=df["Close"], window=20, window_dev=2)

# Add Bollinger Bands features
df['bb_bbm'] = indicator_bb.bollinger_mavg()
Expand All @@ -158,14 +160,14 @@ df['bb_bbp'] = indicator_bb.bollinger_pband()
```sh
$ git clone https://github.com/bukosabino/ta.git
$ cd ta
$ pip install -r play-requirements.txt
$ pip install -r requirements-play.txt
$ make test
```


# Sponsor

![Logo OpenSistemas](doc/logo_neuroons_byOS_blue.png)
![Logo OpenSistemas](static/logo_neuroons_byOS_blue.png)

Thank you to [OpenSistemas](https://opensistemas.com)! It is because of your contribution that I am able to continue the development of this open source library.

Expand Down Expand Up @@ -194,7 +196,7 @@ Thank you to [OpenSistemas](https://opensistemas.com)! It is because of your con

# Changelog

[Changelog](https://github.com/bukosabino/ta/blob/master/release.md)
Check the [changelog](https://github.com/bukosabino/ta/blob/master/RELEASE.md) of project.


# Credits
Expand Down
1 change: 1 addition & 0 deletions release.md → RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Date | Version | Comment |
| ------------- | ------------- | ------------- |
| 2020/11/27 | 0.7.0 | Cleaning code https://github.com/bukosabino/ta/pull/209 |
| 2020/11/17 | 0.6.1 | Fixing Wrapper https://github.com/bukosabino/ta/pull/204 |
| 2020/11/09 | 0.6.0 | Adding new indicators (Ulcer Index, Weighted Moving Average, Schaff Trend Cycle, Stochastic RSI, Percentage Price Oscillator, Percentage Volume Oscillator) https://github.com/bukosabino/ta/pull/167; Update wrapper https://github.com/bukosabino/ta/pull/166 |
| 2020/05/12 | 0.5.25 | fixing bug: min_periods when fillna=False https://github.com/bukosabino/ta/pull/158 |
Expand Down
25 changes: 0 additions & 25 deletions dev/adx.py

This file was deleted.

27 changes: 0 additions & 27 deletions dev/all_features_example.py

This file was deleted.

22 changes: 0 additions & 22 deletions dev/atr.py

This file was deleted.

177 changes: 0 additions & 177 deletions dev/average_true_range_test.ipynb

This file was deleted.

Binary file removed dev/bb.png
Binary file not shown.
Loading