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 ability to import from openScale backup #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NewYearNewPhil
Copy link

Just stumbled upon trale, love the design!

I use openScale to pull measurements from a bluetooth scale, and I'd love to be able to take that data into trale.

openScale offers .csv backups (although this is somewhat hidden, the .csv files are only created using the "auto backup" feature, not the manual backup). I've attached an
example for reference.

This PR adds support for this format to trale, differentiating the formats by their respective extensions (txt and csv). The openScale format parsing is naive, it doesnt reference the included headers but just targets the specific fields, so if this format changes, the logic here will likely break.

If there's interest, I can implement proper csv parsing logic, for now this approach works well for the latest openScale version.

Would love to see this get merged so I don't need to maintain my fork to use upstream updates! Let me know if any changes are needed or there are problems with this.

@braniii
Copy link
Contributor

braniii commented Jan 17, 2024

Thx! This sounds like a great feature :)
It will definitely land in this project. I will try to review it next week.

@9glenda 9glenda mentioned this pull request Jan 19, 2024
@braniii
Copy link
Contributor

braniii commented Jan 23, 2024

@NewYearNewPhil thx for your patience. So, I like the feature and I prefer to not add an additional dependency for parsing csv files. Nevertheless, your code introduces duplication of logic and contains some redundant (at least as far as I can judge 🤔 ) code.

I guess, to support a possible .csv export (see #22) it would be good to parse the columns based on the given keys when reading the first line starting with ". What do you prefer, should I add the minor fixes myself, or do you prefer that I start a review, so that you can finish up this PR on your own?

@braniii braniii added this to the v0.9.0 milestone Oct 2, 2024
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.

2 participants