dpriskorn / OpenAlexAPI

Python library for the OpenAlex HTTP API
GNU General Public License v3.0
22 stars 11 forks source link

Add author endpoint #1

Closed hstct closed 1 year ago

hstct commented 2 years ago

Hi,

I added the ability to get single authors by defining their types and improving the get request method to avoid code repetition. Please let me know if there are things that can be improved.

dpriskorn commented 2 years ago

Big thanks for the pull request.

The generic type looks interesting, but also unfamiliar so I have to read up on that before merging.

dpriskorn commented 2 years ago

I looked up the TypeVar thing and I like it. Thanks for helping me get motivated to learn that :). I wrote a test for get_single_entity but it does not pass. I'll commit it here, could you take a look at it? Also I would like an enum with all possible endpoints and accept that instead of a string. Would you be willing to implement that?

dpriskorn commented 2 years ago

I found the bug and the test now pass. :)

hstct commented 2 years ago

Also I would like an enum with all possible endpoints and accept that instead of a string. Would you be willing to implement that?

Sorry, for the late reply. Sure I can take a look over the weekend if that's still necessary.