Skip to main content

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

  1. Basic usage (will automatically detect SD card):
pi-flasher
  1. For testing in simulation mode:
pi-flasher --simulate
  1. 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

  1. Insert the SD card into your Raspberry Pi
  2. Connect your Pi to your network via ethernet
  3. Power on the Pi - SSH will be enabled by default
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pi_flasher-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

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

Hashes for pi_flasher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 951889e950b497014007f2ce0b362ccfa5be5486ba3862f9a1061ffb82ee4b27
MD5 7af14266316e4ae8f7885006d487be27
BLAKE2b-256 26372404094c19183efacd54a2fd7bf6794d41a081d5f17933fa1027ff3d08ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page