Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv exporter, config-file #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
57 changes: 36 additions & 21 deletions README.asciidoc → README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
= libfitbit =
libfitbit
=========

by Kyle Machulis <[email protected]>

Nonpolynomial Labs - http://www.nonpolynomial.com
Nonpolynomial Labs - [http://www.nonpolynomial.com](http://www.nonpolynomial.com)

libfitbit is part of the OpenYou project for Open Source Health
Hardware access - http://openyou.org
Hardware access - [http://openyou.org](http://openyou.org)

If you find libfitbit useful, please donate to the project at
http://pledgie.com/campaigns/14375
[http://pledgie.com/campaigns/14375](http://pledgie.com/campaigns/14375)

Join the libfitbit group on fitbit.com: http://www.fitbit.com/group/227FRX

== Credits and Thanks ==

Credits and Thanks
------------------
Thanks to Matt Cutts for hooking me up with the hardware -
http://www.twitter.com/mattcutts

== Description ==

Description
-----------

libfitbit is an implementation of the data retrieval protocol for the
fitbit health tracking device. It also implements a synchronization
Expand All @@ -40,62 +43,74 @@ be used for implementing the protocol in new languages without having
to read code (not that my ability to convey the protocol in english is
all that clear).

== Package Information ==

Source repo @ http://www.github.com/qdot/libfitbit
Package Information
-------------------

Source repo @ [http://www.github.com/qdot/libfitbit](http://www.github.com/qdot/libfitbit)


== Platform Support ==
Platform Support
----------------

* Linux - Tested on Ubuntu 10.10
* OS X - Untested, should work?
* Windows - Won't work at the moment. May be able to create serial
interface to talk to CP2012 chip? Haven't done research yet.

== Library Requirements ==

Library Requirements
--------------------

* Python - http://www.python.org
* libusb-1.0 - http://www.libusb.org
* pyusb 1.0+ - http://sourceforge.net/projects/pyusb/files/

== Platform Cavaets ==

=== Linux ===
Platform Cavaets
----------------

### Linux

You'll need to either run as root or set up a udev rule to switch out
permissions on the base VID/PID. We'll hopefully have a udev rule
checked in shortly.

=== OS X ===
### OS X

FitBit original driver is claiming the device resulting in premission errors
when libusb wants to claims it.

A solution that works everytime is simply to disable the driver by renaming
it:

----
```bash
cd /System/Library/Extensions
sudo mv SiLabsUSBDriver.kext SiLabsUSBDriver.kext.disabled
----
```

And reboot.

To re-enable it, just rename it again, and reboot again.

=== Windows ===
### Windows

Don't even know if it works there yet. :D

== Future Plans ==

Future Plans
------------

* Breaking ANT access library out into its own repo
* Windows support
* Finish figuring out data types
* Implement library in C

== License ==

---------------------
License
-------

```
Copyright (c) 2011, Kyle Machulis/Nonpolynomial Labs
All rights reserved.

Expand Down Expand Up @@ -128,4 +143,4 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------
```
22 changes: 22 additions & 0 deletions python/client_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ConfigParser, os

class ClientConfig(object):
"""
Example-Configuration

[output]
dump_connection = True
write_csv = False
"""

def __init__(self):
self.parser = ConfigParser.SafeConfigParser({'dump_connection':False, 'write_csv':False})
config_path = os.path.expanduser('~/.fitbit/config')
if os.path.exists(config_path):
self.parser.read(config_path)

def dump_connection(self):
return self.parser.getboolean('output', 'dump_connection')

def write_csv(self):
return self.parser.getboolean('output', 'write_csv')
Loading