Exercise Downloader
Download exercises to your local machine for offline practice
On this page
Exercise Downloader¶
Download exercises to your local machine so you can practice offline in your own editor and environment.
Install¶
Install the downloader via Cargo:
cargo install pybites-rust-download
Download Free Exercises¶
Run the downloader without any configuration to get all free exercises:
pybites-rust-download
This creates an exercises directory in your current folder with a Cargo workspace containing all free exercises.
Download All Exercises (Premium)¶
Premium users can download all exercises by setting the PYBITES_API_KEY environment variable. Find your API key on your Profile page.
PYBITES_API_KEY=your-api-key-here pybites-rust-download
Or export it in your shell profile so you don't have to pass it every time:
export PYBITES_API_KEY=your-api-key-here
pybites-rust-download
Working with Downloaded Exercises¶
Each exercise is a standalone Cargo package inside the workspace:
exercises/
Cargo.toml # workspace root
README.md
intro/
hello-rustacean/
Cargo.toml
bite.md # exercise description
src/lib.rs # your code goes here
easy/
...
Run tests for a single exercise:
cd exercises
cargo test -p hello-rustacean
Or run all tests at once:
cd exercises
cargo test
Re-running the downloader
Running the downloader again will back up any modified lib.rs files (with a timestamp suffix) before writing the latest templates, so your work is never lost.