actipy


Nameactipy JSON
Version 3.0.6 PyPI version JSON
download
home_pagehttps://github.com/OxWearables/actipy
SummaryPython package to process wearable accelerometer data
upload_time2024-04-12 06:15:04
maintainerShing Chan
docs_urlNone
authorShing Chan, Aiden Doherty
requires_python>=3.8
licenseSee LICENSE.md
keywords wearable accelerometer data processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # actipy

A Python package to process accelerometer data.

Axivity3 (`.cwa`), Actigraph (`.gt3x`), and GENEActiv (`.bin`) files are supported,
as well as custom CSV files.

Axivity3 is the activity tracker watch used in the large-scale
[UK-Biobank accelerometer study](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0169649).

## Getting started

### Prerequisite

- Python 3.8 or greater
    ```console
    $ python --version  # or python3 --version
    ```

- Java 8 (1.8.0) or greater
    ```console
    $ java -version
    ```

### Install

```bash
$ pip install actipy
```

<!-- With Conda:
```bash
$ conda install -c oxwear actipy
``` -->

## Usage

Process an Axivity3 (.cwa) file:
```python
import actipy

data, info = actipy.read_device("sample.cwa.gz",
                                 lowpass_hz=20,
                                 calibrate_gravity=True,
                                 detect_nonwear=True,
                                 resample_hz=50)
```

Output:
```console
data [pandas.DataFrame]
                                 x         y         z  temperature
 time
 2014-05-07 13:29:50.430 -0.513936  0.070043  1.671264    20.000000
 2014-05-07 13:29:50.440 -0.233910 -0.586894  0.081946    20.000000
 2014-05-07 13:29:50.450 -0.080303 -0.951132 -0.810433    20.000000
 2014-05-07 13:29:50.460 -0.067221 -0.976200 -0.864934    20.000000
 2014-05-07 13:29:50.470 -0.109617 -0.857322 -0.508587    20.000000
 ...                           ...       ...       ...          ...

info [dict]
 Filename                 : data/sample.cwa.gz
 Filesize(MB)             : 69.4
 Device                   : Axivity
 DeviceID                 : 13110
 ReadErrors               : 0
 SampleRate               : 100.0
 ReadOK                   : 1
 StartTime                : 2014-05-07 13:29:50
 EndTime                  : 2014-05-13 09:50:33
 NumTicks                 : 51391800
 WearTime(days)           : 5.847725231481482
 NumInterrupts            : 1
 ResampleRate             : 100.0
 NumTicksAfterResample    : 25262174
 LowpassOK                : 1
 LowpassCutoff(Hz)        : 20.0
 CalibErrorBefore(mg)     : 82.95806873592024
 CalibErrorAfter(mg)      : 4.434966371604519
 CalibOK                  : 1
 NonwearTime(days)        : 0.0
 NumNonwearEpisodes       : 0
 ...

```

If you have a CSV file that you want to process, you can also use the data processing routines from `actipy.processing`:

```python
import actipy.processing as P

data, info_lowpass = P.lowpass(data, 100, 20)
data, info_calib = P.calibrate_gravity(data)
data, info_nonwear = P.detect_nonwear(data)
data, info_resample = P.resample(data, sample_rate)
```

