cpfair / tapiriik

tapiriik keeps your fitness in sync
https://tapiriik.com
Apache License 2.0
1.71k stars 293 forks source link

Connectors as libraries #31

Open Toilal opened 10 years ago

Toilal commented 10 years ago

Tapiriik main features is the ability to upload and download fitness data to various providers, like Garmin Connect, RunKeeper and others.

It would be nice for those features to be extracted as libraries, as others projects requires them too (see https://github.com/braiden/python-ant-downloader/issues/59 and https://github.com/Tigge/Garmin-Forerunner-610-Extractor/issues/96).

I'll have free time at the end of July to create a new github project with those libraries, but we could start speaking together about requirements and API ...

cpfair commented 10 years ago

I've wanted to do this since day one. What's held me up is that a lot of application-specific tweaks and handling has made it into the service modules (e.g. sync trigger polling, Dropbox's two-level authorization and local cacheing, GC rate limiting), making them somewhat useless on their own. The fact that I regularly revamp swaths of the service contract doesn't help, either.

Ideally, for each service there'd be the standalone module that provides just the basics without any dependencies (especially mongo and redis), then an adaptor that inserts all that stuff which only tapiriik requires. This would present a challenge of making the standalone modules flexible enough - and flexible in a standard way - that all the required hooks could be inserted. Not impossible, but I've always focused my efforts on keeping https://tapiriik.com running smoothly.

What do you think?

Toilal commented 10 years ago

I've read tapiriik code quickly, and i think it's still possible, but as you say it requires a lot of refactoring.

I'll be off for 3 weeks on holidays, but I'll have spare time right after because i'm leaving my current job. I'll try to implement a single standalone connector for Garmin Connect, and integrate it in forks of tapiriik, python-ant-downloader and forerunner 610 extractor.

See this as proof of concept, to check if it is feasible and useful ... Maybe it'll just fail, maybe it'll be convenient for everybody, I just want to give a try.

I have opened a repository here for the common connectors : https://github.com/Toilal/tapiriik-connectors, but don't expect anything before end of July.

Thanks for you good work on Tapiriik, it's a really good web tool :)

aspiers commented 10 years ago

Cool, thanks a lot guys for looking at this!