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

Extract Readwise API into its own sdk project #7

Open
renehernandez opened this issue Apr 6, 2021 · 9 comments
Open

Extract Readwise API into its own sdk project #7

renehernandez opened this issue Apr 6, 2021 · 9 comments
Labels
enhancement New feature or request
Milestone

Comments

@renehernandez
Copy link
Owner

renehernandez commented Apr 6, 2021

This would allow to more easily:

  • Implement retry mechanism when reaching rate limits against Readwise
  • Auto-paginate, when pulling more documents/highlights than the page_size value
  • Test the implementation
  • Mock the API interface in obsidian-readwise for better testing
@renehernandez renehernandez added the enhancement New feature or request label Apr 6, 2021
@renehernandez renehernandez added this to the 1.0.0 milestone Apr 6, 2021
@technicalpickles
Copy link

technicalpickles commented May 13, 2021

I'm taking a Building a Second Brain course, and there was a session with the folks from Readwise. I asked:

Do you have any resources you'd recommend for developers wanting to integrate with Readwise? I'm using Obsidian, and there is a community plugin, but it only lets you pull in highlights once you install the plugin. I've read the API docs which look super helpful to get started, but looking for patterns like... pulling down existing highlights initially

And they answered:

If you need some assistance with our API, just email us [email protected] and we’ll be happy to help with your workflow.

@technicalpickles
Copy link

Is the thought to make this a separate package on like NPM? Or extract in a different sense?

@technicalpickles
Copy link

For testing, I think we could use a combination of:

I'm going to start a branch to start playing with those ideas.

@renehernandez
Copy link
Owner Author

If you need some assistance with our API, just email us [email protected] and we’ll be happy to help with your workflow.

Most likely, this is due to them working on their own Readwise plugin

Is the thought to make this a separate package on like NPM? Or extract in a different sense?

That is something I am considering. The idea of extracting to a separate API would be the best route IMO. There is another Readwise plugin, that it has an API that already supports this features, see here.

@technicalpickles
Copy link

There is another Readwise plugin, that it has an API that already supports this features, see here.

Would you be able to use that client? There is not a license in the repository unfortunately. @jsonMartin any chance of adding a license to your repository?

@jsonMartin
Copy link

Hey @technicalpickles , sure thing. Just went ahead and added a MIT license to the repo 👍

@technicalpickles
Copy link

That's great, thanks! I took a closer look, and the only thing that would need to change in the library is that it uses Notify for updating the status bar. This plugin has its own way to use that, so I think it would just need a more general hook for when there is a status update.

@technicalpickles
Copy link

Trying to drop the API in as is within minimal modifcation was probably overly optimistic 🤔 What I'm thinking now is to:

  • start with the API client in
  • refactor out a parent class that is more generalized (ie handling things like auth + 429)
  • import that parent class into obsidian-readwise
  • refactor obsidian-readwise's API client to use the generalized API client

I don't know how much time I'm going to be put towards it and on what time scale, but I will keep this issue updated.

@renehernandez
Copy link
Owner Author

@technicalpickles Sounds good. If you start working on a separate repo for the Readwise API, share it here. I can contribute to it after finishing with the improvements left for v0.1

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

No branches or pull requests

3 participants