Skip to main content

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

Release files for pretty-talib 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pretty-talib 0.0.10
File Size Uploaded
pretty_talib-0.0.10.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pretty-talib 0.0.10
File Interpreter ABI Platform
pretty_talib-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / pretty_talib-0.0.10.tar.gz

Download URL pretty_talib-0.0.10.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8c06fee78c4365cd42e262fd4f45b9cc93f78fdadf8b085552503cf9a2cf8e1e
BLAKE2b-256 checksum
How to use checksums
e526ca266326511c8a9bcaa17ddece264d0380f68a2ca06ef1fe57f98e2bb7c7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pretty_talib-0.0.10-py3-none-any.whl

Download URL pretty_talib-0.0.10-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b636f2121ec0f4a4294bea4aea52f6d0506bec5c935608da35ac96013ce36f0
BLAKE2b-256 checksum
How to use checksums
ef0b7f0f29b9ce5075f73fc156f57041aa8aa78503304d7d9f02158b8154766e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page