Skip to content

Commit 7344f19

Browse files
feat: initial public release v0.1.0
- young CLI with subcommands: a, hk, us, global, indices, zt-pool, flow, cache-clear - Eastmoney public endpoints, no login required - 7-day local response cache - Rich terminal tables - Tests + CI (lint + py3.10/3.11/3.12) - Trusted publisher workflow ready for PyPI
1 parent 3bc6614 commit 7344f19

19 files changed

Lines changed: 420 additions & 462 deletions
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
22
name: Bug report
3-
about: Something is broken or returning wrong data
3+
about: Report a problem with young-stock-cli
4+
title: "[BUG] "
45
labels: bug
56
---
67

7-
## What happened
8+
**What happened**
9+
A short description of the bug.
810

9-
<!-- exact command, exact output, exact trading day -->
11+
**Steps to reproduce**
12+
1. Run `young ...`
13+
2. ...
1014

11-
```
12-
$ young a 20260526
13-
...
14-
```
15-
16-
## What you expected
15+
**Expected behavior**
16+
What you expected to see.
1717

18-
## Environment
19-
20-
- young-stock-cli version: `young --version`
21-
- Python: `python3 --version`
18+
**Environment**
19+
- `young --version`:
20+
- Python version:
2221
- OS:
23-
- Network (mainland China / overseas / proxy):
2422

25-
## Extra context
23+
**Output / traceback**
24+
```
25+
paste here
26+
```
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
---
22
name: Feature request
3-
about: Suggest a new market, data source, or CLI feature
3+
about: Suggest a new feature or data source
4+
title: "[FEAT] "
45
labels: enhancement
56
---
67

7-
## What problem does this solve
8+
**Problem**
9+
What problem would this solve?
810

9-
## Proposed solution
11+
**Proposed solution**
12+
What would the CLI / API look like?
1013

11-
## Data source(s) involved
14+
**Alternatives considered**
1215

13-
<!-- e.g. Eastmoney clist, Sina finance, Tushare, Futu, ... -->
14-
15-
## Alternatives considered
16+
**Data source (if applicable)**
17+
URL / endpoint / docs link, and whether it requires login.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
## Summary
1+
## What
22

3-
<!-- One sentence: what does this PR change and why? -->
3+
<!-- short description -->
44

5-
## Type of change
5+
## Why
66

7-
- [ ] Bug fix (non-breaking)
8-
- [ ] New feature (non-breaking)
9-
- [ ] Breaking change
10-
- [ ] Documentation / refactor only
7+
<!-- problem being solved or motivation -->
8+
9+
## How tested
10+
11+
- [ ] `pytest` passes locally
12+
- [ ] `ruff check .` passes
13+
- [ ] Manual test: `young ...`
1114

1215
## Checklist
1316

14-
- [ ] `uv run pytest -q` passes
15-
- [ ] `uv run ruff check src tests` is clean
16-
- [ ] `CHANGELOG.md` updated
17-
- [ ] Tested on at least one real trading day (paste the date)
17+
- [ ] Updated `CHANGELOG.md` if user-visible
18+
- [ ] Updated README if behavior changed

.github/workflows/ci.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,26 @@ on:
77
branches: [main]
88

99
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- run: pip install ruff
18+
- run: ruff check .
19+
1020
test:
11-
runs-on: ${{ matrix.os }}
21+
runs-on: ubuntu-latest
1222
strategy:
1323
fail-fast: false
1424
matrix:
15-
os: [ubuntu-latest, macos-latest]
16-
python-version: ["3.9", "3.10", "3.11", "3.12"]
17-
25+
python-version: ["3.10", "3.11", "3.12"]
1826
steps:
1927
- uses: actions/checkout@v4
20-
21-
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v5
28+
- uses: actions/setup-python@v5
2329
with:
2430
python-version: ${{ matrix.python-version }}
25-
26-
- name: Install
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e ".[dev]"
30-
31-
- name: Lint
32-
run: ruff check src tests
33-
34-
- name: Test
35-
run: pytest -q --cov=young_stock_cli --cov-report=xml
36-
37-
- name: Upload coverage
38-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
39-
uses: codecov/codecov-action@v4
40-
with:
41-
files: ./coverage.xml
42-
fail_ci_if_error: false
31+
- run: pip install -e ".[dev]"
32+
- run: pytest --cov=young_stock --cov-report=term-missing

.github/workflows/publish.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,32 @@ name: Publish to PyPI
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- "v*"
77

88
jobs:
9-
build-and-publish:
9+
build:
1010
runs-on: ubuntu-latest
11-
permissions:
12-
id-token: write # trusted publishing
13-
contents: read
14-
1511
steps:
1612
- uses: actions/checkout@v4
17-
1813
- uses: actions/setup-python@v5
1914
with:
20-
python-version: "3.11"
21-
22-
- name: Build distribution
23-
run: |
24-
python -m pip install --upgrade pip build
25-
python -m build
15+
python-version: "3.12"
16+
- run: pip install build
17+
- run: python -m build
18+
- uses: actions/upload-artifact@v4
19+
with:
20+
name: dist
21+
path: dist/
2622

