Skip to content

ubruhin/python-dlogg-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-dlogg-db

Unofficial python package to read data from a Technische Alternative D-LOGG device (using dlogg-driver) and upload it to a database.

Installation

sudo apt install libmysqlclient-dev
pip install dlogg-db

Usage

from dlogg_driver import DLoggDevice
from dlogg_db import DLoggDbUpload, DLoggDbDownload

# upload
with DLoggDevice("/dev/ttyUSB0") as device:
    with DLoggDbUpload('db-host', 3306, 'db-name', 'db-user', 'db-pw') as upload:
        upload.update_tables_format()
        upload.insert_current_data(device.get_current_data())

# download
with DLoggDbDownload('db-host', 3306, 'db-name', 'db-user', 'db-pw') as download:
  end = datetime.datetime.utcnow()
  start = end - datetime.timedelta(minutes=10)
  print download.fetch_data_range(start, end)

About

Unofficial python package to upload data from a USB D-LOGG device to a database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages