Skip to main content

No project description provided

Project description

actfast Fast actigraphy data reader

actfast is a Python package for reading raw actigraphy data of various devices and manufacturers. It is designed to be fast, lightweight, memory efficient, and suitable for reading large datasets.

Supported formats & devices

The package currently supports the following formats:

Format Manufacturer Device Implementation status
GT3X Actigraph wGT3X-BT
BIN GENEActiv GENEActiv
CWA Axivity AX3, AX6
BIN Genea Genea
BIN Movisens Movisens
WAV Axivity Axivity Use general-purpose WAV audio file reader
AGD/SQLite Actigraph ActiGraph Use general-purpose SQLite reader
AWD Philips Actiwatch Use general-purpose CSV reader
MTN Philips Actiwatch Use general-purpose XML reader
CSV Any Any Use general-purpose CSV reader
XLS, XLSX, ODS Any Any Use general-purpose Excel reader

The scope of this package is limited to reading raw sensor data. It does not read CSV or other standard file formats commonly used by various manufacturers. Use general-purpose libraries to read these files.

The package is designed to be easily extensible to support new formats and devices. If you have a non-standard device format that is not supported yet, please open an issue and attach a sample file. We will do our best to add support for it.

Installation

Install from PyPI via:

pip install actfast

Or, install the latest development version from GitHub via:

pip install git+https://github.com/childmindresearch/actfast.git

Tested devices

This package has been extensively tested with data captured by the following devices:

Device Firmware
ActiGraph wGT3X-BT 1.9.2
GENEActiv 1.2 Ver06.17 15June23

Similar devices might work, but have not been tested. Please open an issue and attach a sample file if you encounter any issues.

Usage

The package provides a single function, read, which reads an actigraphy file and returns a dictionary:

import actfast

subject1 = actfast.read("data/subject1.gt3x")

The returned dictionary has the following structure:

{
    "format": "Actigraph GT3X",  # file format, any of "Actigraph GT3X", "Axivity CWA", "GeneActiv BIN", "Genea BIN", "Unknown WAV", "Unknown SQLite"
    "metadata": {
        # device specific key value pairs of metadata (e.g., device model, firmware version)
    },
    "timeseries": {
        # device specific key value pairs of "timeseries name" -> {timeseries data}, e.g.:
        "high_frequency": {
            "datetime": # 1D int64 numpy array of timestamps in nanoseconds (Unix epoch time)
            # other data fields are various device specific sensor data, e.g.:
            "acceleration": # 2D numpy array (n_samples x 3) of acceleration data (x, y, z)
            "light": # 1D numpy array of light data
            "temperature": # temperature data
            # ...
        },
        "low_frequency": {
            # similar structure as high_frequency
        }
    },

Architecture & usage considerations

All supported formats seem to be constructed as streams of variable-length, variable-content records. While this stream of records is easy to write for the manufacturers, it is not ideal for vectorized operations. actfast collects data in contiguous arrays.

Consider reading large datasets once and storing them in a more efficient format (e.g., Parquet, HDF5) for subsequent analysis. This will always speed up data reading and enable streaming data processing.

License

This package is licensed under the MIT License. See the LICENSE file for more information.

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

actfast-1.0.0.tar.gz (84.0 kB view hashes)

Uploaded Source

Built Distributions

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

actfast-1.0.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

actfast-1.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

actfast-1.0.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

actfast-1.0.0-cp312-none-win_amd64.whl (232.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

actfast-1.0.0-cp312-none-win32.whl (232.8 kB view hashes)

Uploaded CPython 3.12 Windows x86

actfast-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

actfast-1.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

actfast-1.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

actfast-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

actfast-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (335.8 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

actfast-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl (345.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

actfast-1.0.0-cp311-none-win_amd64.whl (235.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

actfast-1.0.0-cp311-none-win32.whl (235.3 kB view hashes)

Uploaded CPython 3.11 Windows x86

actfast-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

actfast-1.0.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

actfast-1.0.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

actfast-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

actfast-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (338.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

actfast-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl (347.3 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

actfast-1.0.0-cp310-none-win_amd64.whl (235.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

actfast-1.0.0-cp310-none-win32.whl (235.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

actfast-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

actfast-1.0.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

actfast-1.0.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

actfast-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

actfast-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (338.4 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

actfast-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl (347.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

actfast-1.0.0-cp39-none-win_amd64.whl (235.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

actfast-1.0.0-cp39-none-win32.whl (235.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

actfast-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

actfast-1.0.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

actfast-1.0.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

actfast-1.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

actfast-1.0.0-cp39-cp39-macosx_10_12_x86_64.whl (347.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.12+ x86-64

actfast-1.0.0-cp38-none-win_amd64.whl (234.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

actfast-1.0.0-cp38-none-win32.whl (235.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

actfast-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

actfast-1.0.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

actfast-1.0.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

actfast-1.0.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

actfast-1.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

actfast-1.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page