Metadata-Version: 2.1
Name: pythonCFS
Version: 0.1.2
Summary: Python wrapper for the Cambridge Electronic Design CFS library.
Author-Email: Seamus <<m0ose01@proton.me>>
License: MIT License
        
        Copyright (c) [2024] [Séamus O'Sullivan]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: C
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: pytest>=8.3.2; extra == "dev"
Requires-Dist: build>=1.2.1; extra == "dev"
Description-Content-Type: text/markdown

# Python CFS

![](https://github.com/m0ose01/pythonCFS/actions/workflows/test.yml/badge.svg)
![](https://github.com/m0ose01/pythonCFS/actions/workflows/publish.yml/badge.svg)

The Cambridge Electronic Design File System (CFS) is the file format used by the Signal Software Suite to record electrophysiological data, such as data from Transcranial Magnetic Stimulation experiments.

This is a Python wrapper for my [other project](https://github.com/m0ose01/CFS), which reimplements some of the public API of CED's own C library to read CFS files.

## Installation

Download the latest release of pythonCFS using pip:
```
pip install pythonCFS
```

If you have problems installing pythonCFS, file an [issue](https://github.com/m0ose01/pythonCFS/issues).

## Example Usage

This script loads a CFS file, `my_cfs_file.cfs`, and plots a single data section, from the first channel.

```python
from CFS.CFSFile import CFSFile
from pathlib import Path
import matplotlib.pyplot as plt

def main():
    # Load a CFS file by creating an instance of the 'CFS' class.
    file = Path("./my_cfs_file.cfs")
    data = CFSFile(file)

    channel = 0
    data_section = 0

    # Channel data are stored as native python arrays.
    plt.plot(data.channel_data[channel][data_section])
    plt.show()

if __name__ == '__main__':
    main()
```

## Future Goals

- Document public interface.
- Allow access to file/data section variables.
- Fix bugs, improve usability of public API.
- Implement support for data types other than INT2 and RL4 (will require additions to underlying C library).
