quantalib 0.8.2__py3-none-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quantalib/__init__.py +105 -0
- quantalib/_bridge.py +566 -0
- quantalib/_compat.py +72 -0
- quantalib/_helpers.py +236 -0
- quantalib/_loader.py +43 -0
- quantalib/channels.py +352 -0
- quantalib/core.py +98 -0
- quantalib/cycles.py +152 -0
- quantalib/dynamics.py +295 -0
- quantalib/errors.py +322 -0
- quantalib/filters.py +422 -0
- quantalib/indicators.py +40 -0
- quantalib/momentum.py +233 -0
- quantalib/native/linux_x86_64/.gitkeep +1 -0
- quantalib/native/macosx_arm64/.gitkeep +1 -0
- quantalib/native/macosx_x86_64/.gitkeep +1 -0
- quantalib/native/win_amd64/.gitkeep +1 -0
- quantalib/native/win_arm64/quantalib_native.dll +0 -0
- quantalib/numerics.py +330 -0
- quantalib/oscillators.py +553 -0
- quantalib/py.typed +1 -0
- quantalib/reversals.py +156 -0
- quantalib/statistics.py +394 -0
- quantalib/trends_fir.py +371 -0
- quantalib/trends_iir.py +472 -0
- quantalib/volatility.py +341 -0
- quantalib/volume.py +317 -0
- quantalib-0.8.2.dist-info/METADATA +111 -0
- quantalib-0.8.2.dist-info/RECORD +30 -0
- quantalib-0.8.2.dist-info/WHEEL +5 -0
quantalib/__init__.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""quantalib — Python wrapper for QuanTAlib NativeAOT exports.
|
|
2
|
+
|
|
3
|
+
Usage::
|
|
4
|
+
|
|
5
|
+
import quantalib as qtl
|
|
6
|
+
|
|
7
|
+
result = qtl.sma(close_array, length=14)
|
|
8
|
+
result = qtl.bbands(close_array, length=20, std=2.0)
|
|
9
|
+
|
|
10
|
+
print(qtl.version) # e.g. "0.8.0"
|
|
11
|
+
print(qtl.__version__) # same
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from ._loader import load_native_library
|
|
18
|
+
from . import indicators
|
|
19
|
+
from .indicators import * # noqa: F401, F403 — re-export all indicator functions
|
|
20
|
+
|
|
21
|
+
# Re-export per-category submodules for direct access
|
|
22
|
+
from . import ( # noqa: F401
|
|
23
|
+
channels,
|
|
24
|
+
core,
|
|
25
|
+
cycles,
|
|
26
|
+
dynamics,
|
|
27
|
+
errors,
|
|
28
|
+
filters,
|
|
29
|
+
momentum,
|
|
30
|
+
numerics,
|
|
31
|
+
oscillators,
|
|
32
|
+
reversals,
|
|
33
|
+
statistics,
|
|
34
|
+
trends_fir,
|
|
35
|
+
trends_iir,
|
|
36
|
+
volatility,
|
|
37
|
+
volume,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
from ._compat import ALIASES, get_compat
|
|
41
|
+
from ._bridge import (
|
|
42
|
+
QtlError,
|
|
43
|
+
QtlNullPointerError,
|
|
44
|
+
QtlInvalidLengthError,
|
|
45
|
+
QtlInvalidParamError,
|
|
46
|
+
QtlInternalError,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
__all__ = [
|
|
50
|
+
"load_native_library",
|
|
51
|
+
"indicators",
|
|
52
|
+
"channels",
|
|
53
|
+
"core",
|
|
54
|
+
"cycles",
|
|
55
|
+
"dynamics",
|
|
56
|
+
"errors",
|
|
57
|
+
"filters",
|
|
58
|
+
"momentum",
|
|
59
|
+
"numerics",
|
|
60
|
+
"oscillators",
|
|
61
|
+
"reversals",
|
|
62
|
+
"statistics",
|
|
63
|
+
"trends_fir",
|
|
64
|
+
"trends_iir",
|
|
65
|
+
"volatility",
|
|
66
|
+
"volume",
|
|
67
|
+
"ALIASES",
|
|
68
|
+
"get_compat",
|
|
69
|
+
"QtlError",
|
|
70
|
+
"QtlNullPointerError",
|
|
71
|
+
"QtlInvalidLengthError",
|
|
72
|
+
"QtlInvalidParamError",
|
|
73
|
+
"QtlInternalError",
|
|
74
|
+
"version",
|
|
75
|
+
"__version__",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _resolve_version() -> str:
|
|
80
|
+
"""Resolve version from lib/VERSION (dev) or package metadata (installed)."""
|
|
81
|
+
# 1. Try repo-local VERSION file (works in dev / editable install)
|
|
82
|
+
pkg_dir = Path(__file__).resolve().parent # python/quantalib/
|
|
83
|
+
candidates = [
|
|
84
|
+
pkg_dir.parents[1] / "lib" / "VERSION", # repo root / lib / VERSION
|
|
85
|
+
pkg_dir.parent / "lib" / "VERSION", # python / lib / VERSION (fallback)
|
|
86
|
+
pkg_dir / "VERSION", # baked into wheel
|
|
87
|
+
]
|
|
88
|
+
for vf in candidates:
|
|
89
|
+
if vf.is_file():
|
|
90
|
+
ver = vf.read_text(encoding="utf-8").strip()
|
|
91
|
+
if ver:
|
|
92
|
+
return ver
|
|
93
|
+
|
|
94
|
+
# 2. Fall back to importlib.metadata (pip-installed wheel)
|
|
95
|
+
try:
|
|
96
|
+
from importlib.metadata import version as _pkg_version
|
|
97
|
+
return _pkg_version("quantalib")
|
|
98
|
+
except Exception:
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
return "0.0.0"
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
__version__: str = _resolve_version()
|
|
105
|
+
version: str = __version__
|