edgemodelkit: A Python library for seamless sensor data acquisition and logging.
Project description
EdgeModelKit: Sensor Data Acquisition and Logging Library
EdgeModelKit is a Python library developed by EdgeNeuron, designed for seamless sensor data acquisition, real-time processing, and efficient logging. This library bridges the gap between IoT devices and data processing pipelines, making it ideal for edge computing and machine learning applications.
Features
- Serial Communication: Supports data acquisition over serial ports.
- Flexible Data Handling: Retrieve sensor data as Python lists or NumPy arrays.
- Real-Time Logging: Log sensor data into CSV files with optional timestamps and counters.
- Machine Learning Ready: Easily integrate with TensorFlow for on-device or server-side inference.
Installation
pip install edgemodelkit
Quick Start
1. Initialize the DataFetcher
from edgemodelkit import DataFetcher
# Initialize the DataFetcher with your serial port and baud rate
fetcher = DataFetcher(serial_port="/dev/ttyUSB0", serial_baud=9600)
2. Fetch Sensor Data
# Get data as a Python list
sensor_data = fetcher.get_data()
print("Sensor Data:", sensor_data)
# Get data as a NumPy array
sensor_data_numpy = fetcher.get_data(return_numpy=True)
print("Sensor Data (NumPy):", sensor_data_numpy)
3. Log Data to CSV
# Log 10 samples to a CSV file with timestamp and count columns
fetcher.log_data(samples=10, include_timestamp=True, include_count=True)
Example: Real-Time Data Processing
from edgemodelkit import DataFetcher
fetcher = DataFetcher(serial_port="/dev/ttyUSB0", serial_baud=9600)
while True:
# Get data as NumPy array
sensor_data = fetcher.get_data(return_numpy=True)
print("Received Data:", sensor_data)
# Perform some processing (e.g., apply a TensorFlow model)
# prediction = model.predict(sensor_data)
# print("Prediction:", prediction)
CSV Logging Details
The CSV file is named based on the sensor name (e.g., IMU_data_log.csv) and contains:
- Timestamp: (Optional) Current time when the data was logged.
- Count: (Optional) Incremental counter for the sample.
- Data Columns: Each element in the sensor data array is stored in separate columns (e.g.,
data_1,data_2, ...).
Dependencies
EdgeStream requires the following Python packages:
numpypandaspyserialtensorflow(optional for machine learning integrations)
Install dependencies with:
pip install numpy pandas pyserial tensorflow
Contributing
We welcome contributions to EdgeStream! Feel free to submit bug reports, feature requests, or pull requests on our GitHub repository.
License
EdgeStream is licensed under the MIT License. See the LICENSE file for details.
Support
For support and inquiries, reach out to us at support@edgeneuron.ai or visit our GitHub repository.
About EdgeNeuron
EdgeNeuron is a leader in edge computing solutions, empowering developers to create intelligent IoT applications with cutting-edge tools and libraries. Learn more at edgeneuron.ai.
Project details
Release history Release notifications | RSS feed
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 edgemodelkit-0.1.0.tar.gz.
File metadata
- Download URL: edgemodelkit-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0126164fa900dd622f9f9800f5ad8a9387b4f5fa1314970559a737c46ced8fab
|
|
| MD5 |
040b896bc2b248a81dc56d21ac3c3cca
|
|
| BLAKE2b-256 |
102fb4a186c65715320a1fb0ba0072bd020e753c83c549e9442d810aae412941
|
File details
Details for the file edgemodelkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: edgemodelkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f57a80b8fd4d046680d9bdd5eb8c07b779b9f11a8e5316d2bb6b94178e30d648
|
|
| MD5 |
179888a6fb6453189a8c98bd773bf451
|
|
| BLAKE2b-256 |
e4f71cb7ecd2edb3280456091e2aebb19688dbdff9762b4a97de48a254b7c487
|