Skip to main content

YASA: Analysis of polysomnography recordings.

Project description


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:

Project details


Download files

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

Source Distribution

yasa-0.7.0.tar.gz (33.9 MB view details)

Uploaded Source

Built Distribution

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

yasa-0.7.0-py3-none-any.whl (33.8 MB view details)

Uploaded Python 3

File details

Details for the file yasa-0.7.0.tar.gz.

File metadata

  • Download URL: yasa-0.7.0.tar.gz
  • Upload date:
  • Size: 33.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for yasa-0.7.0.tar.gz
Algorithm Hash digest
SHA256 9a0106a06a76ddac1a1483fa2ca5cb3a604d9d233055b2fac0992d8db04bd4f4
MD5 266c56ed3aaede8ddd4e52d51ffa8c14
BLAKE2b-256 4cbc1ab0b436b7e6666833488f700ef54526e59f8c310c7b32ced5b2d8ff957c

See more details on using hashes here.

File details

Details for the file yasa-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: yasa-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for yasa-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 114d9cab3dd8237847657b45540aa5df1edd27eea0bd590b8154a6fb2426b0c9
MD5 36285e1c63a7d772977b0287011562b4
BLAKE2b-256 3e52a3f484d89ff7e9a580e1a6f27e4a382f943060b6a897d7a7935a3144f9fc

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