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 more data to Reading Log Export Option #4796

Closed
Yashs911 opened this issue Mar 11, 2021 · 15 comments
Closed

Add more data to Reading Log Export Option #4796

Yashs911 opened this issue Mar 11, 2021 · 15 comments
Labels
export Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Public APIs Issues related to APIs accessible to external parties. [managed] Theme: Reading Log Related to workflows for creating, modifying, displaying a user's reading log. [managed]

Comments

@Yashs911
Copy link
Contributor

I exported my reading log and the data I got:
image

While I did a similar export from Goodreads and the data I got:
image

Describe the problem that you'd like solved

So I believe we can add Title, Author, Year of Publication, Ratings, ISBN e.t.c

Stakeholders

@mekarpeles

@Yashs911 Yashs911 added Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] labels Mar 11, 2021
@cclauss
Copy link
Collaborator

cclauss commented Mar 12, 2021

https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L884 would be a good starting point.

@cclauss cclauss added Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] and removed Needs: Lead labels Mar 12, 2021
@shrey27tri01
Copy link
Contributor

Can I work on this issue?

@cclauss
Copy link
Collaborator

cclauss commented Mar 17, 2021

@shrey27tri01 Thanks for your interest. You do not need to wait for permission. If you feel like you can fix this issue then please submit a pull request. Let us know if you need any help.

@cclauss
Copy link
Collaborator

cclauss commented Mar 26, 2021

How is this effort going? Any blockers?

@Yashs911
Copy link
Contributor Author

Yashs911 commented Mar 26, 2021

@cclauss I also tried to solve this issue but the function get_users_logged_books doesn't return any useful information apart from work_id (int) - the Open Library work ID as an int (e.g. OL123W becomes 123) so I was wondering how can we use the work_id to extract info regarding title, author, YOP e.t.c

Am I on the right track?

I also thought of using this function but was getting some kind of error:

works = readlog.get_works(key, page=1, limit=2000)

@cclauss
Copy link
Collaborator

cclauss commented Mar 26, 2021

At the url provided above you should see for book in books: where I believe that each book will be a Python dict so you should be able to print(list(book)) to see what fields (keys) are available. You can then add book["supercool_key"] to row and see if that value shows up.

@shrey27tri01
Copy link
Contributor

@cclauss Sorry for the dumb question, but I'm unable to print anything on the console using print(list(book)) inside the loop for book in books: after clicking on the "Download" button. I also tried printing just books after the books variable is initialized, but I still don't get any output. On the other hand, using the print statement inside another function, say the import_books(): function gives me an output on the console correctly.

@cclauss
Copy link
Collaborator

cclauss commented Apr 2, 2021

Try print(list(book), file=web.debug)

@cclauss
Copy link
Collaborator

cclauss commented Apr 2, 2021

Did that work?

@shrey27tri01
Copy link
Contributor

@cclaus Yes, that worked, thank you very much!
Printing list(book) gives me the following keys: ['username', 'work_id', 'bookshelf_id', 'edition_id', 'updated', 'created']
Now can I use this information to look up book name, author, title, isbn etc. using readlog.get_works(key, page=i.page) like the way it is used in this function?

@mekarpeles mekarpeles changed the title Improve Export Option Add more data to Reading Log Export Option Feb 22, 2022
@mekarpeles mekarpeles added export Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Public APIs Issues related to APIs accessible to external parties. [managed] Theme: Reading Log Related to workflows for creating, modifying, displaying a user's reading log. [managed] and removed Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] labels Feb 22, 2022
@mekarpeles
Copy link
Member

Just a reminder that the data for these books is not in the DB so some sort of join may be necessary (or using solr). One thing we could do is provide a script which allows one to take their reading log dump and then pull all of the corresponding data. This would be a great good first issue if someone wanted to work on it.

The central issue here is performance -- we're exporting the entire Reading Log which can have tens of thousands of items (and I know at least 5 reading logs which do, having done this query, lol). Joining this w/ solr data or infobase behind the scenes is problematic for the same reasons as Lists.

having a separate e.g. ol-client thing or script to take the dump (offline) and then fetch the underlying items seems useful but hard to do on the website unless we kick off some offline dump like e.g. facebook does for "downloading your data".

Having a javascript thing which does something like this could be a good approach (@cdrini's idea, I like it)

@tuminzee
Copy link
Collaborator

@shrey27tri01 would you be still interested in taking this one?

@shrey27tri01
Copy link
Contributor

@tuminzee I am not currently working on this issue. You can go ahead, please. Also, really sorry for the late response :)

@tuminzee
Copy link
Collaborator

tuminzee commented Mar 7, 2022

Thank you for the response @shrey27tri01

@jimchamp
Copy link
Collaborator

Closed by #6621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
export Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Public APIs Issues related to APIs accessible to external parties. [managed] Theme: Reading Log Related to workflows for creating, modifying, displaying a user's reading log. [managed]
Projects
None yet
Development

No branches or pull requests

6 participants