Skip to content

Comments

[Offering] Functionality to import data from "My Calendar"#240

Open
Paupa wants to merge 3 commits intoEmmaTellblom:mainfrom
Paupa:MyCalendarImporter
Open

[Offering] Functionality to import data from "My Calendar"#240
Paupa wants to merge 3 commits intoEmmaTellblom:mainfrom
Paupa:MyCalendarImporter

Conversation

@Paupa
Copy link

@Paupa Paupa commented Mar 29, 2025

Related to enhancement #140 "Support of importing data from other apps"

I made a function to import data from "My Calendar" / "Period Calendar" (I don't know what's its name in English...). I thought that you might be interested in taking a look at it. The function is by no means ready for your scope right now, as it only imports from files that are written in Spanish because I made it for myself. But I think that it wouldn't be hard to broaden the languages that it supports by adding some Lists.

"My Calendar" makes backups in a .pc file extension that I haven't found how to read correctly. The only way to get readable data is with the "Export data for your doctor" option, that generates a .txt. In function transformMyCalendarFormatToMensinatorFormat() I read the .txt and transform it into a JSON that follows Mensinator's way of structuring data. Then it is imported normally.

@carstenhag
Copy link
Collaborator

Hey, thanks for the contribution, first of all! Really great to see more development members :).

I have thought a bit about this, in my opinion it would perhaps be okay to integrate if we would guide the user to for example always create the export in english. That way, we can make use of the txt file, without having to support multiple languages on import level.

But imo we would still have to separate out the normal import from 3rd party apps, maybe a list would be useful: "Import from: Mensinator, My Calendar". There, the doctor export in english could be specified.


@EmmaTellblom What do you think about this? The problem of having this kind of 3rd party import (especially this txt-based, perhaps flaky one) is that we have to keep maintaining it, despite us not using those 3rd party apps. In my opinion it would also be okay to say "Please manually input periods/symptoms from the other app", as I would guess one doesn't need info from more than 6 months ago?

@EmmaTellblom
Copy link
Owner

@carstenhag My plan was to have different options when importing, if the file comes from Mensinator or (for example) Flo, Clue or "My calendar". So when importing you choose which app the source is. This will make it much easier for users to migrate to our app instead and hopefully increase number of users.
It will require some maintenance if other apps changes their export methods, but I don't think this is too common. And I actually think the history is very important, so if we have an export from other apps that has a lot of data, we should import all of the data. But it will ofc have to be limitations to what we can/can't do.

@dydyamotya
Copy link

Hi, I've just spend a day reverse engineering the My Calendar application to find out how .pc file is constructed.
Thanks to AI I've succeeded in it. If your are interested, I'll add a .java file for parsing .pc file here.
It is just a hacked zip-archive with sqlite database in it.
PcUnzipper.java
I don't know at which point the developers of My Calendar will change the format, but for current versions of app this java code should work.

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.

4 participants