Logs data coming from a serial port
Project description
Serial Data Logger
A simple python script that logs the input received from a serial (USB) input to an SQLite database along with logging the time stamp (in the format YYMMDDHHMMSS) of the received message.
Serial data logger expects the serial inputs to be comma separated.
Install
pip install serialdatalog
Usage
Here's an example using a Finometer pressure sensor.
import logging
import serialdatalog as sdl
logging.basicConfig(level=logging.INFO)
# table_dict is formed of key : value pairs consisting of:
# sql_header : sql_data_type
# If the number of headers is different to that read from the serial input then the input is not
# logged.
table_dict = {
"Elapsed_Time" : "REAL",
"Finger_Pressure" : "REAL",
"Height" : "REAL",
"Arm_Pressure" : "REAL",
"Finger_Plethysmogram" : "REAL",
}
sdl.logger(
table_dict,
source="/dev/ttyACM0",
dest="datalog.sqlite3",
encoding='utf-8',
timeout=10
)
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 serialdatalog-0.1.7.tar.gz.
File metadata
- Download URL: serialdatalog-0.1.7.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.10 Linux/6.1.27-gentoo-dist
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba82ce2b12feb9fbebc397c72b0f14da5cea4458ef3c0497fcadaeec02a06761
|
|
| MD5 |
1b8f9b9a18efe314188140fc129b22a7
|
|
| BLAKE2b-256 |
2daf9a0a17c3df148dd87da468bb1dedf4d094de1d84152fa8a5231b4af0943f
|
File details
Details for the file serialdatalog-0.1.7-py3-none-any.whl.
File metadata
- Download URL: serialdatalog-0.1.7-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.10 Linux/6.1.27-gentoo-dist
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0643362ac4cdc8670084c305eaa0bf670b172281e603719c6a970697993c7f48
|
|
| MD5 |
33e450abc98c073d0c84b87c79341f03
|
|
| BLAKE2b-256 |
a71f77f082f969eafdcd87044da8d5adc807fcec836beeb2196c4585dd568cd8
|