[![Build Status](https://travis-ci.org/cirla/tulipy.svg?branch=master)](https://travis-ci.org/cirla/tulipy)
[![Build status](https://ci.appveyor.com/api/projects/status/g34af6ti605e2q4h?svg=true)](https://ci.appveyor.com/project/cirla/tulipy)
# tulipy
## Python bindings for [Tulip Indicators](https://tulipindicators.org/)
Tulipy requires [numpy](http://www.numpy.org/) as all inputs and outputs are numpy arrays (`dtype=np.float64`).
## Installation
You can install via `pip install tulipy`.
If a wheel is not available for your system, you will need to `pip install Cython numpy` to build from the source distribution.
When building from source on Windows, you will need the Microsoft Visual C++ Build Tools installed.
## Usage
```python
import numpy as np
import tulipy as ti
```
```python
ti.TI_VERSION
```
'0.8.4'
```python
DATA = np.array([81.59, 81.06, 82.87, 83, 83.61,
83.15, 82.84, 83.99, 84.55, 84.36,
85.53, 86.54, 86.89, 87.77, 87.29])
```
Information about indicators are exposed as properties:
```python
def print_info(indicator):
print("Type:", indicator.type)
print("Full Name:", indicator.full_name)
print("Inputs:", indicator.inputs)
print("Options:", indicator.options)
print("Outputs:", indicator.outputs)
```
```python
print_info(ti.sqrt)
```
Type: simple
Full Name: Vector Square Root
Inputs: ['real']
Options: []
Outputs: ['sqrt']
Single outputs are returned directly. Indicators returning multiple outputs use
a tuple in the order indicated by the `outputs` property.
```python
ti.sqrt(DATA)
```
array([ 9.03271831, 9.00333272, 9.10329611, 9.11043358, 9.14385039,
9.11866218, 9.1016482 , 9.16460583, 9.19510739, 9.18477 ,
9.24824308, 9.30268778, 9.32148057, 9.36856446, 9.34291175])
```python
print_info(ti.sma)
```
Type: overlay
Full Name: Simple Moving Average
Inputs: ['real']
Options: ['period']
Outputs: ['sma']
```python
ti.sma(DATA, period=5)
```
array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,
84.994, 85.574, 86.218, 86.804])
Invalid options will throw an `InvalidOptionError`:
```python
try:
ti.sma(DATA, period=-5)
except ti.InvalidOptionError:
print("Invalid Option!")
```
Invalid Option!
```python
print_info(ti.bbands)
```
Type: overlay
Full Name: Bollinger Bands
Inputs: ['real']
Options: ['period', 'stddev']
Outputs: ['bbands_lower', 'bbands_middle', 'bbands_upper']
```python
ti.bbands(DATA, period=5, stddev=2)
```
(array([ 80.53004219, 80.98714192, 82.53334324, 82.47198345,
82.41775044, 82.43520292, 82.51133078, 83.14261781,
83.53648779, 83.8703237 , 85.28887096]),
array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,
84.994, 85.574, 86.218, 86.804]),
array([ 84.32195781, 84.48885808, 83.65465676, 84.16401655,
84.83824956, 85.12079708, 85.99666922, 86.84538219,
87.61151221, 88.5656763 , 88.31912904]))
If inputs of differing sizes are provided, they are right-aligned and trimmed from the left:
```python
DATA2 = np.array([83.15, 82.84, 83.99, 84.55, 84.36])
```
```python
# 'high' trimmed to DATA[-5:] == array([ 85.53, 86.54, 86.89, 87.77, 87.29])
ti.aroonosc(high=DATA, low=DATA2, period=2)
```
array([ 50., 100., 50.])
Raw data
{
"_id": null,
"home_page": "https://github.com/cirla/tulipy",
"name": "tulipy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "https://github.com/cirla/tulipy/blob/master/AUTHORS",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/2c/fc/685a3fe73a66ed35332058c2e22b2ed63b7725ec32817753f11c06f48792/tulipy-0.4.0.tar.gz",
"platform": "",
"description": "[![Build Status](https://travis-ci.org/cirla/tulipy.svg?branch=master)](https://travis-ci.org/cirla/tulipy)\n[![Build status](https://ci.appveyor.com/api/projects/status/g34af6ti605e2q4h?svg=true)](https://ci.appveyor.com/project/cirla/tulipy)\n\n# tulipy\n\n## Python bindings for [Tulip Indicators](https://tulipindicators.org/)\n\nTulipy requires [numpy](http://www.numpy.org/) as all inputs and outputs are numpy arrays (`dtype=np.float64`).\n\n## Installation\n\nYou can install via `pip install tulipy`.\nIf a wheel is not available for your system, you will need to `pip install Cython numpy` to build from the source distribution.\nWhen building from source on Windows, you will need the Microsoft Visual C++ Build Tools installed.\n\n## Usage\n\n\n```python\nimport numpy as np\nimport tulipy as ti\n```\n\n\n```python\nti.TI_VERSION\n```\n\n\n\n\n '0.8.4'\n\n\n\n\n```python\nDATA = np.array([81.59, 81.06, 82.87, 83, 83.61,\n 83.15, 82.84, 83.99, 84.55, 84.36,\n 85.53, 86.54, 86.89, 87.77, 87.29])\n```\n\nInformation about indicators are exposed as properties:\n\n\n```python\ndef print_info(indicator):\n print(\"Type:\", indicator.type)\n print(\"Full Name:\", indicator.full_name)\n print(\"Inputs:\", indicator.inputs)\n print(\"Options:\", indicator.options)\n print(\"Outputs:\", indicator.outputs)\n```\n\n\n```python\nprint_info(ti.sqrt)\n```\n\n Type: simple\n Full Name: Vector Square Root\n Inputs: ['real']\n Options: []\n Outputs: ['sqrt']\n\n\nSingle outputs are returned directly. Indicators returning multiple outputs use\na tuple in the order indicated by the `outputs` property.\n\n\n```python\nti.sqrt(DATA)\n```\n\n\n\n\n array([ 9.03271831, 9.00333272, 9.10329611, 9.11043358, 9.14385039,\n 9.11866218, 9.1016482 , 9.16460583, 9.19510739, 9.18477 ,\n 9.24824308, 9.30268778, 9.32148057, 9.36856446, 9.34291175])\n\n\n\n\n```python\nprint_info(ti.sma)\n```\n\n Type: overlay\n Full Name: Simple Moving Average\n Inputs: ['real']\n Options: ['period']\n Outputs: ['sma']\n\n\n\n```python\nti.sma(DATA, period=5)\n```\n\n\n\n\n array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,\n 84.994, 85.574, 86.218, 86.804])\n\n\n\nInvalid options will throw an `InvalidOptionError`:\n\n\n```python\ntry:\n ti.sma(DATA, period=-5)\nexcept ti.InvalidOptionError:\n print(\"Invalid Option!\")\n```\n\n Invalid Option!\n\n\n\n```python\nprint_info(ti.bbands)\n```\n\n Type: overlay\n Full Name: Bollinger Bands\n Inputs: ['real']\n Options: ['period', 'stddev']\n Outputs: ['bbands_lower', 'bbands_middle', 'bbands_upper']\n\n\n\n```python\nti.bbands(DATA, period=5, stddev=2)\n```\n\n\n\n\n (array([ 80.53004219, 80.98714192, 82.53334324, 82.47198345,\n 82.41775044, 82.43520292, 82.51133078, 83.14261781,\n 83.53648779, 83.8703237 , 85.28887096]),\n array([ 82.426, 82.738, 83.094, 83.318, 83.628, 83.778, 84.254,\n 84.994, 85.574, 86.218, 86.804]),\n array([ 84.32195781, 84.48885808, 83.65465676, 84.16401655,\n 84.83824956, 85.12079708, 85.99666922, 86.84538219,\n 87.61151221, 88.5656763 , 88.31912904]))\n\n\n\nIf inputs of differing sizes are provided, they are right-aligned and trimmed from the left:\n\n\n```python\nDATA2 = np.array([83.15, 82.84, 83.99, 84.55, 84.36])\n```\n\n\n```python\n# 'high' trimmed to DATA[-5:] == array([ 85.53, 86.54, 86.89, 87.77, 87.29])\nti.aroonosc(high=DATA, low=DATA2, period=2)\n```\n\n\n\n\n array([ 50., 100., 50.])",
"bugtrack_url": null,
"license": "LGPL-3.0",
"summary": "Financial Technical Analysis Indicator Library. Python bindings for https://github.com/TulipCharts/tulipindicators",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/cirla/tulipy"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "69ebbcc11e171eb73a80f55eea8199ac61186dab63e4c0062a99312a8992f9bc",
"md5": "b2648450fa45b6d7f22bf42d8c4f1473",
"sha256": "540704956b5b940a5f6306aa393a37536a6d7c3cbc07efe47512f3496e5203ab"
},
"downloads": -1,
"filename": "tulipy-0.4.0-cp37-cp37m-win32.whl",
"has_sig": false,
"md5_digest": "b2648450fa45b6d7f22bf42d8c4f1473",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 83384,
"upload_time": "2019-04-11T03:40:50",
"upload_time_iso_8601": "2019-04-11T03:40:50.356219Z",
"url": "https://files.pythonhosted.org/packages/69/eb/bcc11e171eb73a80f55eea8199ac61186dab63e4c0062a99312a8992f9bc/tulipy-0.4.0-cp37-cp37m-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27bafe5e9c1de77c3bc6892d67f3f2ef3246604f66918a37c8f9ac416b662f5c",
"md5": "18b1b545e3dbc763ac10243f4efa25c6",
"sha256": "95542e40537afdd345d875baf37485eac993c6a819d00c51432e9de8df21eba8"
},
"downloads": -1,
"filename": "tulipy-0.4.0-cp37-cp37m-win_amd64.whl",
"has_sig": false,
"md5_digest": "18b1b545e3dbc763ac10243f4efa25c6",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 133157,
"upload_time": "2019-04-11T03:40:51",
"upload_time_iso_8601": "2019-04-11T03:40:51.664600Z",
"url": "https://files.pythonhosted.org/packages/27/ba/fe5e9c1de77c3bc6892d67f3f2ef3246604f66918a37c8f9ac416b662f5c/tulipy-0.4.0-cp37-cp37m-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2cfc685a3fe73a66ed35332058c2e22b2ed63b7725ec32817753f11c06f48792",
"md5": "f791897df22483e21c066228941324ad",
"sha256": "fbc31727ef7657c93ad910bfdce65fecc6aaa7a5e961fe00240718e7a3fc79d8"
},
"downloads": -1,
"filename": "tulipy-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "f791897df22483e21c066228941324ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 110271,
"upload_time": "2019-04-11T03:37:12",
"upload_time_iso_8601": "2019-04-11T03:37:12.125650Z",
"url": "https://files.pythonhosted.org/packages/2c/fc/685a3fe73a66ed35332058c2e22b2ed63b7725ec32817753f11c06f48792/tulipy-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-04-11 03:37:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cirla",
"github_project": "tulipy",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"appveyor": true,
"requirements": [],
"lcname": "tulipy"
}