sovai 0.2.6__tar.gz → 0.2.8__tar.gz
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.
- {sovai-0.2.6 → sovai-0.2.8}/PKG-INFO +30 -30
- sovai-0.2.8/pyproject.toml +90 -0
- sovai-0.2.8/sovai/__init__.py +29 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/get_data.py +48 -56
- sovai-0.2.6/pyproject.toml +0 -76
- sovai-0.2.6/sovai/__init__.py +0 -36
- {sovai-0.2.6 → sovai-0.2.8}/LICENSE +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/README.md +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/api_config.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/assets/dropdown.css +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/assets/features_mapping.parq +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/basic_auth.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/computations/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/computations/functions.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/errors/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/errors/sovai_errors.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/anomalies.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/change_point_generator.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/clustering.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/core_kshape.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/cum_sum_torch.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/cusum.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/dimensionality_reduction.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/feature_extraction.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/feature_importance.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/feature_neutralizer.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/fractional_differencing.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/nowcasting.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/pairwise.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/pandas_extensions.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/parallel_functions.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/pfa_feature_selector.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/regime_change.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/regime_change_pca.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/shapley_global_importance.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/shapley_importance.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/signal_evaluation.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/technical_indicators.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/time_decomposition.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/extensions/weight_optimization.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/get_compute.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/get_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/get_reports.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/get_tools.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/accounting/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/accounting/accounting_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/allocation/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/allocation/allocation_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/bankruptcy/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/bankruptcy/bankruptcy_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/breakout/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/breakout/breakout_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/corp_risk/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/corp_risk/corp_risk_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/earnings_surprise/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/earnings_surprise/earnings_surprise_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/insider/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/insider/insider_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/institutional/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/institutional/institutional_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/news/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/news/news_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/ratios/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/plots/ratios/ratios_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/accounting/__inti__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/accounting/accounting_balance_sheet.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/bankruptcy/__inti__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/bankruptcy/bankruptcy_monthly_top.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/general/__inti__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/general/general_plots.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/news/__inti__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/reports/news/news_econometric_analysis.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/studies/nowcasting.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/token_auth.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/tools/sec/__inti__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/tools/sec/sec_10_k_8_k_filings.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/tools/sec/sec_edgar_search.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/__init__.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/client_side.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/converter.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/datetime_formats.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/file_management.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/get_tickers.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/helpers.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/pandas_extensions copy.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/plot.py +0 -0
- {sovai-0.2.6 → sovai-0.2.8}/sovai/utils/stream.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sovai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: python for asset management
|
|
5
5
|
License: Proprietary License
|
|
6
6
|
Author: Derek Snow
|
|
@@ -11,35 +11,35 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Provides-Extra:
|
|
15
|
-
Requires-Dist: boto3 (>=1.20)
|
|
16
|
-
Requires-Dist: dash (>=2.0)
|
|
17
|
-
Requires-Dist: dash-bootstrap-components (>=1.6.0
|
|
18
|
-
Requires-Dist: great-tables (>=0.9)
|
|
19
|
-
Requires-Dist: ipywidgets (>=8.1.3
|
|
20
|
-
Requires-Dist: joblib (>=1.0)
|
|
21
|
-
Requires-Dist: lightgbm (>=4.5.0
|
|
22
|
-
Requires-Dist: matplotlib (>=3.0)
|
|
23
|
-
Requires-Dist: mfles (>=0.2)
|
|
24
|
-
Requires-Dist: numba (>=0.50)
|
|
25
|
-
Requires-Dist: numpy (>=1.20)
|
|
26
|
-
Requires-Dist: openai (>=1.0)
|
|
27
|
-
Requires-Dist: pandas (>=1.0)
|
|
28
|
-
Requires-Dist: pexpect (>=4.9.0
|
|
29
|
-
Requires-Dist: plotly (>=5.0)
|
|
30
|
-
Requires-Dist: polars (>=0.20.30)
|
|
31
|
-
Requires-Dist: polars-talib (==0.1.3)
|
|
32
|
-
Requires-Dist: pyarrow (>=5.0)
|
|
33
|
-
Requires-Dist: python-dateutil (>=2.8)
|
|
34
|
-
Requires-Dist: python-dotenv (>=0.10)
|
|
35
|
-
Requires-Dist: requests (>=2.20)
|
|
36
|
-
Requires-Dist: ruptures (>=1.0)
|
|
37
|
-
Requires-Dist: scikit-learn (>=1.0)
|
|
38
|
-
Requires-Dist: scipy (>=1.0)
|
|
39
|
-
Requires-Dist: shap (>=0.40)
|
|
40
|
-
Requires-Dist: skfolio (>=0.3
|
|
41
|
-
Requires-Dist: statsforecast (>=1.0)
|
|
42
|
-
Requires-Dist: tensorly (>=0.6)
|
|
14
|
+
Provides-Extra: full
|
|
15
|
+
Requires-Dist: boto3 (>=1.20) ; extra == "full"
|
|
16
|
+
Requires-Dist: dash (>=2.0) ; extra == "full"
|
|
17
|
+
Requires-Dist: dash-bootstrap-components (>=1.6.0) ; extra == "full"
|
|
18
|
+
Requires-Dist: great-tables (>=0.9) ; extra == "full"
|
|
19
|
+
Requires-Dist: ipywidgets (>=8.1.3) ; extra == "full"
|
|
20
|
+
Requires-Dist: joblib (>=1.0) ; extra == "full"
|
|
21
|
+
Requires-Dist: lightgbm (>=4.5.0) ; extra == "full"
|
|
22
|
+
Requires-Dist: matplotlib (>=3.0) ; extra == "full"
|
|
23
|
+
Requires-Dist: mfles (>=0.2) ; extra == "full"
|
|
24
|
+
Requires-Dist: numba (>=0.50) ; extra == "full"
|
|
25
|
+
Requires-Dist: numpy (>=1.20)
|
|
26
|
+
Requires-Dist: openai (>=1.0) ; extra == "full"
|
|
27
|
+
Requires-Dist: pandas (>=1.0)
|
|
28
|
+
Requires-Dist: pexpect (>=4.9.0) ; extra == "full"
|
|
29
|
+
Requires-Dist: plotly (>=5.0) ; extra == "full"
|
|
30
|
+
Requires-Dist: polars (>=0.20.30)
|
|
31
|
+
Requires-Dist: polars-talib (==0.1.3) ; extra == "full"
|
|
32
|
+
Requires-Dist: pyarrow (>=5.0)
|
|
33
|
+
Requires-Dist: python-dateutil (>=2.8)
|
|
34
|
+
Requires-Dist: python-dotenv (>=0.10)
|
|
35
|
+
Requires-Dist: requests (>=2.20)
|
|
36
|
+
Requires-Dist: ruptures (>=1.0) ; extra == "full"
|
|
37
|
+
Requires-Dist: scikit-learn (>=1.0) ; extra == "full"
|
|
38
|
+
Requires-Dist: scipy (>=1.0) ; extra == "full"
|
|
39
|
+
Requires-Dist: shap (>=0.40) ; extra == "full"
|
|
40
|
+
Requires-Dist: skfolio (>=0.3) ; extra == "full"
|
|
41
|
+
Requires-Dist: statsforecast (>=1.0) ; extra == "full"
|
|
42
|
+
Requires-Dist: tensorly (>=0.6) ; extra == "full"
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
|
|
45
45
|
[](https://github.com/sovai-research/SovAI/actions/workflows/main.yml)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "sovai"
|
|
3
|
+
version = "0.2.8"
|
|
4
|
+
description = "python for asset management"
|
|
5
|
+
authors = ["Derek Snow <d.snow@outlook.com>"]
|
|
6
|
+
license = "Proprietary License"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
include = ["sovai/**/*", "data/**/*"]
|
|
9
|
+
exclude = [
|
|
10
|
+
"notebooks",
|
|
11
|
+
"notebooks/**/*",
|
|
12
|
+
"tests",
|
|
13
|
+
"tests/**/*",
|
|
14
|
+
"docs",
|
|
15
|
+
"docs/**/*",
|
|
16
|
+
".github",
|
|
17
|
+
".github/**/*",
|
|
18
|
+
".venv",
|
|
19
|
+
".venv/**/*",
|
|
20
|
+
"dist",
|
|
21
|
+
"dist/**/*",
|
|
22
|
+
"*.pyc",
|
|
23
|
+
"**/*.pyc",
|
|
24
|
+
"*.pyo",
|
|
25
|
+
"**/*.pyo",
|
|
26
|
+
"__pycache__",
|
|
27
|
+
"**/__pycache__",
|
|
28
|
+
".ipynb_checkpoints",
|
|
29
|
+
"**/.ipynb_checkpoints",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[tool.poetry.dependencies]
|
|
33
|
+
python = "^3.10"
|
|
34
|
+
pandas = ">=1.0"
|
|
35
|
+
numpy = ">=1.20"
|
|
36
|
+
pyarrow = ">=5.0"
|
|
37
|
+
requests = ">=2.20"
|
|
38
|
+
python-dateutil = ">=2.8"
|
|
39
|
+
python-dotenv = ">=0.10"
|
|
40
|
+
polars = ">=0.20.30"
|
|
41
|
+
scipy = {version = ">=1.0", optional = true}
|
|
42
|
+
joblib = {version = ">=1.0", optional = true}
|
|
43
|
+
matplotlib = {version = ">=3.0", optional = true}
|
|
44
|
+
plotly = {version = ">=5.0", optional = true}
|
|
45
|
+
scikit-learn = {version = ">=1.0", optional = true}
|
|
46
|
+
numba = {version = ">=0.50", optional = true}
|
|
47
|
+
boto3 = {version = ">=1.20", optional = true}
|
|
48
|
+
dash = {version = ">=2.0", optional = true}
|
|
49
|
+
great-tables = {version = ">=0.9", optional = true}
|
|
50
|
+
ruptures = {version = ">=1.0", optional = true}
|
|
51
|
+
shap = {version = ">=0.40", optional = true}
|
|
52
|
+
skfolio = {version = ">=0.3", optional = true}
|
|
53
|
+
statsforecast = {version = ">=1.0", optional = true}
|
|
54
|
+
tensorly = {version = ">=0.6", optional = true}
|
|
55
|
+
openai = {version = ">=1.0", optional = true}
|
|
56
|
+
mfles = {version = ">=0.2", optional = true}
|
|
57
|
+
pexpect = {version = ">=4.9.0", optional = true}
|
|
58
|
+
lightgbm = {version = ">=4.5.0", optional = true}
|
|
59
|
+
ipywidgets = {version = ">=8.1.3", optional = true}
|
|
60
|
+
polars-talib = {version = "0.1.3", optional = true}
|
|
61
|
+
dash-bootstrap-components = {version = ">=1.6.0", optional = true}
|
|
62
|
+
|
|
63
|
+
[tool.poetry.extras]
|
|
64
|
+
full = [
|
|
65
|
+
"scipy",
|
|
66
|
+
"joblib",
|
|
67
|
+
"matplotlib",
|
|
68
|
+
"plotly",
|
|
69
|
+
"scikit-learn",
|
|
70
|
+
"numba",
|
|
71
|
+
"boto3",
|
|
72
|
+
"dash",
|
|
73
|
+
"great-tables",
|
|
74
|
+
"ruptures",
|
|
75
|
+
"shap",
|
|
76
|
+
"skfolio",
|
|
77
|
+
"statsforecast",
|
|
78
|
+
"tensorly",
|
|
79
|
+
"openai",
|
|
80
|
+
"mfles",
|
|
81
|
+
"pexpect",
|
|
82
|
+
"lightgbm",
|
|
83
|
+
"ipywidgets",
|
|
84
|
+
"polars-talib",
|
|
85
|
+
"dash-bootstrap-components"
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[build-system]
|
|
89
|
+
requires = ["poetry-core"]
|
|
90
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Main SovAI SDK Tool Kit package
|
|
3
|
+
"""
|
|
4
|
+
from .api_config import read_key, save_key, ApiConfig
|
|
5
|
+
from .get_data import data
|
|
6
|
+
from .basic_auth import basic_auth
|
|
7
|
+
from .token_auth import token_auth
|
|
8
|
+
from .utils.file_management import save_or_update_tickers
|
|
9
|
+
|
|
10
|
+
__version__ = "0.1.25"
|
|
11
|
+
|
|
12
|
+
# Call the function to ensure tickers data is up-to-date
|
|
13
|
+
save_or_update_tickers()
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
from .get_plots import plot
|
|
17
|
+
from .get_reports import report
|
|
18
|
+
from .get_compute import compute
|
|
19
|
+
from .studies.nowcasting import nowcast
|
|
20
|
+
from .extensions.pandas_extensions import CustomDataFrame as extension
|
|
21
|
+
from .get_tools import sec_search, sec_filing
|
|
22
|
+
HAS_FULL_INSTALL = True
|
|
23
|
+
except ImportError:
|
|
24
|
+
HAS_FULL_INSTALL = False
|
|
25
|
+
|
|
26
|
+
__all__ = ['read_key', 'save_key', 'ApiConfig', 'data', 'basic_auth', 'token_auth']
|
|
27
|
+
|
|
28
|
+
if HAS_FULL_INSTALL:
|
|
29
|
+
__all__ += ['plot', 'report', 'compute', 'nowcast', 'extension', 'sec_search', 'sec_filing']
|
|
@@ -2,32 +2,35 @@ from typing import Optional, Union, Tuple, List, Dict
|
|
|
2
2
|
import re
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
import pandas as pd
|
|
5
|
-
import requests
|
|
5
|
+
import requests
|
|
6
|
+
import json
|
|
7
|
+
import hashlib
|
|
8
|
+
import numpy as np
|
|
9
|
+
import pyarrow.parquet as pq
|
|
10
|
+
from io import BytesIO
|
|
11
|
+
import boto3
|
|
12
|
+
import polars as pl
|
|
13
|
+
|
|
14
|
+
# from fastapi import HTTPException ## Dee
|
|
15
|
+
|
|
16
|
+
import pyarrow.parquet as pq
|
|
6
17
|
|
|
7
18
|
from sovai.api_config import ApiConfig
|
|
8
19
|
from sovai.errors.sovai_errors import InvalidInputData
|
|
9
20
|
from sovai.utils.converter import convert_data2df
|
|
10
21
|
from sovai.utils.stream import stream_data, stream_data_pyarrow
|
|
11
22
|
from sovai.utils.datetime_formats import datetime_format
|
|
12
|
-
from sovai.utils.plot import plotting_data
|
|
13
23
|
from sovai.utils.client_side import client_side_frame
|
|
14
24
|
|
|
15
|
-
|
|
25
|
+
try:
|
|
26
|
+
from sovai.extensions.pandas_extensions import CustomDataFrame
|
|
27
|
+
from sovai.utils.plot import plotting_data
|
|
28
|
+
HAS_FULL_INSTALL = True
|
|
29
|
+
except ImportError:
|
|
30
|
+
HAS_FULL_INSTALL = False
|
|
16
31
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import boto3
|
|
21
|
-
from io import BytesIO
|
|
22
|
-
import json
|
|
23
|
-
|
|
24
|
-
# from fastapi import HTTPException ## Dee
|
|
25
|
-
|
|
26
|
-
import pyarrow.parquet as pq
|
|
27
|
-
import time
|
|
28
|
-
import hashlib
|
|
29
|
-
import json
|
|
30
|
-
import numpy as np
|
|
32
|
+
def is_full_installation():
|
|
33
|
+
return HAS_FULL_INSTALL
|
|
31
34
|
|
|
32
35
|
# client_side_frame is the one for very quick public files.
|
|
33
36
|
|
|
@@ -40,35 +43,23 @@ import numpy as np
|
|
|
40
43
|
# Wall time: 50s (direct via gcp)
|
|
41
44
|
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"""
|
|
46
|
-
Load a Parquet file from a Wasabi bucket into a pandas DataFrame.
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
bucket_name (str): Name of the Wasabi bucket.
|
|
50
|
-
file_name (str): Name of the file in the bucket.
|
|
51
|
-
access_key (str): Wasabi access key.
|
|
52
|
-
secret_key (str): Wasabi secret key.
|
|
53
|
-
|
|
54
|
-
Returns:
|
|
55
|
-
pandas.DataFrame: DataFrame loaded from the Parquet file.
|
|
56
|
-
"""
|
|
46
|
+
# Global cache
|
|
47
|
+
_query_cache = {}
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
def load_df_from_wasabi(bucket_name, file_name, access_key, secret_key):
|
|
50
|
+
import boto3
|
|
59
51
|
s3_client = boto3.client(
|
|
60
52
|
"s3",
|
|
61
53
|
endpoint_url="https://s3.wasabisys.com",
|
|
62
54
|
aws_access_key_id=access_key,
|
|
63
55
|
aws_secret_access_key=secret_key,
|
|
64
56
|
)
|
|
65
|
-
|
|
66
|
-
# Download the file
|
|
67
57
|
parquet_buffer = BytesIO()
|
|
68
58
|
s3_client.download_fileobj(bucket_name, file_name, parquet_buffer)
|
|
69
59
|
parquet_buffer.seek(0)
|
|
60
|
+
df = pq.read_table(source=parquet_buffer).to_pandas()
|
|
61
|
+
return CustomDataFrame(df) if HAS_FULL_INSTALL else df
|
|
70
62
|
|
|
71
|
-
return pq.read_table(source=parquet_buffer).to_pandas()
|
|
72
63
|
|
|
73
64
|
|
|
74
65
|
def is_all(tickers):
|
|
@@ -92,20 +83,12 @@ import polars as pl
|
|
|
92
83
|
from typing import Union
|
|
93
84
|
|
|
94
85
|
|
|
95
|
-
def read_parquet(
|
|
96
|
-
url: str, use_polars: bool = False
|
|
97
|
-
) -> Union[pd.DataFrame, pl.DataFrame]:
|
|
98
|
-
"""
|
|
99
|
-
Reads a Parquet file into a DataFrame using Pandas or Polars.
|
|
100
|
-
|
|
101
|
-
:param url: URL or file path of the Parquet file.
|
|
102
|
-
:param use_polars: If True, use Polars to read the file; otherwise, use Pandas.
|
|
103
|
-
:return: DataFrame loaded from the Parquet file.
|
|
104
|
-
"""
|
|
86
|
+
def read_parquet(url: str, use_polars: bool = False) -> Union[pd.DataFrame, pl.DataFrame]:
|
|
105
87
|
if use_polars:
|
|
106
88
|
return pl.read_parquet(url)
|
|
107
89
|
else:
|
|
108
|
-
|
|
90
|
+
df = pd.read_parquet(url)
|
|
91
|
+
return CustomDataFrame(df) if HAS_FULL_INSTALL else df
|
|
109
92
|
|
|
110
93
|
|
|
111
94
|
import pandas as pd
|
|
@@ -381,11 +364,10 @@ def data(
|
|
|
381
364
|
frequency: str = None,
|
|
382
365
|
verbose: bool = False,
|
|
383
366
|
# **kwargs, ## kwargs if you want to allow for random
|
|
384
|
-
) -> pd.DataFrame:
|
|
367
|
+
) -> Union[pd.DataFrame, 'CustomDataFrame']:
|
|
385
368
|
verbose_mode.toggle_verbose(verbose)
|
|
386
369
|
|
|
387
370
|
params = params or {}
|
|
388
|
-
# params.update(kwargs)
|
|
389
371
|
params = map_synonyms(params)
|
|
390
372
|
|
|
391
373
|
params.update(
|
|
@@ -472,13 +454,18 @@ def data(
|
|
|
472
454
|
if content_type == "application/octet-stream":
|
|
473
455
|
if data_format == "pyarrow":
|
|
474
456
|
verbose_mode.vprint(f"header: {data_format}")
|
|
475
|
-
data =
|
|
457
|
+
data = stream_data_pyarrow(res)
|
|
476
458
|
else:
|
|
477
459
|
verbose_mode.vprint(f"header: not pyarrow")
|
|
478
|
-
data =
|
|
460
|
+
data = stream_data(res)
|
|
461
|
+
|
|
462
|
+
if HAS_FULL_INSTALL:
|
|
463
|
+
data = CustomDataFrame(data)
|
|
464
|
+
else:
|
|
465
|
+
data = pd.DataFrame(data)
|
|
466
|
+
|
|
479
467
|
_query_cache[cache_key] = data
|
|
480
468
|
return data
|
|
481
|
-
|
|
482
469
|
|
|
483
470
|
# Example usage in your existing code:
|
|
484
471
|
if is_all(tickers):
|
|
@@ -492,15 +479,20 @@ def data(
|
|
|
492
479
|
|
|
493
480
|
verbose_mode.vprint("It reached the DF")
|
|
494
481
|
try:
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
except:
|
|
498
|
-
|
|
482
|
+
from sovai.extensions.pandas_extensions import CustomDataFrame
|
|
483
|
+
data = CustomDataFrame(data)
|
|
484
|
+
except ImportError:
|
|
485
|
+
data = pd.DataFrame(data)
|
|
486
|
+
|
|
487
|
+
_query_cache[cache_key] = data
|
|
499
488
|
|
|
500
489
|
verbose_mode.vprint("It passed the DF")
|
|
501
490
|
|
|
502
491
|
if plot:
|
|
503
|
-
|
|
492
|
+
if HAS_FULL_INSTALL:
|
|
493
|
+
_draw_graphs(data)
|
|
494
|
+
else:
|
|
495
|
+
print("Plotting is only available with the full installation. Please install 'sovai[full]' to use this feature.")
|
|
504
496
|
return None
|
|
505
497
|
return data
|
|
506
498
|
except Exception as err:
|
sovai-0.2.6/pyproject.toml
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
[tool.poetry]
|
|
2
|
-
name = "sovai"
|
|
3
|
-
version = "0.2.6"
|
|
4
|
-
description = "python for asset management"
|
|
5
|
-
authors = ["Derek Snow <d.snow@outlook.com>"]
|
|
6
|
-
license = "Proprietary License"
|
|
7
|
-
readme = "README.md"
|
|
8
|
-
include = ["sovai/**/*", "data/**/*"]
|
|
9
|
-
exclude = [
|
|
10
|
-
"notebooks",
|
|
11
|
-
"notebooks/**/*",
|
|
12
|
-
"tests",
|
|
13
|
-
"tests/**/*",
|
|
14
|
-
"docs",
|
|
15
|
-
"docs/**/*",
|
|
16
|
-
".github",
|
|
17
|
-
".github/**/*",
|
|
18
|
-
".venv",
|
|
19
|
-
".venv/**/*",
|
|
20
|
-
"dist",
|
|
21
|
-
"dist/**/*",
|
|
22
|
-
"*.pyc",
|
|
23
|
-
"**/*.pyc",
|
|
24
|
-
"*.pyo",
|
|
25
|
-
"**/*.pyo",
|
|
26
|
-
"__pycache__",
|
|
27
|
-
"**/__pycache__",
|
|
28
|
-
".ipynb_checkpoints",
|
|
29
|
-
"**/.ipynb_checkpoints",
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
[tool.poetry.dependencies]
|
|
33
|
-
python = "^3.10"
|
|
34
|
-
numpy = ">=1.20"
|
|
35
|
-
scipy = ">=1.0"
|
|
36
|
-
pandas = ">=1.0"
|
|
37
|
-
python-dateutil = ">=2.8"
|
|
38
|
-
python-dotenv = ">=0.10"
|
|
39
|
-
requests = ">=2.20"
|
|
40
|
-
joblib = ">=1.0"
|
|
41
|
-
pyarrow = ">=5.0"
|
|
42
|
-
matplotlib = ">=3.0"
|
|
43
|
-
plotly = ">=5.0"
|
|
44
|
-
scikit-learn = ">=1.0"
|
|
45
|
-
numba = ">=0.50"
|
|
46
|
-
boto3 = ">=1.20"
|
|
47
|
-
dash = ">=2.0"
|
|
48
|
-
great-tables = ">=0.9"
|
|
49
|
-
polars = ">=0.20.30"
|
|
50
|
-
ruptures = ">=1.0"
|
|
51
|
-
shap = ">=0.40"
|
|
52
|
-
skfolio = {version = "^0.3", extras = []}
|
|
53
|
-
statsforecast = ">=1.0"
|
|
54
|
-
tensorly = ">=0.6"
|
|
55
|
-
openai = ">=1.0"
|
|
56
|
-
mfles = ">=0.2"
|
|
57
|
-
pexpect = "^4.9.0"
|
|
58
|
-
lightgbm = "^4.5.0"
|
|
59
|
-
ipywidgets = "^8.1.3"
|
|
60
|
-
polars-talib = "0.1.3"
|
|
61
|
-
dash-bootstrap-components = "^1.6.0"
|
|
62
|
-
|
|
63
|
-
[tool.poetry.extras]
|
|
64
|
-
data = [
|
|
65
|
-
"pandas",
|
|
66
|
-
"numpy",
|
|
67
|
-
"pyarrow",
|
|
68
|
-
"requests",
|
|
69
|
-
"python-dateutil",
|
|
70
|
-
"python-dotenv",
|
|
71
|
-
"polars",
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
[build-system]
|
|
75
|
-
requires = ["poetry-core"]
|
|
76
|
-
build-backend = "poetry.core.masonry.api"
|
sovai-0.2.6/sovai/__init__.py
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Main SovAI SDK Tool Kit package
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from .api_config import read_key, save_key
|
|
6
|
-
from .api_config import ApiConfig
|
|
7
|
-
from .get_data import data
|
|
8
|
-
from .get_plots import plot
|
|
9
|
-
from .get_reports import report
|
|
10
|
-
from .get_compute import compute
|
|
11
|
-
|
|
12
|
-
from .basic_auth import basic_auth
|
|
13
|
-
from .token_auth import token_auth
|
|
14
|
-
from .studies.nowcasting import nowcast
|
|
15
|
-
|
|
16
|
-
from .extensions.pandas_extensions import CustomDataFrame as extension
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
from .utils.file_management import save_or_update_tickers
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from .get_tools import sec_search
|
|
24
|
-
|
|
25
|
-
from .get_tools import sec_filing
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# Call the function to ensure tickers data is up-to-date
|
|
33
|
-
save_or_update_tickers()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
__version__ = "0.1.25"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|