tradingagents-lightweight 0.1.0__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.
Files changed (50) hide show
  1. tradingagents_lightweight-0.1.0/.dockerignore +14 -0
  2. tradingagents_lightweight-0.1.0/.env.example +27 -0
  3. tradingagents_lightweight-0.1.0/.github/CODE_OF_CONDUCT.md +23 -0
  4. tradingagents_lightweight-0.1.0/.github/CONTRIBUTING.md +38 -0
  5. tradingagents_lightweight-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +21 -0
  6. tradingagents_lightweight-0.1.0/.github/ISSUE_TEMPLATE/config.yml +2 -0
  7. tradingagents_lightweight-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
  8. tradingagents_lightweight-0.1.0/.github/SECURITY.md +9 -0
  9. tradingagents_lightweight-0.1.0/.github/dependabot.yml +14 -0
  10. tradingagents_lightweight-0.1.0/.github/pull_request_template.md +13 -0
  11. tradingagents_lightweight-0.1.0/.github/workflows/ci.yml +74 -0
  12. tradingagents_lightweight-0.1.0/.github/workflows/release.yml +194 -0
  13. tradingagents_lightweight-0.1.0/.gitignore +17 -0
  14. tradingagents_lightweight-0.1.0/CHANGELOG.md +14 -0
  15. tradingagents_lightweight-0.1.0/CHANGELOG_zh.md +14 -0
  16. tradingagents_lightweight-0.1.0/Dockerfile +17 -0
  17. tradingagents_lightweight-0.1.0/LICENSE +21 -0
  18. tradingagents_lightweight-0.1.0/PKG-INFO +343 -0
  19. tradingagents_lightweight-0.1.0/README.md +302 -0
  20. tradingagents_lightweight-0.1.0/README.zh-CN.md +269 -0
  21. tradingagents_lightweight-0.1.0/examples/run_analyze.py +14 -0
  22. tradingagents_lightweight-0.1.0/examples/run_backtest.py +15 -0
  23. tradingagents_lightweight-0.1.0/pyproject.toml +86 -0
  24. tradingagents_lightweight-0.1.0/requirements.txt +10 -0
  25. tradingagents_lightweight-0.1.0/results/.gitkeep +0 -0
  26. tradingagents_lightweight-0.1.0/scripts/release_notes.py +100 -0
  27. tradingagents_lightweight-0.1.0/talite/__init__.py +21 -0
  28. tradingagents_lightweight-0.1.0/talite/__main__.py +3 -0
  29. tradingagents_lightweight-0.1.0/talite/agent.py +112 -0
  30. tradingagents_lightweight-0.1.0/talite/backtest.py +223 -0
  31. tradingagents_lightweight-0.1.0/talite/cli.py +159 -0
  32. tradingagents_lightweight-0.1.0/talite/config.py +44 -0
  33. tradingagents_lightweight-0.1.0/talite/data.py +58 -0
  34. tradingagents_lightweight-0.1.0/talite/execution.py +108 -0
  35. tradingagents_lightweight-0.1.0/talite/indicators.py +42 -0
  36. tradingagents_lightweight-0.1.0/talite/llm.py +92 -0
  37. tradingagents_lightweight-0.1.0/talite/news.py +69 -0
  38. tradingagents_lightweight-0.1.0/talite/prompts.py +38 -0
  39. tradingagents_lightweight-0.1.0/talite/screener.py +82 -0
  40. tradingagents_lightweight-0.1.0/talite/sentiment.py +42 -0
  41. tradingagents_lightweight-0.1.0/talite/strategy.py +134 -0
  42. tradingagents_lightweight-0.1.0/tests/test_cli.py +27 -0
  43. tradingagents_lightweight-0.1.0/tests/test_execution.py +33 -0
  44. tradingagents_lightweight-0.1.0/tests/test_git_hook.py +95 -0
  45. tradingagents_lightweight-0.1.0/tests/test_indicators.py +33 -0
  46. tradingagents_lightweight-0.1.0/tests/test_privacy_check.py +31 -0
  47. tradingagents_lightweight-0.1.0/tests/test_strategy.py +28 -0
  48. tradingagents_lightweight-0.1.0/tests/test_version.py +88 -0
  49. tradingagents_lightweight-0.1.0/tools/install_git_hook.sh +29 -0
  50. tradingagents_lightweight-0.1.0/tools/privacy_check.py +158 -0
