Skip to main content

Python package for reading Onset Hobo sensor csv files

Project description

hoboreader

Python package for reading Onset Hobo sensor csv files

Any problems? Please raise an Issue on GitHub

To install:

pip install hoboreader

Quick demo:

The following code reads a Hobo csv file and converts it to a pandas DataFrame:

from hoboreader import HoboReader
h=HoboReader('sample_hobo_data.csv')
df=h.get_dataframe()

The DataFrame looks like this:

dataframe_screenshot

User Guide

Importing the HoboReader class:

from hoboreader import HoboReader

Creating an instance of HoboReader and reading in a Hobo data csv file:

Either:

h=HoboReader()
h.read_csv('sample_hobo_data.csv')

or:

h=HoboReader('sample_hobo_data.csv')

Working with attributes

As the csv file is read in, a number of attributes are populated. These are:

h.reader # a Python csv.reader object
h.header_row # a list of the header row of the csv file
h.header_list # a list of dictionaries with the header row information
h.hobo_timezone_str # a string of the timezone as expressed in the header row
h.timezone # a Python datetime.timezone instance
h.data_rows # a list of each row of the timeseries measured data
h.data_columns # a list of each column of the timeseries measured data
h.datetimes # a list of the timestamps converted to Python datetime.datetime instances 

See the attributes_demo.ipynb Jupyter Notebook in the 'demo' section for more on these attributes.

Creating a Pandas DataFrame

A Pandas DataFrame can be created using:

df=h.get_dataframe()

See the dataframe_demo.ipynb Jupyter Notebook in the 'demo' section for how to work with this dataframe.

Creating rdf data

The Hobo data can be converted to rdf data using:

g=h.get_rdf()

See the rdf_demo.ipynb Jupyter Notebook in the 'demo' section for how to work with the rdf data.

Getting the sensor serial number

A function which return the sensor serial number:

sn=h.get_sensor_serial_number()

Project details


Release history Release notifications

This version

0.0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hoboreader, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size hoboreader-0.0.2-py3-none-any.whl (6.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size hoboreader-0.0.2.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page