Skip to main content

prettified interface for TA-Lib

Project description

pretty_talib

python_version PyPI downloads/month

Description

Prettified interface for TA-Lib

Install

  1. Install TA-Lib dependency

    • For Mac it's easy as that
      brew install ta-lib
      
    • For other platforms, or troubleshooting please check the installation guide for TA-Lib
  2. Install pretty_talib

pip install pretty_talib
# or
pip3 install pretty_talib

Important Note

THE TYPE OF 'data' AND THE VALUES OF 'use_builtin_types' AND 'use_objects' HIGHLY AFFECTS EFFICIENCY.

SEE BENCHMARK BELOW (Ran 250 times)

--------------------------------------------------------------------------------------------------
| rank |                                setup                               |  duration  |  perc |
--------------------------------------------------------------------------------------------------
|    1 | data: Dict,             use_builtin_types=False, use_objects=False | 0.00626893 |       |
|    2 | data: Dict,             use_builtin_types=True,  use_objects=False | 0.02440002 | 3.89x | -> ~5.4x slower
|    3 | data: Dict,             use_builtin_types=True,  use_objects=True  | 0.03171391 | 5.05x | -> ~5.9x slower
|    4 | data: pandas.DataFrame, use_builtin_types=False, use_objects=False | 0.03171391 | 5.05x | -> ~6.1x slower
--------------------------------------------------------------------------------------------------

Usage

# System
import json

# Pip
import numpy

# Local
from pretty_talib import get_stats, ALL, FunctionName



l=50
timeperiod = 5
data = {
    'open': numpy.random.random(l),
    'high': numpy.random.random(l),
    'low': numpy.random.random(l),
    'close': numpy.random.random(l),
    'volume': numpy.random.random(l)
}

stats = get_stats(data, timeperiod=timeperiod, use_builtin_types=False)

with open('stats.json', 'w') as file:
    json.dump(stats, file, indent=4)

# BENCHMARKS

# from funcmeasure import measure

# def use_objects_false_use_builtin_types_false():
#     get_stats(data, types=ALL, timeperiod=timeperiod)

# def use_objects_false_builtin_types_true():
#     get_stats(data, types=ALL, timeperiod=timeperiod, use_builtin_types=True)

# def use_objects_true_use_builtin_types_true():
#     get_stats(data, types=ALL, timeperiod=timeperiod, use_objects=True)

# measure(
#     [
#         use_objects_false_use_builtin_types_false,
#         use_objects_false_builtin_types_true,
#         use_objects_true_use_builtin_types_true
#     ],
#     times=100
# )

Credits

TA-Lib by mrjbq7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretty_talib-0.0.10.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

pretty_talib-0.0.10-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file pretty_talib-0.0.10.tar.gz.

File metadata

  • Download URL: pretty_talib-0.0.10.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pretty_talib-0.0.10.tar.gz
Algorithm Hash digest
SHA256 8c06fee78c4365cd42e262fd4f45b9cc93f78fdadf8b085552503cf9a2cf8e1e
MD5 ad1b3efe04ae1832cae162b6ce148ffd
BLAKE2b-256 e526ca266326511c8a9bcaa17ddece264d0380f68a2ca06ef1fe57f98e2bb7c7

See more details on using hashes here.

File details

Details for the file pretty_talib-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: pretty_talib-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

File hashes

Hashes for pretty_talib-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4b636f2121ec0f4a4294bea4aea52f6d0506bec5c935608da35ac96013ce36f0
MD5 0e2e93bc801ceb9eea9c454392e1c2c3
BLAKE2b-256 ef0b7f0f29b9ce5075f73fc156f57041aa8aa78503304d7d9f02158b8154766e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page