Skip to main content

https://badge.fury.io/py/yasa.svg https://img.shields.io/github/license/raphaelvallat/yasa.svg https://codecov.io/gh/raphaelvallat/yasa/branch/master/graph/badge.svg https://static.pepy.tech/badge/yasa Ruff
https://raw.githubusercontent.com/raphaelvallat/yasa/refs/tags/v0.6.5/docs/pictures/yasa_logo.png

YASA (Yet Another Spindle Algorithm) is a command-line sleep analysis toolbox in Python. The main functions of YASA are:

  • Automatic sleep staging of polysomnography data (see eLife article).

  • Event detection: sleep spindles, slow-waves and rapid eye movements, on single or multi-channel EEG data.

  • Artefact rejection, on single or multi-channel EEG data.

  • Spectral analyses: bandpower, phase-amplitude coupling, 1/f slope, and more!

  • Hypnogram analysis: sleep statistics, stage transitions, visualization, and manipulation.

For more details, try the tutorials or read the FAQ.


Installation

User installation

YASA can be easily installed using pip, conda, or uv:

uv pip install yasa
pip install --upgrade yasa
conda install -c conda-forge yasa

Some features require optional dependencies. Install them with extras:

pip install "yasa[full]"    # all optional dependencies

Development

To build and install from source, clone this repository and install in editable mode with uv

git clone https://github.com/raphaelvallat/yasa.git
cd yasa
uv pip install --group=test --editable .

# test the package
pytest --verbose

For common questions about prerequisites, data formats, and how to load EEG data, see the FAQ.

How do I get started with YASA?

The best starting point is the tutorials section of the documentation, which includes a quickstart guide and step-by-step walkthroughs of the most common workflows.

Additional worked examples are available as Jupyter notebooks on GitHub. Note that some notebooks may not reflect the latest API.

Development

YASA was created and is maintained by Raphael Vallat. Contributions are more than welcome! See the contributing guide for guidelines.

To see the code or report a bug, please visit the GitHub repository.

Note that this program is provided with NO WARRANTY OF ANY KIND.

Citation

To cite YASA, please use the eLife publication:

Metadata

Release files for yasa 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yasa 0.7.0
File Size Uploaded
yasa-0.7.0.tar.gz 33.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for yasa 0.7.0
File Interpreter ABI Platform
yasa-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.7 MB

Release files / yasa-0.7.0.tar.gz

Download URL yasa-0.7.0.tar.gz
Size 33.9 MB
Tags Source
SHA-256 checksum
How to use checksums
9a0106a06a76ddac1a1483fa2ca5cb3a604d9d233055b2fac0992d8db04bd4f4
BLAKE2b-256 checksum
How to use checksums
4cbc1ab0b436b7e6666833488f700ef54526e59f8c310c7b32ced5b2d8ff957c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / yasa-0.7.0-py3-none-any.whl

Download URL yasa-0.7.0-py3-none-any.whl
Size 33.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
114d9cab3dd8237847657b45540aa5df1edd27eea0bd590b8154a6fb2426b0c9
BLAKE2b-256 checksum
How to use checksums
3e52a3f484d89ff7e9a580e1a6f27e4a382f943060b6a897d7a7935a3144f9fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page