Minimal Python example repo for Jupyter notebooks and simple data-collection workflows.
This repo is not the Python SDK package itself. Install the published client from PyPI:
pip install alpha-sdk-clientUse this repo as copy-paste/reference code for:
- discovering and connecting to a camera
- collecting repeated property snapshots into row dictionaries
- triggering AF + shutter capture
- enabling live view and fetching a JPEG frame
- previewing SD card files in
remote-transfermode
- Python 3.8+
- the Alpha Camera server (
CameraWebApp), built from source - a camera supported by the SDK
The camera server is built from source — it needs Sony's Camera Remote SDK and is
never shipped as a package. Build it once with the
crsdk CLI:
git clone https://github.com/crsdk/alpha-sdk-api.git
cd alpha-sdk-api
./crsdk install --zip <sony-camera-remote-sdk.zip>
./crsdk buildThen either let this script spawn it (point CRSDK_BINARY at the built binary):
export CRSDK_BINARY=/path/to/alpha-sdk-api/api/server/build/CameraWebApp…or run it yourself (./crsdk start) and the script will adopt the running
server. The spawn/adopt logic lives in camera_server.managed_server.
pip install -r requirements.txtIf you do not want Jupyter installed, the only required runtime dependency is:
pip install alpha-sdk-clientnotebook_data_collection.py— notebook-friendly helper functions plus a small CLI smoke testcamera_server.py— spawn/adopt lifecycle for the nativeCameraWebApp(stdlib only)
From the repo root:
python notebook_data_collection.pyThat will:
- discover cameras
- connect to the first one
- collect a few property snapshots
- print the results
To trigger one real capture:
python notebook_data_collection.py --captureStart Jupyter from this repo root:
jupyter notebookThen in a notebook cell:
from alpha_sdk_client import AlphaSDKClient
from notebook_data_collection import (
collect_property_rows,
connect_first_camera,
enable_live_view,
fetch_live_view_frame,
save_live_view_frame,
)
client = AlphaSDKClient(base_url="http://localhost:8080")
camera = connect_first_camera(client, mode="remote")
rows = collect_property_rows(client, camera.id, count=5, interval_s=1.0)If you want a DataFrame:
import pandas as pd
df = pd.DataFrame(rows)
df.head()enable_live_view(client, camera.id)
frame = fetch_live_view_frame(client, camera.id)
save_live_view_frame(frame, "frame.jpg")mode="remote"is the simplest default for control and capture.- Use
mode="remote-transfer"if you also want SD card listing/downloads. - The helper waits for connection status after
connect()rather than assuming the server flips to connected immediately.