Skip to content

Commit f18fbb0

Browse files
Docs: add Track D Playbook outline + strengthen workbook entry points (#325)
1 parent c8c610f commit f18fbb0

18 files changed

Lines changed: 663 additions & 4 deletions

docs/source/workbook/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PyStatsV1 Workbook
1414
troubleshooting
1515
track_c
1616
track_d_student_edition
17+
track_d_playbook/index
1718
track_d_chapter_index
1819
track_d
1920
track_d_dataset_map

docs/source/workbook/track_d.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ What you get
2828
When you run ``pystatsv1 workbook init --track d``, PyStatsV1 creates a local
2929
folder containing:
3030

31+
Big picture map (recommended)
32+
-----------------------------
33+
34+
If you feel like you are learning lots of commands but losing the "why", read:
35+
36+
- :doc:`Track D Playbook: Big Picture <track_d_playbook/index>`
37+
38+
3139
* convenience runner scripts (``d01`` … ``d23``) that map to Track D chapters
3240
* a reproducible, pre-installed dataset under ``data/synthetic/`` (seed=123)
3341
* an ``outputs/track_d/`` folder where results are written

docs/source/workbook/track_d_chapter_index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Track D chapter index (PyPI)
33

44
This page is a "table of contents" for running Track D from the PyPI workbook.
55

6+
Track D is the “big picture” track: you’re learning how to do **statistics on accounting data** (not toy datasets) in a way that is repeatable, testable, and usable on your own books. The workflow loop is the same in every chapter: start from accounting tables (canonical demos or your own exports), normalize them into a consistent GL contract (see :doc:`track_d_byod`), validate the structure, then analyze with scripts that produce tidy CSVs, figures, and short JSON/MD summaries. In the PyPI workbook you run chapters with ``pystatsv1 workbook run dXX`` and outputs land under ``outputs/track_d/`` (see :doc:`track_d_outputs_guide`). When you bring your own data, you use the BYOD pipeline (export → ``tables/`` → normalize → ``normalized/`` → analyze); start at :doc:`track_d_byod` and :doc:`track_d_playbook/index` for the end-to-end “how it all fits together.” Keep asking one question as you go: *what does this accounting structure measure, and what statistical summary answers a real decision problem?*
7+
68
After you've initialized a Track D workbook:
79

810
.. code-block:: bash

docs/source/workbook/track_d_outputs_guide.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,17 @@ This is a reliable "lab rhythm" that works for almost any Track D chapter:
172172
Optional: changing the output location
173173
--------------------------------------
174174

175-
Most Track D scripts support an ``--outdir`` argument.
175+
Most Track D scripts support an ``--outdir`` argument **when you run the script directly**.
176176

177-
This is useful if you want one folder per lab group, or you want to keep a "clean" outputs folder.
177+
The ``pystatsv1 workbook run ...`` command is the simplest way to run Track D, but it does not forward
178+
extra arguments to the underlying script. So if you want a custom outputs folder, run the script with Python:
178179

179180
.. code-block:: console
180181
181-
pystatsv1 workbook run d01 --outdir outputs/track_d_groupA
182+
# from inside your Track D workbook folder
183+
python scripts/d01.py --outdir outputs/track_d_groupA
182184
183-
If you are new to command-line tools, ignore this at first and use the default.
185+
If you are new to command-line tools, ignore this at first and use the default ``outputs/track_d`` folder.
184186

185187
Common gotchas
186188
--------------
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Orientation: what Track D is and how to use it
2+
==============================================
3+
4+
**Why this exists:** Track D can feel like “a lot of scripts.” This chapter shows the *workflow* that ties everything together.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Explain Track D in one sentence (statistics on accounting data).
10+
- Describe the Track D workflow: export → normalize → validate → analyze → communicate.
11+
- Know the three kinds of Track D work: case study, labs, and BYOD.
12+
- If you forget a command, run ``pystatsv1 --help`` or ``pystatsv1 trackd byod --help``.
13+
14+
Outline
15+
-------
16+
17+
The Track D workflow in one page
18+
--------------------------------
19+
20+
- Start from an accounting export (or the NSO case study dataset).
21+
- Get the data into the Track D dataset contract (either already canonical, or via BYOD normalization).
22+
- Run a chapter script to answer a question (and write outputs).
23+
- Use the artifacts (CSV/PNG/JSON) to write a short business interpretation.
24+
25+
What you should have at the end
26+
-------------------------------
27+
28+
- A reproducible folder with inputs + scripts + outputs (so you can rerun later).
29+
- A small set of charts/tables that tell a story about revenue, costs, or risk.
30+
- A written summary that a manager could act on.
31+
32+
Common mental model mistakes (and fixes)
33+
----------------------------------------
34+
35+
- Mistake: treating accounting data as “just categories.” Fix: it’s a time-stamped database with structure.
36+
- Mistake: skipping validation. Fix: always run a quick check before believing results.
37+
- Mistake: staring at raw rows. Fix: aggregate into daily/monthly totals and compare periods.
38+
39+
Where this connects in the workbook
40+
-----------------------------------
41+
42+
- :doc:`index` (the Playbook overview / map)
43+
- :doc:`../track_d_student_edition` (how students actually run chapters)
44+
- :doc:`../track_d_outputs_guide` (how to read what scripts produce)
45+
- :doc:`../track_d_byod` (how to analyze your own exports)
46+
47+
.. note::
48+
49+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Accounting data as a dataset pipeline
2+
=====================================
3+
4+
**Why this exists:** Students often know debits/credits but not how that becomes an analyzable dataset. This bridges that gap.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Describe the path from business events to statements and analytics.
10+
- Recognize the difference between a chart of accounts, journal, ledger, and trial balance.
11+
- Explain what a “normalization step” does and why it matters.
12+
13+
Outline
14+
-------
15+
16+
From events to reports
17+
----------------------
18+
19+
- Business event → journal entry (date, accounts, amounts, memo).
20+
- Journal entries are the “source record”; the ledger is the “by-account view” of those entries.
21+
- Trial balance is a snapshot of balances by account.
22+
- Statements are *views* built from the trial balance and classifications.
23+
24+
From reports to analysis
25+
------------------------
26+
27+
- Analytics usually starts from the journal/ledger (not the formatted financial statements).
28+
- We create time series (daily/monthly totals), ratios, and variance explanations.
29+
- We then ask: what changed, why, and what should we do next?
30+
31+
Where BYOD fits
32+
---------------
33+
34+
- Different systems export different CSV shapes.
35+
- Adapters convert exports into the Track D canonical tables.
36+
- After normalization, you typically work from ``normalized/gl_journal.csv`` (plus ``normalized/chart_of_accounts.csv``).
37+
- After normalization, analysis scripts don’t care where the data came from.
38+
39+
Where this connects in the workbook
40+
-----------------------------------
41+
42+
- :doc:`../track_d_dataset_map` (what tables exist and what they mean)
43+
- :doc:`../track_d_byod` (the adapter/normalize/validate workflow)
44+
45+
.. note::
46+
47+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
The Track D dataset contract (what scripts expect)
2+
==================================================
3+
4+
**Why this exists:** Track D works because every chapter agrees on a shared data contract. This chapter explains the contract at a high level.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Know the minimum tables required for GL-based analysis (``chart_of_accounts`` + ``gl_journal``).
10+
- Explain what ``normalized/`` outputs are and why we prefer them for analysis.
11+
- Understand where synthetic datasets come from (seeded, reproducible).
12+
13+
Outline
14+
-------
15+
16+
Inputs vs normalized outputs
17+
----------------------------
18+
19+
- BYOD projects store raw exports under ``tables/`` (source-specific).
20+
- Normalization produces ``normalized/chart_of_accounts.csv`` and ``normalized/gl_journal.csv`` (canonical).
21+
- Everything after that is “just analysis.”
22+
23+
Column naming and why it matters
24+
--------------------------------
25+
26+
- Stable column headers allow scripts to be reused across systems.
27+
- If headers drift, you want a failure early (during normalize/validate), not silent bad analysis.
28+
29+
What ``pystatsv1 trackd validate`` does conceptually
30+
----------------------------------------------------
31+
32+
- Uses a profile (for example, ``core_gl``) to decide what tables/columns are required.
33+
- Checks basic schema and required columns.
34+
- Catches common data issues: missing dates, non-numeric amounts, or malformed account identifiers.
35+
36+
Where this connects in the workbook
37+
-----------------------------------
38+
39+
- :doc:`../track_d_dataset_map` (table-by-table map)
40+
- :doc:`../track_d_outputs_guide` (artifacts and how to use them)
41+
- :doc:`../track_d_byod` (normalization and validation commands)
42+
43+
.. note::
44+
45+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
NSO case study: why these numbers exist
2+
=======================================
3+
4+
**Why this exists:** A narrative is the easiest way to keep students oriented. This chapter frames the NSO dataset as a business story.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Describe the NSO business in 60 seconds (what it sells, who it serves, why data matters).
10+
- Identify the main questions Track D is trying to answer with NSO.
11+
- Explain why a case study is useful before BYOD.
12+
13+
Outline
14+
-------
15+
16+
The business story we’re modeling
17+
---------------------------------
18+
19+
- What NSO does and what financial drivers matter (sales volume, margins, seasonality).
20+
- What data we have and what we *don’t* have (and how that affects conclusions).
21+
22+
The analysis questions Track D repeats
23+
--------------------------------------
24+
25+
- Performance: what happened this period vs last period?
26+
- Drivers: which categories/accounts explain the change?
27+
- Risk: where are anomalies, volatility, or concentration?
28+
- Decisions: what would you recommend based on evidence?
29+
- Each chapter produces a small set of artifacts (CSV/PNG/JSON/MD) that support one of these questions.
30+
31+
Transfer to your own data
32+
-------------------------
33+
34+
- The same questions apply to any small business ledger.
35+
- BYOD lets students swap in their own exports later (see :doc:`../track_d_byod`).
36+
37+
Where this connects in the workbook
38+
-----------------------------------
39+
40+
- :doc:`../track_d` (Track D overview)
41+
- :doc:`../track_d_chapter_index` (where the story shows up in chapters)
42+
43+
.. note::
44+
45+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Core analysis recipes (what students actually do)
2+
=================================================
3+
4+
**Why this exists:** This is the practical chapter: recurring tasks and the patterns behind them.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Compute daily/monthly totals and compare periods.
10+
- Build a simple sales proxy from ledger data.
11+
- Create a small set of plots/tables that answer one clear question.
12+
13+
Outline
14+
-------
15+
16+
Recipe: daily totals
17+
--------------------
18+
19+
- Start from ``normalized/gl_journal.csv`` (canonical) and choose a revenue (or cash) account group.
20+
- Group by date, sum signed amounts.
21+
- If you’re using BYOD, you can generate daily totals with ``pystatsv1 trackd byod daily-totals --project <BYOD_DIR>``.
22+
- Plot a time series; note spikes and missing days.
23+
- Write one sentence about the pattern you see.
24+
25+
Recipe: monthly P&L by category
26+
-------------------------------
27+
28+
- Start from ``normalized/gl_journal.csv`` and map accounts to categories (revenue/COGS/opex).
29+
- Aggregate by month and category; compute shares and changes.
30+
- Identify the top 3 drivers of change month-over-month.
31+
- Sales proxy = sum of signed amounts for revenue accounts by day/month.
32+
33+
Recipe: concentration and outliers
34+
----------------------------------
35+
36+
- Start from ``normalized/gl_journal.csv`` and find the largest transactions and their accounts.
37+
- Compute the share of total explained by the top N rows.
38+
- Flag unusual values for follow-up documentation.
39+
40+
Where this connects in the workbook
41+
-----------------------------------
42+
43+
- :doc:\../track_d_byod` (Bring Your Own Data hub)`
44+
- :doc:`../track_d_outputs_guide` (how to read artifacts)
45+
- :doc:`../track_d_byod_gnucash_demo_analysis` (daily totals helper + example plots)
46+
47+
.. note::
48+
49+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Time series + forecasting for accounting data
2+
=============================================
3+
4+
**Why this exists:** Forecasting becomes less scary once you’ve built clean daily/monthly series. This chapter outlines the progression.
5+
6+
Learning objectives
7+
-------------------
8+
9+
- Explain trend, seasonality, and noise using accounting time series.
10+
- Build a baseline forecast and evaluate it.
11+
- Understand when forecasting is inappropriate (garbage in / structural breaks).
12+
13+
Outline
14+
-------
15+
16+
Start with baselines
17+
--------------------
18+
19+
- Start from ``normalized/gl_journal.csv`` and build a clean daily/monthly series (revenue proxy, expense totals, or cash).
20+
- Last value, moving average, seasonal naive.
21+
- Always do a simple backtest (train on earlier months, test on later months).
22+
- Compare forecasts with simple error metrics.
23+
24+
Add explanatory variables
25+
-------------------------
26+
27+
- Promotions, holidays, payroll cycles, or other known drivers.
28+
- Use regression as a driver model (not magic).
29+
30+
Keep it business-grounded
31+
-------------------------
32+
33+
- Always interpret: what would make the forecast wrong?
34+
- Document assumptions and data limitations.
35+
- Structural breaks examples: pricing changes, a new location, system migrations, one-time events, policy changes.
36+
37+
Where this connects in the workbook
38+
-----------------------------------
39+
40+
- :doc:`../track_d_chapter_index` (chapters that introduce forecasting ideas)
41+
- :doc:`../track_d_my_own_data` (how to apply the same methods to your exports)
42+
43+
.. note::
44+
45+
This page is intentionally an outline right now. Expand it incrementally as we refine Track D narrative.

0 commit comments

Comments
 (0)