Python interface for NeuLog sensors with real-time visualization
Project description
NeuLogPy
A Python interface for NeuLog sensors, providing easy-to-use functions for data collection, experiment management, and real-time visualization.
Features
- Simple interface for NeuLog sensors
- Real-time data collection and visualization
- Configurable sampling rates
- Support for multiple sensors
- Automatic sensor discovery and configuration
- Built-in error handling and logging
- Interactive respiratory data visualization
Installation
pip install NeuLogPy
Quick Start
Basic Data Collection
from NeuLogPy import NeuLog
import time
# Initialize NeuLog with config file
neulog = NeuLog(config_file="config/sensors.yaml")
# Setup experiment parameters
sensor_name = "Respiration"
rate = 8 # 8 Hz sampling rate
samples = 1000 # Number of samples to collect
respiration_sensor = [(sensor_name, 1)] # Sensor name and ID
time_to_wait = samples / 8 # 8 Hz sampling rate
# Start experiment
neulog.start_experiment(sensors=respiration_sensor, rate=rate, samples=samples)
time.sleep(time_to_wait)
# Get samples
samples = neulog.experiment.get_samples()
if samples:
print(f"Respiration Samples: {samples}")
# Stop experiment
neulog.experiment.stop()
Real-time Visualization
You can use the built-in visualization tool for respiratory data:
# Run from command line
neulog-respiratory-viz
Or in your Python code:
from NeuLogPy.respiratory_visualization import RespiratoryVisualizer
# Create and run visualizer
app = RespiratoryVisualizer()
app.setup_gui()
app.run()
The visualization provides:
- Real-time plotting of respiratory data
- Adjustable time window (default: 60 seconds)
- Auto-scaling axes
- Sample rate: 100 samples/second
Configuration
Create a sensors.yaml file in your config directory:
sensors:
Respiration:
id: 1
name: "Respiration"
type: "respiratory"
units: "arbitrary"
Requirements
- Python 3.7+
- NeuLog Software and Drivers
- Connected NeuLog Sensor
Dependencies
- pydantic >= 2.0.0
- requests >= 2.25.0
- pyyaml >= 5.4.0
- dearpygui >= 1.9.0 (for visualization)
Development
To contribute to NeuLogPy:
- Clone the repository
git clone https://github.com/sustronics/neulogpy.git
- Install development dependencies
pip install -r requirements.txt
- Run tests
pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support, please contact info@sustronics.com or open an issue on GitHub.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neulogpy-1.3.0.tar.gz.
File metadata
- Download URL: neulogpy-1.3.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f3480b9d4250f105e870c13a8ba86b23ff589fba56e43a66b4e2a50d4cc72bd
|
|
| MD5 |
badd58c59e9198e4e05204b263b27366
|
|
| BLAKE2b-256 |
fff219ffb3a97aa902e89a2f24f9476e585f62f59a1ba4083267c572ac47babe
|
File details
Details for the file NeuLogPy-1.3.0-py3-none-any.whl.
File metadata
- Download URL: NeuLogPy-1.3.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70c7cd631186646ec2cf83dc39ea389cb52c6a6b84c5386fedecaf4c8a221bf8
|
|
| MD5 |
fd070d7bd2d791f980e58baef1a38257
|
|
| BLAKE2b-256 |
5841945055e3fd222e462c41ee224c5cf89630866373dfed492ce1b8621897a4
|