stock-analysis-plugin 0.1.1__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.
- stock_analysis_plugin-0.1.1/.github/workflows/ci.yml +107 -0
- stock_analysis_plugin-0.1.1/.github/workflows/publish.yml +144 -0
- stock_analysis_plugin-0.1.1/.gitignore +45 -0
- stock_analysis_plugin-0.1.1/.npmignore +25 -0
- stock_analysis_plugin-0.1.1/PKG-INFO +10 -0
- stock_analysis_plugin-0.1.1/README.md +452 -0
- stock_analysis_plugin-0.1.1/docs/hermes-integration.en.md +304 -0
- stock_analysis_plugin-0.1.1/docs/hermes-integration.md +304 -0
- stock_analysis_plugin-0.1.1/docs/pi-integration.en.md +269 -0
- stock_analysis_plugin-0.1.1/docs/pi-integration.md +269 -0
- stock_analysis_plugin-0.1.1/hermes/__init__.py +57 -0
- stock_analysis_plugin-0.1.1/hermes/plugin.yaml +84 -0
- stock_analysis_plugin-0.1.1/hermes/schemas.py +573 -0
- stock_analysis_plugin-0.1.1/hermes/tools.py +229 -0
- stock_analysis_plugin-0.1.1/package-lock.json +579 -0
- stock_analysis_plugin-0.1.1/package.json +64 -0
- stock_analysis_plugin-0.1.1/pi/index.ts +872 -0
- stock_analysis_plugin-0.1.1/pyproject.toml +26 -0
- stock_analysis_plugin-0.1.1/requirements-dev.txt +3 -0
- stock_analysis_plugin-0.1.1/ruff.toml +6 -0
- stock_analysis_plugin-0.1.1/schemas/report_schema.json +131 -0
- stock_analysis_plugin-0.1.1/scripts/setup-python.mjs +52 -0
- stock_analysis_plugin-0.1.1/skills/bottom-volume/SKILL.md +63 -0
- stock_analysis_plugin-0.1.1/skills/bottom-volume/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/box-oscillation/SKILL.md +72 -0
- stock_analysis_plugin-0.1.1/skills/box-oscillation/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/bull-trend/SKILL.md +60 -0
- stock_analysis_plugin-0.1.1/skills/bull-trend/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/chan-theory/SKILL.md +71 -0
- stock_analysis_plugin-0.1.1/skills/chan-theory/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/dragon-head/SKILL.md +69 -0
- stock_analysis_plugin-0.1.1/skills/dragon-head/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/emotion-cycle/SKILL.md +65 -0
- stock_analysis_plugin-0.1.1/skills/emotion-cycle/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/event-driven/SKILL.md +73 -0
- stock_analysis_plugin-0.1.1/skills/event-driven/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/expectation-repricing/SKILL.md +72 -0
- stock_analysis_plugin-0.1.1/skills/expectation-repricing/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/growth-quality/SKILL.md +74 -0
- stock_analysis_plugin-0.1.1/skills/growth-quality/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/hot-theme/SKILL.md +74 -0
- stock_analysis_plugin-0.1.1/skills/hot-theme/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/ma-crossover/SKILL.md +63 -0
- stock_analysis_plugin-0.1.1/skills/ma-crossover/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/market-review/SKILL.md +70 -0
- stock_analysis_plugin-0.1.1/skills/market-review/scripts/gather.py +16 -0
- stock_analysis_plugin-0.1.1/skills/one-yang-three-yin/SKILL.md +74 -0
- stock_analysis_plugin-0.1.1/skills/one-yang-three-yin/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/shrink-pullback/SKILL.md +59 -0
- stock_analysis_plugin-0.1.1/skills/shrink-pullback/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/stock-analysis/SKILL.md +134 -0
- stock_analysis_plugin-0.1.1/skills/stock-analysis/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/stock-screener/SKILL.md +68 -0
- stock_analysis_plugin-0.1.1/skills/stock-screener/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/strategy-backtest/SKILL.md +129 -0
- stock_analysis_plugin-0.1.1/skills/strategy-backtest/scripts/gather.py +16 -0
- stock_analysis_plugin-0.1.1/skills/volume-breakout/SKILL.md +58 -0
- stock_analysis_plugin-0.1.1/skills/volume-breakout/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/wave-theory/SKILL.md +67 -0
- stock_analysis_plugin-0.1.1/skills/wave-theory/scripts/gather.py +15 -0
- stock_analysis_plugin-0.1.1/skills/wisburg-research/SKILL.md +119 -0
- stock_analysis_plugin-0.1.1/strategies/examples/bottom_volume.yaml +47 -0
- stock_analysis_plugin-0.1.1/strategies/examples/box_oscillation.yaml +41 -0
- stock_analysis_plugin-0.1.1/strategies/examples/bull_trend.yaml +42 -0
- stock_analysis_plugin-0.1.1/strategies/examples/dragon_head.yaml +45 -0
- stock_analysis_plugin-0.1.1/strategies/examples/emotion_cycle.yaml +43 -0
- stock_analysis_plugin-0.1.1/strategies/examples/ma_crossover.yaml +34 -0
- stock_analysis_plugin-0.1.1/strategies/examples/rsi_oversold.yaml +35 -0
- stock_analysis_plugin-0.1.1/strategies/examples/shrink_pullback.yaml +45 -0
- stock_analysis_plugin-0.1.1/strategies/examples/volume_breakout.yaml +42 -0
- stock_analysis_plugin-0.1.1/tests/__init__.py +0 -0
- stock_analysis_plugin-0.1.1/tests/conftest.py +97 -0
- stock_analysis_plugin-0.1.1/tests/test_anomaly_detect.py +525 -0
- stock_analysis_plugin-0.1.1/tests/test_backtest.py +181 -0
- stock_analysis_plugin-0.1.1/tests/test_gather.py +300 -0
- stock_analysis_plugin-0.1.1/tests/test_hermes_integration.py +114 -0
- stock_analysis_plugin-0.1.1/tests/test_market_regime.py +82 -0
- stock_analysis_plugin-0.1.1/tests/test_market_review.py +115 -0
- stock_analysis_plugin-0.1.1/tests/test_pattern.py +207 -0
- stock_analysis_plugin-0.1.1/tests/test_pi_integration.ts +167 -0
- stock_analysis_plugin-0.1.1/tests/test_risk_screening.py +76 -0
- stock_analysis_plugin-0.1.1/tests/test_screener.py +85 -0
- stock_analysis_plugin-0.1.1/tests/test_sentiment.py +191 -0
- stock_analysis_plugin-0.1.1/tests/test_stock_data.py +104 -0
- stock_analysis_plugin-0.1.1/tests/test_stock_data_failover.py +872 -0
- stock_analysis_plugin-0.1.1/tests/test_technical.py +261 -0
- stock_analysis_plugin-0.1.1/tests/test_trading_calendar.py +20 -0
- stock_analysis_plugin-0.1.1/tests/test_watchlist.py +109 -0
- stock_analysis_plugin-0.1.1/tools/__init__.py +0 -0
- stock_analysis_plugin-0.1.1/tools/anomaly_detect.py +570 -0
- stock_analysis_plugin-0.1.1/tools/backtest.py +643 -0
- stock_analysis_plugin-0.1.1/tools/gather.py +152 -0
- stock_analysis_plugin-0.1.1/tools/market_regime.py +247 -0
- stock_analysis_plugin-0.1.1/tools/market_review.py +150 -0
- stock_analysis_plugin-0.1.1/tools/name_resolver.py +131 -0
- stock_analysis_plugin-0.1.1/tools/pattern.py +509 -0
- stock_analysis_plugin-0.1.1/tools/requirements.txt +13 -0
- stock_analysis_plugin-0.1.1/tools/risk_screening.py +318 -0
- stock_analysis_plugin-0.1.1/tools/screener.py +213 -0
- stock_analysis_plugin-0.1.1/tools/search_intel.py +455 -0
- stock_analysis_plugin-0.1.1/tools/stock_data.py +1649 -0
- stock_analysis_plugin-0.1.1/tools/technical.py +636 -0
- stock_analysis_plugin-0.1.1/tools/trading_calendar.py +198 -0
- stock_analysis_plugin-0.1.1/tools/volume_analysis.py +172 -0
- stock_analysis_plugin-0.1.1/tools/watchlist.py +61 -0
- stock_analysis_plugin-0.1.1/tsconfig.json +14 -0
- stock_analysis_plugin-0.1.1/typings/pi-agent/index.d.ts +20 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.11"
|
|
18
|
+
|
|
19
|
+
- name: Install Python lint tools
|
|
20
|
+
run: pip install ruff>=0.4.0
|
|
21
|
+
|
|
22
|
+
- name: Ruff check
|
|
23
|
+
run: ruff check tools/ skills/ tests/ hermes/
|
|
24
|
+
|
|
25
|
+
- name: Ruff format check
|
|
26
|
+
run: ruff format --check tools/ skills/ tests/ hermes/
|
|
27
|
+
|
|
28
|
+
- uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: "20"
|
|
31
|
+
|
|
32
|
+
- name: Install Node dependencies
|
|
33
|
+
run: npm install
|
|
34
|
+
|
|
35
|
+
- name: TypeScript type check
|
|
36
|
+
run: npx tsc --noEmit
|
|
37
|
+
|
|
38
|
+
test:
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: "3.11"
|
|
46
|
+
cache: pip
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: |
|
|
50
|
+
pip install -r tools/requirements.txt
|
|
51
|
+
pip install -r requirements-dev.txt
|
|
52
|
+
|
|
53
|
+
- name: Run tests
|
|
54
|
+
run: pytest --cov=tools --cov-report=term-missing
|
|
55
|
+
|
|
56
|
+
integration:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
|
|
61
|
+
- uses: actions/setup-python@v5
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.11"
|
|
64
|
+
cache: pip
|
|
65
|
+
|
|
66
|
+
- uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: "20"
|
|
69
|
+
|
|
70
|
+
- name: Install Python dependencies
|
|
71
|
+
run: |
|
|
72
|
+
pip install -r tools/requirements.txt
|
|
73
|
+
pip install -r requirements-dev.txt
|
|
74
|
+
|
|
75
|
+
- name: Install Node dependencies
|
|
76
|
+
run: npm install
|
|
77
|
+
|
|
78
|
+
- name: Test Hermes plugin registration
|
|
79
|
+
run: pytest tests/test_hermes_integration.py -v
|
|
80
|
+
|
|
81
|
+
- name: Test Pi extension registration
|
|
82
|
+
run: npx tsx tests/test_pi_integration.ts
|
|
83
|
+
|
|
84
|
+
build:
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
needs: [lint, test, integration]
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
|
|
90
|
+
- uses: actions/setup-node@v4
|
|
91
|
+
with:
|
|
92
|
+
node-version: "20"
|
|
93
|
+
|
|
94
|
+
- name: Install Node dependencies
|
|
95
|
+
run: npm install
|
|
96
|
+
|
|
97
|
+
- name: Verify pack contents
|
|
98
|
+
run: npm pack --dry-run
|
|
99
|
+
|
|
100
|
+
- name: Build package
|
|
101
|
+
run: npm pack
|
|
102
|
+
|
|
103
|
+
- uses: actions/upload-artifact@v4
|
|
104
|
+
with:
|
|
105
|
+
name: package-tarball
|
|
106
|
+
path: "*.tgz"
|
|
107
|
+
retention-days: 7
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.11"
|
|
17
|
+
|
|
18
|
+
- name: Install Python lint tools
|
|
19
|
+
run: pip install ruff>=0.4.0
|
|
20
|
+
|
|
21
|
+
- name: Ruff check
|
|
22
|
+
run: ruff check tools/ skills/ tests/ hermes/
|
|
23
|
+
|
|
24
|
+
- name: Ruff format check
|
|
25
|
+
run: ruff format --check tools/ skills/ tests/ hermes/
|
|
26
|
+
|
|
27
|
+
- uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: "20"
|
|
30
|
+
|
|
31
|
+
- name: Install Node dependencies
|
|
32
|
+
run: npm install
|
|
33
|
+
|
|
34
|
+
- name: TypeScript type check
|
|
35
|
+
run: npx tsc --noEmit
|
|
36
|
+
|
|
37
|
+
test:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- uses: actions/setup-python@v5
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.11"
|
|
45
|
+
cache: pip
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: |
|
|
49
|
+
pip install -r tools/requirements.txt
|
|
50
|
+
pip install -r requirements-dev.txt
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
run: pytest --cov=tools --cov-report=term-missing
|
|
54
|
+
|
|
55
|
+
- uses: actions/setup-node@v4
|
|
56
|
+
with:
|
|
57
|
+
node-version: "20"
|
|
58
|
+
|
|
59
|
+
- name: Install Node dependencies
|
|
60
|
+
run: npm install
|
|
61
|
+
|
|
62
|
+
- name: Test Pi extension registration
|
|
63
|
+
run: npx tsx tests/test_pi_integration.ts
|
|
64
|
+
|
|
65
|
+
publish-npm:
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
needs: [lint, test]
|
|
68
|
+
permissions:
|
|
69
|
+
contents: write
|
|
70
|
+
id-token: write
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v4
|
|
73
|
+
with:
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
|
|
76
|
+
- uses: actions/setup-node@v4
|
|
77
|
+
with:
|
|
78
|
+
node-version: "20"
|
|
79
|
+
registry-url: "https://registry.npmjs.org"
|
|
80
|
+
|
|
81
|
+
- name: Install dependencies
|
|
82
|
+
run: npm install
|
|
83
|
+
|
|
84
|
+
- name: Build and verify
|
|
85
|
+
run: npm pack --dry-run
|
|
86
|
+
|
|
87
|
+
- name: Publish to npm
|
|
88
|
+
run: npm publish --access public --provenance
|
|
89
|
+
env:
|
|
90
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
91
|
+
|
|
92
|
+
publish-pypi:
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
needs: [lint, test]
|
|
95
|
+
permissions:
|
|
96
|
+
id-token: write
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
|
|
100
|
+
- uses: actions/setup-python@v5
|
|
101
|
+
with:
|
|
102
|
+
python-version: "3.11"
|
|
103
|
+
|
|
104
|
+
- name: Install build tools
|
|
105
|
+
run: pip install build
|
|
106
|
+
|
|
107
|
+
- name: Build package
|
|
108
|
+
run: python -m build
|
|
109
|
+
|
|
110
|
+
- name: Publish to PyPI
|
|
111
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
112
|
+
with:
|
|
113
|
+
password: ${{ secrets.PYPI_TOKEN }}
|
|
114
|
+
|
|
115
|
+
github-release:
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
needs: [publish-npm, publish-pypi]
|
|
118
|
+
permissions:
|
|
119
|
+
contents: write
|
|
120
|
+
steps:
|
|
121
|
+
- uses: actions/checkout@v4
|
|
122
|
+
with:
|
|
123
|
+
fetch-depth: 0
|
|
124
|
+
|
|
125
|
+
- name: Generate release notes
|
|
126
|
+
run: |
|
|
127
|
+
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
|
|
128
|
+
if [ -z "$PREV_TAG" ]; then
|
|
129
|
+
LOG=$(git log --pretty=format:"- %s" HEAD)
|
|
130
|
+
else
|
|
131
|
+
LOG=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD)
|
|
132
|
+
fi
|
|
133
|
+
echo "## What's Changed" > release_notes.md
|
|
134
|
+
echo "" >> release_notes.md
|
|
135
|
+
echo "$LOG" >> release_notes.md
|
|
136
|
+
echo "" >> release_notes.md
|
|
137
|
+
echo "---" >> release_notes.md
|
|
138
|
+
echo "**npm**: \`npm install @weaxs/stock-analysis-plugin@${GITHUB_REF_NAME#v}\`" >> release_notes.md
|
|
139
|
+
echo "**pip**: \`pip install stock-analysis-plugin==${GITHUB_REF_NAME#v}\`" >> release_notes.md
|
|
140
|
+
|
|
141
|
+
- name: Create GitHub Release
|
|
142
|
+
run: gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes-file release_notes.md
|
|
143
|
+
env:
|
|
144
|
+
GH_TOKEN: ${{ github.token }}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
.venv/
|
|
7
|
+
venv/
|
|
8
|
+
env/
|
|
9
|
+
|
|
10
|
+
# Node
|
|
11
|
+
node_modules/
|
|
12
|
+
|
|
13
|
+
# IDE
|
|
14
|
+
.idea/
|
|
15
|
+
.vscode/
|
|
16
|
+
*.swp
|
|
17
|
+
*.swo
|
|
18
|
+
*~
|
|
19
|
+
.DS_Store
|
|
20
|
+
|
|
21
|
+
# Data
|
|
22
|
+
*.csv
|
|
23
|
+
*.xlsx
|
|
24
|
+
*.json
|
|
25
|
+
!package.json
|
|
26
|
+
!package-lock.json
|
|
27
|
+
!tsconfig.json
|
|
28
|
+
!schemas/**/*.json
|
|
29
|
+
!strategies/**/*.yaml
|
|
30
|
+
|
|
31
|
+
# Env
|
|
32
|
+
.env
|
|
33
|
+
.env.local
|
|
34
|
+
|
|
35
|
+
# Test / Lint artifacts
|
|
36
|
+
.coverage
|
|
37
|
+
coverage.xml
|
|
38
|
+
.pytest_cache/
|
|
39
|
+
.ruff_cache/
|
|
40
|
+
|
|
41
|
+
# Build artifacts
|
|
42
|
+
*.tgz
|
|
43
|
+
|
|
44
|
+
# MCP config (contains API keys)
|
|
45
|
+
.mcp.json
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.git/
|
|
2
|
+
.venv/
|
|
3
|
+
.mcp.json
|
|
4
|
+
.env
|
|
5
|
+
.env.local
|
|
6
|
+
.idea/
|
|
7
|
+
.vscode/
|
|
8
|
+
__pycache__/
|
|
9
|
+
**/__pycache__/
|
|
10
|
+
*.pyc
|
|
11
|
+
*.py[cod]
|
|
12
|
+
node_modules/
|
|
13
|
+
.DS_Store
|
|
14
|
+
*.swp
|
|
15
|
+
*.swo
|
|
16
|
+
*~
|
|
17
|
+
*.csv
|
|
18
|
+
*.xlsx
|
|
19
|
+
hermes/
|
|
20
|
+
tests/
|
|
21
|
+
.coverage
|
|
22
|
+
.github/
|
|
23
|
+
requirements-dev.txt
|
|
24
|
+
pyproject.toml
|
|
25
|
+
ruff.toml
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stock-analysis-plugin
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Hermes plugin for stock analysis, screening, and strategy backtesting across A/HK/US markets
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: akshare>=1.12.0
|
|
8
|
+
Requires-Dist: numpy>=1.24.0
|
|
9
|
+
Requires-Dist: pandas>=2.0.0
|
|
10
|
+
Requires-Dist: requests>=2.28.0
|