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

#1177 Added new feature of export backup as CSV file #1946

Merged
merged 2 commits into from
Apr 17, 2022

Conversation

jibraniqbal666
Copy link

@jibraniqbal666 jibraniqbal666 commented Apr 16, 2022

  • Added CSV by just making everything by breaking line.
  • Did some method extraction to avoid duplicate code.
  • Schema will looks as below.

image

Schema:

Tags
--> List of Tags
Bookmarks
--> List of Bookmarks
RecentPages
--> List of Recent Pages.

@ahmedre
Copy link
Contributor

ahmedre commented Apr 17, 2022

jazakumAllah khairan Jibran - looks good!

2 questions -

  1. if I try to import this as is into Google Drive, it might not work - what if we inline tags and add a type field so we can also inline recents? this way we just have a single table that's importable without needing to look up keys, etc? what do you think? something like:
type,sura,ayah,page,timestamp,tags
bookmark,1,,1,1650183444000,tag1|tag2|tag3
bookmark,2,1,2,1650190000,tag2
recent,15,,1650000000000,

in the above, I made a few tweaks from what you have -
I intentionally dropped ayahText - not needed, but have an ayah id that may or may not be there depending on whether it's an ayah bookmark or a sura bookmark. I changed ; to |, but not necessary, ; is fine. I also dropped the ids because they're irrelevant to someone exporting the data.

  1. why the extra space before every new line?

@jibraniqbal666
Copy link
Author

  1. if I try to import this as is into Google Drive, it might not work - what if we inline tags and add a type field so we can also inline recents? this way we just have a single table that's importable without needing to look up keys, etc? what do you think? something like:
  1. I agree, we don't need tags as list as well, we can just bookmark and recent, i made this schema, so by just seeing the data class, right we should normalize it as recent and bookmark, i will make the changes.
  2. just for the readability as i believe it will trimmed down if you import it in proper spreadsheet viewer, i can do trim before writing. :)

@jibraniqbal666
Copy link
Author

New schema:
image

@ahmedre
Copy link
Contributor

ahmedre commented Apr 17, 2022

jazakAllah khair!

@ahmedre ahmedre merged commit 6a68e1b into quran:master Apr 17, 2022
@ibardawil
Copy link

Assalamu alaikum,
import csv file doesn't work

@ahmedre
Copy link
Contributor

ahmedre commented Apr 19, 2022

wa3laikum alsalam,
this feature is just for export - there's an import/export for json format that you should use if you want to import.

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