Skip to main content

https://img.shields.io/pypi/v/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

Install from source

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.8.1

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.8.1
File Size Uploaded Provenance
yasa-0.8.1.tar.gz 27.5 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 54.9 MB

Release files / yasa-0.8.1.tar.gz

Download URL yasa-0.8.1.tar.gz
Size 27.5 MB
Tags Source
SHA-256 checksum
How to use checksums
ce0e2f4ab2155f08dbdb00ed3a3a8443f5a8823e10163137465020c78380ac21
BLAKE2b-256 checksum
How to use checksums
da40fb9769703632c5aab835f4ea21e613dcc014fedc4352f447f0826527b648
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.8.1-py3-none-any.whl

Download URL yasa-0.8.1-py3-none-any.whl
Size 27.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
72b45abde6c78f25b523eddda1dc9875f755fd665ed270934a95f8986ba74cc7
BLAKE2b-256 checksum
How to use checksums
22b2e2dd649dd897bc8eabae9b276a9afacb21203c65343c73788514e054f8e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for yasa 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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