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

Add a few more my interfaces #158

Closed
wants to merge 7 commits into from
Closed

Conversation

madelinecameron
Copy link

@madelinecameron madelinecameron commented Apr 7, 2021

Addresses #64

  • Withings
  • Level Health
  • Eight Sleep
  • ActivityWatch (local-only RescueTime, also write my own synchronization code so you can sync multiple computer's AW data)
  • Typeform
  • Todoist

Unfortunately the extractors are written in node then I wrote DALs for each in Python. Maybe I am being presumptive but I think exposing the idea that HPI doesn't have to be solely in python is fun. Love being able to leverage Python's data library ecosystem though, much better than node for this 😂.

The my interfaces are pretty barebones and may not be up to standards, so happy to modify if there is a certain standard or direction you like better.

@madelinecameron madelinecameron marked this pull request as ready for review April 7, 2021 12:35
@purarue
Copy link
Contributor

purarue commented Apr 7, 2021

Ah, I didn't realize you weren't watching this repo, so you may have not seen the issue I raised here

To expand on it a bit;

I used to maintain a direct fork/merge commits from this repo back into my own copy of HPI here, but that became more and more difficult to as time went on...

The solution for me was in the SETUP.org file all along (described as the 'proper way')

I've since stopped merging commits that, and now install both packages as editable, which means I keep up to date with this repository and can still add/overlay modules on top of that

i.e. you can have multiple my/ directories installed at the same time, if they're installed as namespace packages (relevant lines in setup.py here and here):

 $ python3
In [1]: from my.coding.commits import commits  # something from karlicoss/HPI

In [2]: from my.zsh import history  # something from my own repo

Another example of an overlay here

Not saying these items can't be merged into here, thats up to karlicoss, I've just found HPI to be more useful as a configuration/caching layer, giving me all the tools to load my data, but everyone uses different services/data sources, so I'd rather keep modules on my own branch. Otherwise, we'd eventually have hundreds of data sources in this one repository, and I don't know if anyone wants to maintain that 😅

import levelshealth.dal as dal


def glucoseScores():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you annotate return types with Iterator (even Iterator[Any] should do), then hpi doctor my.levelshealth would discover them (so you won't need manual stats function)

my/levelshealth.py Show resolved Hide resolved
my/levelshealth.py Show resolved Hide resolved
my/eightsleep.py Show resolved Hide resolved
@karlicoss
Copy link
Owner

karlicoss commented Apr 7, 2021

Unfortunately the extractors are written in node then I wrote DALs for each in Python

No that's cool, and I'm definitely pro using whatever tools people can use!

Not saying these items can't be merged into here, thats up to karlicoss, I've just found HPI to be more useful as a configuration/caching layer, giving me all the tools to load my data, but everyone uses different services/data sources, so I'd
rather keep modules on my own branch.

Yep, definitely suggest trying this approach out too!

Otherwise, we'd eventually have hundreds of data sources in this one repository, and I don't know if anyone wants to maintain that

Having too many modules is definitely an issue -- I dread the fate of the Spacemacs maintainer! I think for now I'm basically happy to merge things, stuff doesn't seem to break much; but need to start thinking of ways to making it more manageable in advance perhaps.

Although I would prefer if they had tests/ example data pointers somewhere, since otherwise I can't guarantee I won't break it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants