Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

actfast

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actfast

  • 1.1.1
  • PyPI
  • Socket score

Maintainers
1

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:

FormatManufacturerDeviceImplementation status
GT3XActigraphwGT3X-BT
BINGENEActivGENEActiv
CWAAxivityAX3, AX6
BINGeneaGenea
BINMovisensMovisens
WAVAxivityAxivityUse general-purpose WAV audio file reader
AGD/SQLiteActigraphActiGraphUse general-purpose SQLite reader
AWDPhilipsActiwatchUse general-purpose CSV reader
MTNPhilipsActiwatchUse general-purpose XML reader
CSVAnyAnyUse general-purpose CSV reader
XLS, XLSX, ODSAnyAnyUse 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:

DeviceFirmware
ActiGraph wGT3X-BT1.9.2
GENEActiv 1.2Ver06.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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc