saqds 1.9.5__py3-none-any.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.
saqds/__init__.py ADDED
@@ -0,0 +1,61 @@
1
+ from .clickhouse_tool import (
2
+ get_daily_hist,
3
+ get_etf_hist,
4
+ get_etf_hist_batch,
5
+ get_factor_version,
6
+ get_hk_etf_hist,
7
+ get_hk_etf_hist_batch,
8
+ get_hk_stock_hist,
9
+ get_hk_stock_hist_batch,
10
+ get_index_cyb,
11
+ get_index_hist,
12
+ get_index_hs300,
13
+ get_index_kc100,
14
+ get_index_sh,
15
+ get_index_zz500,
16
+ get_stock_hist,
17
+ get_stock_hist_batch,
18
+ get_stock_industry,
19
+ get_us_etf_hist,
20
+ get_us_etf_hist_batch,
21
+ get_us_stock_hist,
22
+ get_us_stock_hist_batch,
23
+ init,
24
+ verify_key,
25
+ )
26
+ from .evaluate import daily_ic, evaluate_factor, ir_from_ic, winsorize
27
+ from .factor import compute_factor_value, load_factor_function
28
+ from .math import sum_of_squares
29
+
30
+ __all__ = [
31
+ "compute_factor_value",
32
+ "daily_ic",
33
+ "evaluate_factor",
34
+ "get_daily_hist",
35
+ "get_etf_hist",
36
+ "get_etf_hist_batch",
37
+ "get_factor_version",
38
+ "get_hk_etf_hist",
39
+ "get_hk_etf_hist_batch",
40
+ "get_hk_stock_hist",
41
+ "get_hk_stock_hist_batch",
42
+ "get_index_cyb",
43
+ "get_index_hist",
44
+ "get_index_hs300",
45
+ "get_index_kc100",
46
+ "get_index_sh",
47
+ "get_index_zz500",
48
+ "get_stock_hist",
49
+ "get_stock_hist_batch",
50
+ "get_stock_industry",
51
+ "get_us_etf_hist",
52
+ "get_us_etf_hist_batch",
53
+ "get_us_stock_hist",
54
+ "get_us_stock_hist_batch",
55
+ "init",
56
+ "ir_from_ic",
57
+ "load_factor_function",
58
+ "sum_of_squares",
59
+ "verify_key",
60
+ "winsorize",
61
+ ]
saqds/cli.py ADDED
@@ -0,0 +1,23 @@
1
+ import click
2
+
3
+ from .math import sum_of_squares
4
+
5
+
6
+ @click.command()
7
+ @click.argument("numbers", nargs=-1)
8
+ def main(numbers):
9
+ """Saqds CLI: calculate sum of squares"""
10
+ if not numbers:
11
+ click.echo("Please input numbers")
12
+ return
13
+ try:
14
+ nums = [float(x) for x in numbers]
15
+ except ValueError as e:
16
+ click.echo(f"Invalid numeric value: {e}", err=True)
17
+ raise SystemExit(1) from None
18
+ res = sum_of_squares(nums)
19
+ click.echo(f"Sum of squares: {res}")
20
+
21
+
22
+ if __name__ == "__main__":
23
+ main()