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 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__