Fetch dream reports.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krank-0.1.0.tar.gz.
File metadata
- Download URL: krank-0.1.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b683f01dbe9c1327c37d2128729fc7d1086ef385c30bb95f52ce69c41b8264
|
|
| MD5 |
80bf5657c6b47bbecb3bf200d277f360
|
|
| BLAKE2b-256 |
d730083f6c8a30d0aab341c77b6554f4521fe6ec8d5258b5b20a4a1ed75388ee
|
Provenance
The following attestation bundles were made for krank-0.1.0.tar.gz:
Publisher:
release.yaml on remrama/krank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krank-0.1.0.tar.gz -
Subject digest:
35b683f01dbe9c1327c37d2128729fc7d1086ef385c30bb95f52ce69c41b8264 - Sigstore transparency entry: 813288967
- Sigstore integration time:
-
Permalink:
remrama/krank@921ddd7bb836f8c8b6cf132add3e526e91a2c4f0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/remrama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@921ddd7bb836f8c8b6cf132add3e526e91a2c4f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file krank-0.1.0-py3-none-any.whl.
File metadata
- Download URL: krank-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
961d0205a18fa081590cd01a5245654afa941da9f85d527780f157623cf63e0d
|
|
| MD5 |
338a603cea1593d45f070c3368795ad5
|
|
| BLAKE2b-256 |
8b2d13fda21382091a37a6dbb7408defd2552b133f5c8d83f6527d094d74d13e
|
Provenance
The following attestation bundles were made for krank-0.1.0-py3-none-any.whl:
Publisher:
release.yaml on remrama/krank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krank-0.1.0-py3-none-any.whl -
Subject digest:
961d0205a18fa081590cd01a5245654afa941da9f85d527780f157623cf63e0d - Sigstore transparency entry: 813288969
- Sigstore integration time:
-
Permalink:
remrama/krank@921ddd7bb836f8c8b6cf132add3e526e91a2c4f0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/remrama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@921ddd7bb836f8c8b6cf132add3e526e91a2c4f0 -
Trigger Event:
push
-
Statement type: