bcpractice
A command line tool that generates AP Calculus BC practice problem sets as print-ready PDFs. You pick the units or topics, choose a length, and an AI model writes free-response problems in the style of the AP exam. The PDF is laid out like a real exam booklet: a cover page with AP-style directions, one question per page, and blank workspace under each part.
Requirements
-
Python 3.10 or newer.
-
A LaTeX distribution providing the
pdflatexcommand. Without it, bcpractice can still generate a.texfile, but not a PDF.Platform Install command macOS brew install --cask mactex-no-guiUbuntu/Debian sudo apt install texlive-latex-extra texlive-fonts-extraWindows MiKTeX The PDF uses the Times-like
newtxfonts for the AP exam look (included in the installs above). If your LaTeX installation doesn't have them, bcpractice falls back to the standard LaTeX fonts automatically. -
One of the following, for problem generation:
- A Claude account (any paid plan) with Claude Code installed. No API key needed.
- An Anthropic API key.
- An OpenAI API key.
Installation
macOS and Linux
One command:
curl -fsSL https://raw.githubusercontent.com/aaravjaichand/bcpractice/main/install.sh | bash
The script finds Python, installs pipx if needed (so the tool stays isolated from your system Python), and installs bcpractice. Re-running it updates an existing install to the latest version.
Prefer to run the steps yourself? The script is equivalent to:
brew install pipx # macOS; on Linux: python -m pip install --user pipx
pipx ensurepath
pipx install bcpractice
Windows
python -m pip install --user pipx
python -m pipx ensurepath
pipx install bcpractice
Plain pip also works: pip install bcpractice. If the bcpractice command is not found after a pip install, run it as python -m bcpractice.
Setup
Run the interactive setup and follow the prompts:
bcpractice setup
You will be asked how to authenticate, then which model to use.
Option 1: Claude account (recommended)
Sign in once with your Claude account and bcpractice uses it directly. There is no API key to create or paste. Generation counts against your Claude plan usage.
- Install Claude Code if you do not have it:
npm install -g @anthropic-ai/claude-code - Sign in:
claude /login - Run
bcpractice setupand choose "Claude account".
Setup verifies the sign-in with a small test request. If Claude Code is installed but not signed in, setup offers to launch the login for you.
Note: if the ANTHROPIC_API_KEY environment variable is set, the Claude Code runtime uses it instead of your account sign-in, and generation bills that key. Setup and bcpractice status warn you when this applies.
Option 2: API key
Choose "Anthropic API key" or "OpenAI API key" during setup and paste your key. The key is validated before it is saved, and stored in ~/.bcpractice/config.json with owner-only permissions.
Option 3: Environment variables
You can skip setup entirely by exporting a key:
export ANTHROPIC_API_KEY="sk-ant-..."
# or
export OPENAI_API_KEY="sk-..."
bcpractice infers the provider from whichever variable is set and uses that provider's default model.
Usage
bcpractice generate
The command walks you through topic selection (by unit or by individual topic) and set length, then generates the problems and compiles a PDF into the current directory.
Options:
bcpractice generate --length quick # quick (5-8), medium (12-15), or full (20-25) problems
bcpractice generate --output ~/practice # write the PDF somewhere else
bcpractice generate --model claude-opus-4-8 # override the configured model for one run
If pdflatex is missing, bcpractice tells you before any generation happens and offers to save a .tex file instead.
Commands
| Command | Description |
|---|---|
bcpractice setup |
Configure authentication and model choice |
bcpractice generate |
Generate a practice problem set |
bcpractice topics |
List all available units and topics |
bcpractice status |
Show provider, auth source, model, and pdflatex status |
bcpractice update |
Update bcpractice to the latest released version |
bcpractice reset |
Remove the saved configuration |
bcpractice --version |
Print the installed version |
Configuration
Settings live in ~/.bcpractice/config.json, created with permissions 600 (owner read and write only). It stores the provider, the chosen model, and, for the API key options, the key itself. The Claude account option stores no credentials; authentication is handled by Claude Code.
Topic coverage
The full AP Calculus BC curriculum from the College Board Course and Exam Description, 111 topics across 10 units.
| Unit | Name | Topics |
|---|---|---|
| 1 | Limits and Continuity | 16 |
| 2 | Differentiation: Definition and Fundamental Properties | 10 |
| 3 | Differentiation: Composite, Implicit, and Inverse Functions | 6 |
| 4 | Contextual Applications of Differentiation | 7 |
| 5 | Analytical Applications of Differentiation | 12 |
| 6 | Integration and Accumulation of Change | 14 |
| 7 | Differential Equations | 9 |
| 8 | Applications of Integration | 13 |
| 9 | Parametric, Polar, and Vector Functions | 9 |
| 10 | Infinite Sequences and Series | 15 |
Topics marked [BC] in bcpractice topics are exclusive to Calculus BC and not covered in AB.
Troubleshooting
"pdflatex was not found": install a LaTeX distribution (see Requirements). On macOS, MacTeX installs into /Library/TeX/texbin; open a new terminal after installing so the PATH change takes effect.
"Claude Code is not signed in": run claude /login and complete the browser sign-in, then retry. bcpractice status shows the current authentication state.
Generation bills my API key instead of my Claude plan: unset ANTHROPIC_API_KEY in your shell. The Claude Code runtime prefers an API key from the environment over your account sign-in.
"usage limit has been reached": your Claude plan's usage window is exhausted. Wait for it to reset, or switch to an API key with bcpractice setup.
"rejected your API key": the stored key is invalid or expired. Run bcpractice setup again with a fresh key.
bcpractice: command not found after pip install: your Python scripts directory is not on PATH. Use python -m bcpractice, or install with pipx instead.
License
MIT. See LICENSE.
Curriculum structure follows the College Board AP Calculus BC Course and Exam Description. Problem styling is inspired by the practice materials at FlippedMath.
Metadata
Release files for bcpractice 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bcpractice-0.3.0.tar.gz | 30.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bcpractice-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.9 kB
Release files / bcpractice-0.3.0.tar.gz
| Download URL | bcpractice-0.3.0.tar.gz |
|---|---|
| Size | 30.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73e2f87b56895c862713c459791c981ca8c99d737c1850c64186ba172be7ce55
|
|
BLAKE2b-256 checksum How to use checksums |
fb55b48e2dce66d79f83204282b753e42afdfe5705b2d369105fd98a07bfe55f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency logRelease files / bcpractice-0.3.0-py3-none-any.whl
| Download URL | bcpractice-0.3.0-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0411d42ba07c2c632ca4c95d1a7f2a8292613eb5d1fa9b1147c2d93b70ef88cb
|
|
BLAKE2b-256 checksum How to use checksums |
ad7dc538327ee4fffbee0ab7564429e546fa550c70e11f0a05b574ba7ff642ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency logSecurity for bcpractice 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bcpractice-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.