Skip to content

Commit 37e94e9

Browse files
committed
more and better examples
1 parent e8fe014 commit 37e94e9

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# LSLKit
2+
Python library to help write Python code that interacts with Lab Streaming layer
3+
4+
### Replay From File
5+
As a library
6+
```python
7+
from lslkit.components import outlets
8+
file_out = outlets.FileReplayOutlet('my_lab_time_series.mat', stream_type='EEG',
9+
srate=300, data_key='eeg')
10+
file_out.begin()
11+
```
12+
13+
From the Command line
14+
```bash
15+
python -m lslkit.replay_from_file --file-path=my_lab_time_series.mat --data-key=eeg --stream-type=EEG --sample-rate=300 --chunksize=1
16+
```
17+
18+
### Processing a stream
19+
```python
20+
from lslkit.components import processor
21+
proc_f = lambda _df: _df.mean()
22+
# Find a matching stream and build a processor around it
23+
proc = processor.ProcessStream.from_resolve(proc_f, 'emg', max_buflen=512)
24+
# Pull data until each dataframe has the required_size samples
25+
proc.begin(required_size=51)
26+
```

0 commit comments

Comments
 (0)