sneakers-the-rat / paper-feeds

A FastAPI web server for creating RSS feeds for scholarly journals with the magic of adversarial interoperability
GNU General Public License v3.0
60 stars 4 forks source link

source journal's homepage_url from OpenAlex #31

Closed smierz closed 4 months ago

smierz commented 6 months ago

This PR sources homepage_urls for journals from OpenAlex:

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 7441611676


Totals Coverage Status
Change from base Build 7435789001: -3.6%
Covered Lines: 371
Relevant Lines: 502

💛 - Coveralls
smierz commented 5 months ago

thanks for the quick review, I will look into it asap, but probably due to work not before the weekend :/

smierz commented 5 months ago

update:

smierz commented 5 months ago

re:config

i do have a mild preference for treating the Config object as a singleton that gets instantiated when used or passed explicitly, rather than created as a module-level object - the goal is to have config be single-source and so we want to strongly discourage storing and modifying it.

hmm I think we were both going for a singleton approach, but the difference is the passing of parameters: I was going for imports (=import singleton config from config.py) while you would prefer dependency injection (pass parameters from config singleton in app.py)

Both are valid approaches for handling config propagation in applications and I'm ok with either. The only concern I have is with creating new Config objects around the application (like crossref.crossref_get does) because I do not want the config to be mutable from outside the application (= environment variables) during runtime (good luck finding this "bug" if user accidentally changes them).

Anyway, I kicked out the config variable from config.py and switched to dependency injection passing the email parameter through to openalex._openalex_get

sneakers-the-rat commented 4 months ago

Sry for the delay, will merge when I get to keyboard. I think ill deploy this today too

sneakers-the-rat commented 4 months ago

thanks for this! looks great :)

sneakers-the-rat commented 4 months ago

Released in v0.0.5 :) https://github.com/sneakers-the-rat/paper-feeds/releases/tag/v0.0.5 https://github.com/sneakers-the-rat/paper-feeds/tree/v0.0.5 https://pypi.org/project/paper-feeds/0.0.5/