Getting started¶
Installation¶
Somnio requires Python 3.10+.
With uv¶
To use the CLI, install with the optional cli extra:
The download-nsrr command also needs the nsrr extra:
Extras matrix¶
Somnio ships small optional extras so you can install only what you use:
cli: command-line interfacensrr: NSRR download helpersschemas: pipeline YAML schemassignal: SciPy-based signal processingmne: MNE-based processingedf: EDF I/Ohdf5: HDF5 layoutsonnx: ONNX Runtime sleep scoring backends; see Sleep scoringtensorflow: TensorFlow sleep scoring backends; see Sleep scoringeeg-usability: EEG usability scoring from eegFloss lite models; see EEG usability
With pip¶
For CLI support:
For download-nsrr:
For SciPy-based signal processing (resample, and other SciPy transforms):
For MNE-based filtering (apply_filter) and the MNE ↔ TimeSeries adapter:
Eye-movement detection with default preprocessing needs both:
For HDF5 signal layouts (somnio.io.hdf5, native and USleep formats):
Verify installation¶
If you installed the CLI extra, confirm it works:
You should see the list of commands (e.g. download-nsrr).