Skip to main content

BeForData: A Python package for behavioural force data

Data structures for handling behavioural force data

This package provides core classes and utilities for loading, processing, and analysing behavioural force data, such as those collected in experimental psychology or neuroscience. It offers a structured approach to manage epochs and records of force measurements, enabling efficient data manipulation and analysis.

BeForData is based on two structured classes of force data: one for the representation of the raw time-based force measurements in the shape of a dataframe (BeForRecord) and one for epoch-based representations as matrices (BeForEpochs).

Features

  • Flexible loading and saving of force data in common formats (e.g., CSV, XDF).
  • Efficient slicing and indexing of epochs and records for batch analysis.
  • Metadata management for experimental context, including event markers and annotations.
  • Utilities for preprocessing, such as filtering and baseline correction.
  • Integration with scientific Python libraries (NumPy, pandas) for advanced analysis.

Source code: https://github.com/lindemann09/befordata

Documentation: https://lindemann09.github.io/befordata/

(c) Oliver Lindemann

GitHub license PyPI

Data Structures

  • BeForRecord

    Represents a single continuous recording of force data, including metadata such as sampling rate, channel information, and experimental annotations. BeForRecord supports data cleaning, resampling, and extraction of epochs, and provides convenient access to raw and processed force signals.

    The data structure has the following attributes:

    • dat: DataFrame containing force measurements and optionally a time column.
    • sampling_rate: Sampling rate of the force measurements (Hz).
    • sessions: List of sample indices where new recording sessions start.
    • time_column (optional): Name of the column containing time stamps (if any).
    • meta (optional): Arbitrary metadata associated with the record.
  • BeForEpochs

    A container class for managing multiple epochs of force data. Each epoch represents a segment of continuous force measurements, typically corresponding to a trial or experimental condition. BeForEpochs provides methods for slicing, indexing, and batch-processing epochs, as well as for loading and saving epoch data from various formats.

    The data structure has the following attributes:

    • dat: 2D numpy array containing the force data (epochs x samples).
    • sampling_rate: Sampling rate of the force measurements (Hz).
    • design: DataFrame containing design/metadata for each epoch.
    • zero_sample: Sample index representing the sample of the time zero within each epoch (default: 0).
    • baseline (optional): 1D numpy array containing baseline values for each epoch at zero_sample.
    • meta (optional): Arbitrary metadata associated with the epochs.

Typical Workflow

  1. Load raw force data into a BeForRecord object.
  2. Preprocess and annotate the data as needed.
  3. Segment the data into epochs using event markers, creating a BeForEpochs object.

Install via pip

pip install befordata

Citation

If you use befordata in your research, please cite it as:

Lindemann, O. (2025). BeForData: A Python package for behavioural response force
data. [Computer software]. https://pypi.org/project/befordata/

Or in BibTeX:

@software{pybefordata2025,
  author    = {Lindemann, Oliver},
  title     = {{BeForData}: A {Python} package for behavioural force data},
  year      = {2025},
  url       = {https://pypi.org/project/befordata/}
  version   = {0.4}
}

Julia

A Julia implementation of BeForData is available as a beta release.

Metadata

Release files for befordata 0.4.9

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

Source distribution (sdist)

Source distribution for befordata 0.4.9
File Size Uploaded Provenance
befordata-0.4.9.tar.gz 18.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 40.1 kB

Release files / befordata-0.4.9.tar.gz

Download URL befordata-0.4.9.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e253be011c7702be9699f2ef50a53d0cbbd5a96381012a453a53a0bb0f20fde0
BLAKE2b-256 checksum
How to use checksums
a79e0fd8f2e38a5c6c461e4f6f9dae7fde08762375862597ab1dd3e1302485c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / befordata-0.4.9-py3-none-any.whl

Download URL befordata-0.4.9-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72af784ae3473de07910c1aa21d4c71966e10c66f413814fb83df938b004a07f
BLAKE2b-256 checksum
How to use checksums
754064d92417fa0858c466ad2a4f2d91b26e644e8c02bab9f10b5e1ccc134834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for befordata 0.4.9

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.

Release history Release notifications | RSS feed

This release

0.4.9 This release

2 release files No provenance

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