krank
Fetch curated dream reports.
See the online documentation for details.
Installation
pip install --upgrade krank
Usage
import krank
# View a list of available corpora.
krank.list_corpora()
# ['hvdc', 'zhang2019']
# View a list of available versions for a corpus.
krank.list_versions("zhang2019")
# ['1']
# Print metadata about a single corpus.
krank.info("zhang2019")
# Corpus: zhang2019
# Title: Zhang & Wamsley, 2019
# Description: Dream reports collected from a laboratory polysomnography study
# Version: 1
# Citations: Zhang, J., & Wamsley, E. J. (2019); Wong, W., Herzog, R., ... (2025)
# Load a corpus.
corpus = krank.load("zhang2019")
corpus
# Corpus('zhang2019')
# Print corpus info (same as krank.info()).
print(corpus)
# Corpus: zhang2019
# Title: Zhang & Wamsley, 2019
# Description: Dream reports collected from a laboratory polysomnography study
# Version: 1
# Citations: Zhang, J., & Wamsley, E. J. (2019); Wong, W., Herzog, R., ... (2025)
# Get number of reports and authors.
corpus.n_reports
# 120
corpus.n_authors
# 16
# Return metadata as a dictionary.
corpus.metadata["title"]
# 'Zhang & Wamsley 2019 Dream Reports'
corpus.metadata["hash"]
# 'md5:a61a3c56f4ee8c14e4a6466044df88f8'
corpus.metadata["brief_description"]
# 'Dream reports collected from a laboratory polysomnography study'
# Return unique authors and their associated metadata in a tidy dataframe.
corpus.authors.head()
# author age sex
# 0 10 23 Male
# 1 26 18 Male
# 2 30 19 Female
# 3 42 20 Male
# 4 83 20 Male
# Return dream reports and their associated metadata in a tidy dataframe.
corpus.reports.head()
# author time stage_intended stage_actual experience report
# 0 10 07:17:27 REM Morning True I umm I was with my parents and we're having a...
# 1 10 02:07:02 N2 NREM True Ummm... trying to put um everything together [...
# 2 10 03:50:48 REM REM True Yes I'm ummm... I'm in an argument with a...wi...
# 3 10 00:16:08 N1 SO False What? I don't have a dream. What was your ques...
# 4 10 00:54:12 N2 SO True Uhuh. Umm let's see.. Running around...(silence).
Contributing
Open an Issue to request a new corpus (or for any other reason).
Adding a new corpus involves the following steps:
- Adding a
sources/<name>/prepare.ipynbthat exports a single CSV file. - Creating a new Zenodo archive with that CSV file.
- Add the corpus info to the registry.yaml file (See registry-schema.yaml for what fields are required.)
- Add the corpus to mkdocs.yaml.
Versioning
Follows a modified semver structure, where, given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when there are incompatible API changes or an existing corpus is removed.
- MINOR version when functionality is added in a backward compatible manner or a new corpus is added.
- PATCH version when backward compatible bug fixes are added or an existing corpus gets a new release.
Validating Registry Changes
After making changes to the registry, validate them locally using:
python scripts/validate_registry.py
This script checks:
- Schema compliance (all required fields present with correct types)
- Alphabetical ordering of collections and corpora
- Valid references from collections to corpora
- Proper hash formats and URLs
The validation runs automatically as part of the test suite in CI.
Credits
This project would not be possible without the work of the Fatiando a Terra Project, namely a heavy dependency on pooch, an inspiration from ensaio, and a structural model from the Fatiando a Terra FAIR data collection.
Uieda, L., V. C. Oliveira Jr, and V. C. F. Barbosa (2013), Modeling the Earth with Fatiando a Terra, Proceedings of the 12th Python in Science Conference, pp. 91-98. doi:10.25080/Majora-8b375195-010
Metadata
Release files for krank 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| krank-0.1.0.tar.gz | 24.7 kB | With provenance | Details for krank-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| krank-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for krank-0.1.0-py3-none-any.whl |
Total release size: 40.6 kB
Release files / krank-0.1.0.tar.gz
| Download URL | krank-0.1.0.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35b683f01dbe9c1327c37d2128729fc7d1086ef385c30bb95f52ce69c41b8264
|
|
BLAKE2b-256 checksum How to use checksums |
d730083f6c8a30d0aab341c77b6554f4521fe6ec8d5258b5b20a4a1ed75388ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 10, 2026.
Transparency logRelease files / krank-0.1.0-py3-none-any.whl
| Download URL | krank-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
961d0205a18fa081590cd01a5245654afa941da9f85d527780f157623cf63e0d
|
|
BLAKE2b-256 checksum How to use checksums |
8b2d13fda21382091a37a6dbb7408defd2552b133f5c8d83f6527d094d74d13e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 10, 2026.
Transparency logSecurity for krank 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for krank-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 10, 2026.
Transparency logA 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.