@@ -0,0 +1,14 @@
1
+ .git
2
+ .gitignore
3
+ __pycache__/
4
+ *.pyc
5
+ *.egg-info/
6
+ .venv/
7
+ venv/
8
+ env/
9
+ .env
10
+ .DS_Store
11
+ .idea/
12
+ .vscode/
13
+ results/*
14
+ !results/.gitkeep
@@ -0,0 +1,27 @@
1
+ # Copy to .env and fill in only what you use. The tool runs with no keys at all
2
+ # (rule engine). Keys are only needed to turn the LLM decision layer on.
3
+
4
+ # Which model to use. Recommended for cost: gpt-4.1-mini (or gpt-4.1-nano).
5
+ LLM_PROVIDER=openai
6
+ LLM_MODEL=gpt-4.1-mini
7
+
8
+ # API keys - set the one(s) for the provider you picked.
9
+ OPENAI_API_KEY=
10
+ ANTHROPIC_API_KEY=
11
+ DEEPSEEK_API_KEY=
12
+ GEMINI_API_KEY=
13
+
14
+ # News source: sec (free 8-K filings, default) | benzinga (paid, real-time) | rss (your own feed)
15
+ NEWS_SOURCE=sec
16
+ # rss source only - point at any market-news RSS feed:
17
+ # RSS_FEED_URL=
18
+
19
+ # Paid news feed for an earlier edge (optional).
20
+ BENZINGA_API_KEY=
21
+ # SEC EDGAR wants a descriptive User-Agent (your name/email).
22
+ SEC_USER_AGENT=tradingagents-lightweight you@example.com
23
+
24
+ # Trade construction.
25
+ RISK_REWARD=2.0
26
+ ATR_MULT=2.0
27
+ RISK_PER_TRADE=0.01
@@ -0,0 +1,23 @@
1
+ # Code of conduct / 行为准则
2
+
3
+ This project follows the [Contributor Covenant 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). In short:
4
+
5
+ - Be respectful and assume good intent. Critique code and ideas, not people.
6
+ - No harassment, insults, discrimination, sexual language or imagery, or personal attacks, in public or in private.
7
+ - Do not publish other people's private information (names behind accounts, addresses, account numbers, API keys).
8
+ - No advertising or self-promotion in issues and discussions.
9
+
10
+ It applies in issues, pull requests, discussions and any other space of the project, and when you represent the project elsewhere.
11
+
12
+ **Reporting.** Tell the maintainers privately: open the repository's Security tab and choose "Report a vulnerability" (only maintainers can read it; start the title with "Conduct"), or use GitHub's "Report content" on the comment or issue. Reports are handled confidentially. Maintainers may edit or remove content, and warn, suspend or ban anyone who breaks these rules.
13
+
14
+ 本项目遵循 [Contributor Covenant 2.1](https://www.contributor-covenant.org/zh-cn/version/2/1/code_of_conduct/)。简单说:
15
+
16
+ - 互相尊重,先假定对方是善意的。讨论代码和想法,不针对人。
17
+ - 不骚扰、不辱骂、不歧视,不发表性暗示的言语或图片,不做人身攻击,公开和私下都一样。
18
+ - 不公开别人的隐私信息(账号背后的真名、住址、账户号、API key)。
19
+ - 不在 issue 和讨论区打广告或自我推销。
20
+
21
+ 这些规则适用于 issue、PR、讨论区和项目的其他所有地方,也适用于你在别处代表本项目的时候。
22
+
23
+ **举报。** 请私下告诉维护者:打开仓库的 Security 标签页,选择「Report a vulnerability」(只有维护者能看到,标题请以 "Conduct" 开头),或者在相关评论、issue 上使用 GitHub 的「Report content」。举报会保密处理。维护者可以修改或删除相关内容,并对违反规则的人给予警告、暂停或禁止参与。
@@ -0,0 +1,38 @@
1
+ # Contributing / 参与贡献
2
+
3
+ Thanks for helping. Bug reports, fixes, features, docs and translations are all welcome.
4
+ 感谢参与!问题反馈、修复、新功能、文档和翻译都非常欢迎。
5
+
6
+ Please follow the [code of conduct](CODE_OF_CONDUCT.md). 参与时请遵守[行为准则](CODE_OF_CONDUCT.md)。
7
+
8
+ ## Setup / 开发环境
9
+
10
+ ```bash
11
+ git clone https://github.com/jackson-cmd/tradingagents-lightweight
12
+ cd tradingagents-lightweight
13
+ python -m venv .venv && source .venv/bin/activate
14
+ pip install -e ".[dev]"
15
+ tools/install_git_hook.sh # privacy check before every commit / 每次提交前自动做隐私检查
16
+ pytest
17
+ ruff check .
18
+ ```
19
+
20
+ ## Ground rules / 基本原则
21
+
22
+ - Tests run offline. Mock network calls; mark anything that needs the internet with `@pytest.mark.network`.
23
+ 测试必须能离线运行。网络请求用 mock,需要联网的测试加 `@pytest.mark.network`。
24
+ - No secrets, account numbers, personal data or local paths in code, tests, logs or screenshots. The pre-commit hook checks.
25
+ 代码、测试、日志和截图里不能出现密钥、账户号、个人信息或本机路径,提交钩子会检查。
26
+ - Keep user-facing text in both languages: README.md / README.zh-CN.md and CHANGELOG.md / CHANGELOG_zh.md.
27
+ 面向用户的文字请同时更新中英文:两份 README(README.md、README.zh-CN.md)和两份更新记录(CHANGELOG.md、CHANGELOG_zh.md)。
28
+ - One change per pull request; open an issue first for anything users will notice.
29
+ 一个 PR 只做一件事;用户能感觉到的改动请先开 issue。
30
+
31
+ ## Releasing / 发布新版本
32
+
33
+ 1. In the pull request, raise the version (`pyproject.toml` and `talite/__init__.py`), add its section at the top of `CHANGELOG.md` and the Chinese changelog, and, if the READMEs use a static version badge, update it in both. `tests/test_version.py` fails if any of them disagree.
34
+ 在 PR 里提高版本号(`pyproject.toml` 和 `talite/__init__.py`),在两份更新记录最上面加上这一版的说明,两份 README 如果用的是静态版本徽章,也要一起改;有一处对不上,`tests/test_version.py` 就会失败。
35
+ 2. Merge it. When CI passes on main, `.github/workflows/release.yml` drafts the release with that changelog section, attaches the wheel and the source archive, pushes the Docker image `ghcr.io/jackson-cmd/tradingagents-lightweight` (`X.Y.Z`, `X.Y`, `latest`), publishes the release and uploads to PyPI. Nothing else to do.
36
+ 合并即可。main 上的 CI 通过后,`.github/workflows/release.yml` 会用那一节更新说明建草稿、附上 wheel 和源码包、推送 Docker 镜像 `ghcr.io/jackson-cmd/tradingagents-lightweight`(`X.Y.Z`、`X.Y`、`latest`),然后正式发布并上传 PyPI,不用手动操作。
37
+ 3. PyPI trusts this workflow (trusted publisher: workflow `release.yml`, environment `pypi`) while the repository variable `PYPI_PUBLISH` is `true`. A version number can go to PyPI only once. To publish an existing release again: `gh workflow run release.yml -f tag=vX.Y.Z` (add `-f rebuild_image=true` to push its image again).
38
+ 仓库变量 `PYPI_PUBLISH` 为 `true` 时,PyPI 信任这个工作流(可信发布者:工作流 `release.yml`,环境 `pypi`)。同一个版本号只能传一次 PyPI。要重新发布已有的版本:`gh workflow run release.yml -f tag=vX.Y.Z`(加 `-f rebuild_image=true` 会重新推送镜像)。
@@ -0,0 +1,21 @@
1
+ name: Bug report / 问题反馈
2
+ description: Something does not work as described / 功能和描述不一致
3
+ labels: [bug]
4
+ body:
5
+ - type: textarea
6
+ id: what
7
+ attributes:
8
+ label: What happened? / 发生了什么?
9
+ description: The command or steps, what you expected, what you got. Remove API keys, tokens and account numbers. / 运行的命令或步骤、预期结果、实际结果。请删掉 API key、token 和账户号。
10
+ validations:
11
+ required: true
12
+ - type: input
13
+ id: version
14
+ attributes:
15
+ label: Version / 版本
16
+ description: Output of `talite --version` and `python --version` / `talite --version` 和 `python --version` 的输出
17
+ - type: dropdown
18
+ id: os
19
+ attributes:
20
+ label: Operating system / 操作系统
21
+ options: [macOS, Linux, Windows, Docker, Codespaces, other / 其他]
@@ -0,0 +1,2 @@
1
+ blank_issues_enabled: true
2
+ # Do not add a security link: with private vulnerability reporting on, GitHub shows "Report a security vulnerability" itself.
@@ -0,0 +1,14 @@
1
+ name: Feature request / 功能需求
2
+ description: Suggest a feature, a data source, an integration or better docs / 建议新功能、数据源、集成或改进文档
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: idea
7
+ attributes:
8
+ label: What would you like? / 你希望增加什么?
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: why
13
+ attributes:
14
+ label: What would it let you do? / 有了它你能做什么?
@@ -0,0 +1,9 @@
1
+ # Security
2
+
3
+ Please report vulnerabilities privately through GitHub's "Report a vulnerability" button (Security tab), not in a public issue. Include the steps to reproduce and the version (`talite --version`). You will get an answer within a few days.
4
+
5
+ What matters most: anything that leaks API keys or personal data, runs code or commands that the user did not ask for, or lets text from outside (web pages, files, model output) change what the program does.
6
+
7
+ 请通过 GitHub 的 "Report a vulnerability"(Security 标签页)私下报告安全问题,不要发公开 issue,并附上复现步骤和版本号(`talite --version`)。几天之内会有回复。
8
+
9
+ 最重要的问题包括:泄露 API key 或个人信息、执行用户没要求的代码或命令、让外部文本(网页、文件、模型输出)改变程序的行为。
@@ -0,0 +1,14 @@
1
+ # Keeps the GitHub Actions in .github/workflows on their current major versions, in one pull request at most once a
2
+ # month. Vulnerable Python packages are handled separately by Dependabot security updates, which open a pull request
3
+ # as soon as an advisory appears.
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: github-actions
7
+ directory: /
8
+ schedule:
9
+ interval: monthly
10
+ groups:
11
+ actions:
12
+ patterns: ["*"]
13
+ commit-message:
14
+ prefix: "CI"
@@ -0,0 +1,13 @@
1
+ Closes #
2
+
3
+ **What this changes · 改了什么**
4
+
5
+
6
+ **How you tested it · 怎么测的**
7
+ - [ ] `python -m pytest` passes · 测试通过
8
+ - [ ] Tried the change for real (command, page or API) · 实际运行过改动(命令、页面或接口)
9
+
10
+ **Checklist · 检查**
11
+ - [ ] No credentials, account numbers, personal data or local paths · 没有凭证、账户号、个人信息和本机路径
12
+ - [ ] User-facing text updated in English and Chinese · 面向用户的文字中英文都改了
13
+ - [ ] If users will notice it: version raised and both changelogs updated; the merge publishes the release · 用户能感觉到的改动:提高了版本号,两份更新记录都写了,合并后自动发版
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # Cancel a superseded run only on pull requests: on main every run must finish, because the release workflow
12
+ # waits for CI to succeed on the merge commit and a cancelled run would skip that version.
13
+ concurrency:
14
+ group: ci-${{ github.ref }}
15
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
16
+
17
+ jobs:
18
+ test:
19
+ runs-on: ${{ matrix.os }}
20
+ timeout-minutes: 30
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ os: [ubuntu-latest, macos-latest, windows-latest]
25
+ python-version: ["3.10", "3.12", "3.13"]
26
+ exclude:
27
+ - os: macos-latest
28
+ python-version: "3.10"
29
+ - os: windows-latest
30
+ python-version: "3.10"
31
+ steps:
32
+ - uses: actions/checkout@v7
33
+ - uses: actions/setup-python@v7
34
+ with:
35
+ python-version: ${{ matrix.python-version }}
36
+ cache: pip
37
+ - name: Install
38
+ run: python -m pip install -e ".[dev]"
39
+ - name: Lint
40
+ run: ruff check .
41
+ - name: Test (offline)
42
+ run: pytest
43
+
44
+ package:
45
+ # Build the wheel and start it from a clean install, the way PyPI users get it.
46
+ runs-on: ubuntu-latest
47
+ timeout-minutes: 15
48
+ steps:
49
+ - uses: actions/checkout@v7
50
+ - uses: actions/setup-python@v7
51
+ with:
52
+ python-version: "3.12"
53
+ - name: Build and check
54
+ run: |
55
+ python -m pip install --upgrade build twine
56
+ python -m build
57
+ python -m twine check --strict dist/*
58
+ - name: Install the wheel into a fresh venv and start it
59
+ run: |
60
+ python -m venv "$RUNNER_TEMP/venv"
61
+ "$RUNNER_TEMP/venv/bin/pip" install dist/*.whl
62
+ "$RUNNER_TEMP/venv/bin/talite" --version
63
+ "$RUNNER_TEMP/venv/bin/tradingagents-lightweight" --help
64
+
65
+ image:
66
+ # The release pushes this image; building it on every pull request shows a broken Dockerfile here first.
67
+ runs-on: ubuntu-latest
68
+ timeout-minutes: 20
69
+ steps:
70
+ - uses: actions/checkout@v7
71
+ - name: Build the image and start it
72
+ run: |
73
+ docker build -t talite-check .
74
+ docker run --rm talite-check --version
@@ -0,0 +1,194 @@
1
+ name: Release
2
+
3
+ # When CI passes on main and pyproject.toml carries a version that has no tag yet, this drafts a GitHub release whose
4
+ # notes are the version's section of CHANGELOG.md, attaches the wheel and the source archive, pushes the Docker image to
5
+ # ghcr.io, and only then publishes the release, which tags the commit vX.Y.Z. Once the repository variable PYPI_PUBLISH
6
+ # is "true", the files also go to PyPI. A version bump in a merged PR is all it takes; pushes that keep the version do
7
+ # nothing. If a job fails, the release stays a draft: re-run the failed jobs. Run the workflow by hand with the tag of a
8
+ # published release to build its files again and upload them to PyPI, for example after setting
9
+ # PyPI up, and with rebuild_image to push its Docker image again; the release itself is not changed.
10
+
11
+ on:
12
+ workflow_run:
13
+ workflows: [CI]
14
+ types: [completed]
15
+ branches: [main]
16
+ workflow_dispatch:
17
+ inputs:
18
+ tag:
19
+ description: "Tag of a published release to publish again, e.g. v1.2.3 (leave empty to release the version in pyproject.toml; only from main)"
20
+ required: false
21
+ default: ""
22
+ rebuild_image:
23
+ description: "With a tag: build and push its Docker image again"
24
+ type: boolean
25
+ default: false
26
+
27
+ permissions:
28
+ contents: read
29
+
30
+ concurrency:
31
+ group: release
32
+ cancel-in-progress: false
33
+
34
+ jobs:
35
+ release:
36
+ if: >-
37
+ github.event_name == 'workflow_dispatch' ||
38
+ (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' &&
39
+ github.event.workflow_run.head_repository.full_name == github.repository)
40
+ runs-on: ubuntu-latest
41
+ timeout-minutes: 5
42
+ permissions:
43
+ contents: write
44
+ outputs:
45
+ tag: ${{ steps.release.outputs.tag }}
46
+ sha: ${{ steps.release.outputs.sha }}
47
+ draft: ${{ steps.release.outputs.draft }}
48
+ latest: ${{ steps.release.outputs.latest }}
49
+ env:
50
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
+ INPUT_TAG: ${{ inputs.tag }}
52
+ steps:
53
+ - uses: actions/checkout@v7
54
+ with:
55
+ ref: ${{ inputs.tag || github.event.workflow_run.head_sha || github.sha }}
56
+ - id: release
57
+ name: Draft the release
58
+ run: |
59
+ sha=$(git rev-parse HEAD)
60
+ if [ -n "$INPUT_TAG" ]; then
61
+ if [ "$(gh release view "$INPUT_TAG" --json isDraft --jq .isDraft)" != false ]; then
62
+ echo "$INPUT_TAG is not a published release"; exit 1
63
+ fi
64
+ newest=$(gh release view --json tagName --jq .tagName)
65
+ echo "building $INPUT_TAG again" | tee -a "$GITHUB_STEP_SUMMARY"
66
+ { echo "tag=$INPUT_TAG"; echo "sha=$sha"; echo "draft=false"
67
+ echo "latest=$([ "$newest" = "$INPUT_TAG" ] && echo true || echo false)"; } >> "$GITHUB_OUTPUT"
68
+ exit 0
69
+ fi
70
+ if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ] && [ "$GITHUB_REF" != refs/heads/main ]; then
71
+ echo "Run it from main, or give the tag of a published release."; exit 1
72
+ fi
73
+ version=$(python3 scripts/release_notes.py --version)
74
+ tag="v$version"
75
+ if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then
76
+ echo "$tag already exists: nothing to release"
77
+ exit 0
78
+ fi
79
+ python3 scripts/release_notes.py "$version" > notes.md
80
+ if [ "$(gh release view "$tag" --json isDraft --jq .isDraft 2>/dev/null)" = true ]; then
81
+ gh release edit "$tag" --target "$sha" --title "$tag" --notes-file notes.md # a draft left by a failed run
82
+ else
83
+ gh release create "$tag" --draft --target "$sha" --title "$tag" --notes-file notes.md
84
+ fi
85
+ { echo "## Draft $tag at $sha"; echo; cat notes.md; } >> "$GITHUB_STEP_SUMMARY"
86
+ { echo "tag=$tag"; echo "sha=$sha"; echo "draft=true"; echo "latest=true"; } >> "$GITHUB_OUTPUT"
87
+
88
+ dist:
89
+ needs: release
90
+ if: needs.release.outputs.tag != ''
91
+ runs-on: ubuntu-latest
92
+ timeout-minutes: 10
93
+ permissions:
94
+ contents: write
95
+ env:
96
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97
+ TAG: ${{ needs.release.outputs.tag }}
98
+ steps:
99
+ - uses: actions/checkout@v7
100
+ with:
101
+ ref: ${{ needs.release.outputs.sha }}
102
+ - uses: actions/setup-python@v7
103
+ with:
104
+ python-version: "3.12"
105
+ - name: Build the wheel and the source archive
106
+ run: |
107
+ python -m pip install --upgrade build twine
108
+ python -m build
109
+ python -m twine check --strict dist/*
110
+ - name: Attach them to the draft
111
+ if: needs.release.outputs.draft == 'true'
112
+ run: gh release upload "$TAG" dist/* --clobber
113
+ - uses: actions/upload-artifact@v7
114
+ with:
115
+ name: dist
116
+ path: dist/
117
+
118
+ docker:
119
+ needs: release
120
+ if: needs.release.outputs.tag != '' && (needs.release.outputs.draft == 'true' || inputs.rebuild_image)
121
+ runs-on: ubuntu-latest
122
+ timeout-minutes: 60
123
+ permissions:
124
+ contents: read
125
+ packages: write
126
+ env:
127
+ DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
128
+ steps:
129
+ - uses: actions/checkout@v7
130
+ with:
131
+ ref: ${{ needs.release.outputs.sha }}
132
+ - uses: docker/setup-qemu-action@v4
133
+ - uses: docker/setup-buildx-action@v4
134
+ - uses: docker/login-action@v4
135
+ with:
136
+ registry: ghcr.io
137
+ username: ${{ github.actor }}
138
+ password: ${{ secrets.GITHUB_TOKEN }}
139
+ - id: meta
140
+ uses: docker/metadata-action@v6
141
+ with:
142
+ images: ghcr.io/${{ github.repository }}
143
+ flavor: latest=false
144
+ tags: |
145
+ type=semver,pattern={{version}},value=${{ needs.release.outputs.tag }}
146
+ type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.tag }}
147
+ type=raw,value=latest,enable=${{ needs.release.outputs.latest == 'true' }}
148
+ labels: |
149
+ org.opencontainers.image.revision=${{ needs.release.outputs.sha }}
150
+ - uses: docker/build-push-action@v7
151
+ with:
152
+ context: .
153
+ file: Dockerfile
154
+ platforms: linux/amd64,linux/arm64
155
+ push: true
156
+ tags: ${{ steps.meta.outputs.tags }}
157
+ labels: ${{ steps.meta.outputs.labels }}
158
+ annotations: ${{ steps.meta.outputs.annotations }}
159
+ cache-from: type=gha
160
+ cache-to: type=gha,mode=max
161
+
162
+ publish:
163
+ needs: [release, dist, docker]
164
+ if: needs.release.outputs.draft == 'true'
165
+ runs-on: ubuntu-latest
166
+ timeout-minutes: 5
167
+ permissions:
168
+ contents: write
169
+ env:
170
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171
+ TAG: ${{ needs.release.outputs.tag }}
172
+ steps:
173
+ - name: Publish the release, which creates the tag
174
+ run: gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --draft=false --latest
175
+
176
+ pypi:
177
+ needs: [release, dist, publish]
178
+ if: >-
179
+ !cancelled() && needs.dist.result == 'success' && vars.PYPI_PUBLISH == 'true' &&
180
+ (needs.publish.result == 'success' || (needs.publish.result == 'skipped' && needs.release.outputs.draft == 'false'))
181
+ runs-on: ubuntu-latest
182
+ timeout-minutes: 10
183
+ environment:
184
+ name: pypi
185
+ url: https://pypi.org/project/tradingagents-lightweight/
186
+ permissions:
187
+ id-token: write # trusted publishing: PyPI checks this workflow's identity, no token is stored
188
+ steps:
189
+ - uses: actions/download-artifact@v8
190
+ with:
191
+ name: dist
192
+ path: dist/
193
+ - uses: pypa/gh-action-pypi-publish@release/v1
194
+
@@ -0,0 +1,17 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .eggs/
5
+ build/
6
+ dist/
7
+ .venv/
8
+ venv/
9
+ env/
10
+ .env
11
+ .DS_Store
12
+ .idea/
13
+ .vscode/
14
+
15
+ # Backtest artifacts are local by design - keep the folder, drop the runs.
16
+ results/*
17
+ !results/.gitkeep
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ Newest first. 中文版:[CHANGELOG_zh.md](CHANGELOG_zh.md)
4
+
5
+ ## 0.1.0 (2026-11-13)
6
+
7
+ The first release on PyPI and as a Docker image.
8
+
9
+ - **Install with one command:** `pip install tradingagents-lightweight` (or `pipx install`), then run `talite`. Without installing anything, `uvx tradingagents-lightweight screen` runs it in a throwaway environment, and the image is `ghcr.io/jackson-cmd/tradingagents-lightweight`.
10
+ - **Momentum screen:** `talite screen` picks names in a confirmed uptrend from Finviz; `--backtest` backtests the picks and `--execute` paper-trades the BUYs.
11
+ - **One ticker end to end:** `talite analyze NVDA` scores the trend, reads the news (SEC 8-K filings by default, Benzinga or any RSS feed with `--news`) and returns BUY, SELL or HOLD with an entry, a 2×ATR stop and a 1:2 target. It is free without API keys; OpenAI, Anthropic, DeepSeek or Gemini can add an LLM layer (`pip install "tradingagents-lightweight[llm]"`).
12
+ - **Backtester:** `talite backtest` runs the same signal code over recent months, with a time stop.
13
+ - **Orders:** sized from the risk per trade, then logged to `results/paper_orders.csv` by the paper broker, or sent to Alpaca as a bracket order (paper account unless you ask for live).
14
+ - `talite --version` prints the version.
@@ -0,0 +1,14 @@
1
+ # 更新记录
2
+
3
+ 最新的在最上面。English: [CHANGELOG.md](CHANGELOG.md)
4
+
5
+ ## 0.1.0(2026-11-13)
6
+
7
+ 第一次发布到 PyPI,同时提供 Docker 镜像。
8
+
9
+ - **一条命令安装:** `pip install tradingagents-lightweight`(或者 `pipx install`),然后运行 `talite`。什么都不想装的话,`uvx tradingagents-lightweight screen` 会在临时环境里直接跑;Docker 镜像是 `ghcr.io/jackson-cmd/tradingagents-lightweight`。
10
+ - **动量选股:** `talite screen` 从 Finviz 挑出处在确认上升趋势里的股票;加 `--backtest` 回测这些股票,加 `--execute` 把 BUY 信号下成模拟单。
11
+ - **单只股票从头到尾:** `talite analyze NVDA` 给趋势打分、看新闻(默认 SEC 8-K 公告,用 `--news` 可以换成 Benzinga 或任意 RSS),给出 BUY、SELL 或 HOLD,附入场价、2 倍 ATR 止损和 1:2 目标价。不填 API key 也能免费跑;想加 LLM 层可以接 OpenAI、Anthropic、DeepSeek 或 Gemini(`pip install "tradingagents-lightweight[llm]"`)。
12
+ - **回测:** `talite backtest` 用同一套信号代码回测最近几个月,带时间止损。
13
+ - **下单:** 按每笔风险算仓位,模拟券商把订单记进 `results/paper_orders.csv`,也可以发到 Alpaca 下括号单(默认模拟盘,明确要求才走实盘)。
14
+ - `talite --version` 输出版本号。
@@ -0,0 +1,17 @@
1
+ # Released images: docker run --rm ghcr.io/jackson-cmd/tradingagents-lightweight screen
2
+ # Build it yourself: docker build -t talite . then docker run --rm talite screen
3
+ FROM python:3.12-slim
4
+
5
+ ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
6
+ WORKDIR /app
7
+
8
+ # Only what the install needs, so editing the README or the examples does not rebuild this layer.
9
+ COPY pyproject.toml README.md LICENSE ./
10
+ COPY talite ./talite
11
+ RUN pip install --no-cache-dir ".[llm]"
12
+
13
+ # Backtests and paper orders are written here; mount a volume to keep them on the host.
14
+ VOLUME ["/app/results"]
15
+
16
+ ENTRYPOINT ["talite"]
17
+ CMD ["screen"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jackson-cmd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.