27-
- name: Publish to PyPI
28-
uses: pypa/gh-action-pypi-publish@release/v1
23+
publish:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
environment: pypi
27+
permissions:
28+
id-token: write
29+
steps:
30+
- uses: actions/download-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/
34+
- uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
.venv/
1+
# Python
22
__pycache__/
3-
*.pyc
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
dist/
49
*.egg-info/
10+
*.egg
511
.pytest_cache/
612
.ruff_cache/
713
.coverage
8-
coverage.xml
9-
dist/
10-
build/
14+
htmlcov/
15+
.tox/
16+
.mypy_cache/
17+
18+
# Virtual envs
19+
.venv/
20+
venv/
21+
env/
22+
23+
# IDE
24+
.vscode/
25+
.idea/
26+
*.swp
1127
.DS_Store
12-
.python-version
28+
29+
# Project
30+
.young_stock/
31+
*.cast
32+
.env
33+
34+
# Lock files (uv)
1335
uv.lock

CHANGELOG.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Changelog
22

3-
All notable changes to this project are documented here. The format follows
4-
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5-
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [0.1.0] - 2026-05-31
89

910
### Added
1011
- Initial public release.
11-
- `young a` / `hk` / `us` / `global` subcommands.
12-
- A-share post-market replay: indices, 涨停/跌停/炸板 pool, fund flow,
13-
industry & concept sector rankings (via browser fallback).
14-
- HK & US replays via Eastmoney `clist` batch endpoint (no-login, no rate limit).
15-
- Three-tier fetch strategy: cache → stable JSON API → browser fallback
16-
(camofox / Playwright / Hermes built-in browser).
17-
- Data-quality scoring + diagnostic reporting for every run.
18-
- Cross-market sentiment summary for `young global`.
12+
- `young a` — A-share after-hours dashboard (indices, ZT/DT pool, fund flow, sector boards).
13+
- `young hk`, `young us`, `young global` — Hong Kong / US / global indices snapshots.
14+
- `young indices`, `young zt-pool`, `young flow` — focused subcommands.
15+
- `young cache-clear` — manage the local response cache.
16+
- Eastmoney public endpoints (`push2.eastmoney.com`, `push2ex.eastmoney.com`) integrated, no login required.
17+
- Built-in 7-day response cache (`~/.young_stock/cache/`).
18+
- Rich terminal tables for human-friendly output.

CONTRIBUTING.md

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,39 @@
11
# Contributing
22

3-
Thanks for your interest in improving `young-stock-cli`. This is a small,
4-
focused project; contributions of all sizes are welcome.
3+
Thanks for considering a contribution! This project welcomes pull requests, bug reports, and feature suggestions.
54

6-
## Development setup
5+
## Quick start
76

87
```bash
98
git clone https://github.com/AdvancingTitans/young-stock-cli.git
109
cd young-stock-cli
11-
uv venv --python 3.11
12-
uv pip install -e ".[dev]"
13-
uv run pytest -q
10+
pip install -e ".[dev]"
11+
pytest
12+
ruff check .
1413
```
1514

16-
## How to contribute
15+
## Pull requests
1716

18-
- **Bug reports**: open an issue with the exact command you ran, the full
19-
stack trace, and the trading day you queried (Eastmoney's payload format
20-
changes over time — knowing the date matters).
21-
- **New data source / endpoint**: open an issue first to discuss API
22-
stability and rate-limit behaviour before sending a PR.
23-
- **Documentation / translation**: PRs welcome. The README is bilingual
24-
(English on top, Chinese below).
17+
1. Fork → create a topic branch (`feat/...` or `fix/...`).
18+
2. Add or update tests for your change.
19+
3. Run `pytest` and `ruff check .` locally — CI runs both.
20+
4. Open a PR with a clear description: what + why.
2521

26-
## Pull request checklist
22+
## Reporting bugs
2723

28-
- [ ] `uv run pytest -q` passes locally.
29-
- [ ] `uv run ruff check src tests` is clean.
30-
- [ ] New behaviour has a test (mock the network, do not hit live APIs).
31-
- [ ] `CHANGELOG.md` updated under `## [Unreleased]`.
24+
Please include:
3225

33-
## Code style
26+
- `young --version`
27+
- Python version (`python --version`)
28+
- OS
29+
- The exact command you ran and the full traceback / output.
3430

35-
- Python 3.8+ syntax (we still support 3.8 because some quant users are
36-
stuck on legacy interpreters).
37-
- 100-column line limit (enforced by ruff).
38-
- Prefer the standard library; runtime dependencies should stay at zero
39-
unless there's a clear reason.
31+
## Code style
4032

41-
## Release process
33+
- `ruff` for linting and import sorting.
34+
- Type hints encouraged but not required for small fixes.
35+
- Keep functions focused; prefer composing small helpers.
4236

43-
Maintainers only:
37+
## License
4438

45-
1. Bump `__version__` in `src/young_stock_cli/__version__.py`.
46-
2. Move `## [Unreleased]` content to a new dated section in `CHANGELOG.md`.
47-
3. Tag: `git tag v0.x.y && git push --tags`.
48-
4. GitHub Actions builds the wheel and publishes to PyPI on tag push.
39+
By contributing, you agree your contribution will be licensed under the MIT license.

0 commit comments

Comments
 (0)