A safe tool for flashing Raspberry Pi OS images to SD cards
Project description
Raspberry Pi OS Flasher
A command-line tool for safely flashing Raspberry Pi OS images to SD cards. This tool automatically downloads the latest 64-bit Raspberry Pi OS and configures it with SSH enabled for remote access.
Features
- Automatic download of the latest Raspberry Pi OS 64-bit
- Safe device detection to prevent accidental system drive formatting
- SSH enabled by default for headless setup
- Progress monitoring with health checks
- Verification of flashed images
- Simulation mode for testing
Installation
# Clone the repository
git clone https://github.com/yourusername/pi-flasher.git
cd pi-flasher
# Install the package
pip install .
Usage
- Basic usage (will automatically detect SD card):
pi-flasher
- For testing in simulation mode:
pi-flasher --simulate
- Specify a custom image and device:
pi-flasher --image path/to/image.img --device /dev/sdX
Options
--simulate: Run in simulation mode (no actual device writes)--force: Skip confirmation prompts (use with caution!)--image PATH: Specify a local image file--device PATH: Specify a target device path
Safety Features
- Detects only removable devices (USB drives and SD cards)
- Verifies device size is appropriate for Raspberry Pi OS
- Prevents writing to system drives
- Shows clear warnings before writing
- Verifies written data
Requirements
- Python 3.11+
- Linux-based system with USB/SD card support
- Required Python packages (installed automatically):
- rich
- requests
- pyudev
After Flashing
- Insert the SD card into your Raspberry Pi
- Connect your Pi to your network via ethernet
- Power on the Pi - SSH will be enabled by default
- Find your Pi's IP address and connect:
ssh pi@<raspberry-pi-ip>
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pi_flasher-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pi_flasher-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
951889e950b497014007f2ce0b362ccfa5be5486ba3862f9a1061ffb82ee4b27
|
|
| MD5 |
7af14266316e4ae8f7885006d487be27
|
|
| BLAKE2b-256 |
26372404094c19183efacd54a2fd7bf6794d41a081d5f17933fa1027ff3d08ca
|