See the [documentation](https://actipy.readthedocs.io/en/latest/) for more.

## License
See [LICENSE.md](LICENSE.md).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OxWearables/actipy",
    "name": "actipy",
    "maintainer": "Shing Chan",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "shing.chan@ndph.ox.ac.uk",
    "keywords": "wearable accelerometer data processing",
    "author": "Shing Chan, Aiden Doherty",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/04/3b/a553cb97d3510e1fbcce59161ff8dddb834b52c0b64597476b8097c9e676/actipy-3.0.6.tar.gz",
    "platform": null,
    "description": "# actipy\n\nA Python package to process accelerometer data.\n\nAxivity3 (`.cwa`), Actigraph (`.gt3x`), and GENEActiv (`.bin`) files are supported,\nas well as custom CSV files.\n\nAxivity3 is the activity tracker watch used in the large-scale\n[UK-Biobank accelerometer study](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0169649).\n\n## Getting started\n\n### Prerequisite\n\n- Python 3.8 or greater\n    ```console\n    $ python --version  # or python3 --version\n    ```\n\n- Java 8 (1.8.0) or greater\n    ```console\n    $ java -version\n    ```\n\n### Install\n\n```bash\n$ pip install actipy\n```\n\n<!-- With Conda:\n```bash\n$ conda install -c oxwear actipy\n``` -->\n\n## Usage\n\nProcess an Axivity3 (.cwa) file:\n```python\nimport actipy\n\ndata, info = actipy.read_device(\"sample.cwa.gz\",\n                                 lowpass_hz=20,\n                                 calibrate_gravity=True,\n                                 detect_nonwear=True,\n                                 resample_hz=50)\n```\n\nOutput:\n```console\ndata [pandas.DataFrame]\n                                 x         y         z  temperature\n time\n 2014-05-07 13:29:50.430 -0.513936  0.070043  1.671264    20.000000\n 2014-05-07 13:29:50.440 -0.233910 -0.586894  0.081946    20.000000\n 2014-05-07 13:29:50.450 -0.080303 -0.951132 -0.810433    20.000000\n 2014-05-07 13:29:50.460 -0.067221 -0.976200 -0.864934    20.000000\n 2014-05-07 13:29:50.470 -0.109617 -0.857322 -0.508587    20.000000\n ...                           ...       ...       ...          ...\n\ninfo [dict]\n Filename                 : data/sample.cwa.gz\n Filesize(MB)             : 69.4\n Device                   : Axivity\n DeviceID                 : 13110\n ReadErrors               : 0\n SampleRate               : 100.0\n ReadOK                   : 1\n StartTime                : 2014-05-07 13:29:50\n EndTime                  : 2014-05-13 09:50:33\n NumTicks                 : 51391800\n WearTime(days)           : 5.847725231481482\n NumInterrupts            : 1\n ResampleRate             : 100.0\n NumTicksAfterResample    : 25262174\n LowpassOK                : 1\n LowpassCutoff(Hz)        : 20.0\n CalibErrorBefore(mg)     : 82.95806873592024\n CalibErrorAfter(mg)      : 4.434966371604519\n CalibOK                  : 1\n NonwearTime(days)        : 0.0\n NumNonwearEpisodes       : 0\n ...\n\n```\n\nIf you have a CSV file that you want to process, you can also use the data processing routines from `actipy.processing`:\n\n```python\nimport actipy.processing as P\n\ndata, info_lowpass = P.lowpass(data, 100, 20)\ndata, info_calib = P.calibrate_gravity(data)\ndata, info_nonwear = P.detect_nonwear(data)\ndata, info_resample = P.resample(data, sample_rate)\n```\n\nSee the [documentation](https://actipy.readthedocs.io/en/latest/) for more.\n\n## License\nSee [LICENSE.md](LICENSE.md).\n",
    "bugtrack_url": null,
    "license": "See LICENSE.md",
    "summary": "Python package to process wearable accelerometer data",
    "version": "3.0.6",
    "project_urls": {
        "Download": "https://github.com/OxWearables/actipy",
        "Homepage": "https://github.com/OxWearables/actipy"
    },
    "split_keywords": [
        "wearable",
        "accelerometer",
        "data",
        "processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b9e204fd8170baf6b376af53d87c5031533b16149afe8d9661768a2c1ae0c5a",
                "md5": "ea982a8d4dcaa1b8c758f32699ff311f",
                "sha256": "832008e83cc79c0d319cf3bbbb96cbf4f256a0376692a8685966c0c850f4dbf4"
            },
            "downloads": -1,
            "filename": "actipy-3.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ea982a8d4dcaa1b8c758f32699ff311f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 54518,
            "upload_time": "2024-04-12T06:15:01",
            "upload_time_iso_8601": "2024-04-12T06:15:01.547469Z",
            "url": "https://files.pythonhosted.org/packages/2b/9e/204fd8170baf6b376af53d87c5031533b16149afe8d9661768a2c1ae0c5a/actipy-3.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "043ba553cb97d3510e1fbcce59161ff8dddb834b52c0b64597476b8097c9e676",
                "md5": "b8ac2b9817d603cbe911a8b194034a3d",
                "sha256": "44b817f85536ea200051e033ff7cd937e1c7c5876822a3a86768d83fa02b4853"
            },
            "downloads": -1,
            "filename": "actipy-3.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "b8ac2b9817d603cbe911a8b194034a3d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 71495,
            "upload_time": "2024-04-12T06:15:04",
            "upload_time_iso_8601": "2024-04-12T06:15:04.280458Z",
            "url": "https://files.pythonhosted.org/packages/04/3b/a553cb97d3510e1fbcce59161ff8dddb834b52c0b64597476b8097c9e676/actipy-3.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-12 06:15:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OxWearables",
    "github_project": "actipy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "actipy"
}
        
Elapsed time: 0.22493s