-
Notifications
You must be signed in to change notification settings - Fork 74
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
Provide an ability to configure HPI sources directly #340
Comments
So let's say promnesia module takes in a JSON-like config object (instead of specific config fields, it can't interpret them anyway):
Then the promnesia module could do some dynamic magic ✨ inside and set the corresponding HPI config, roughly something like There are however some issues with this approach. It might work well in simple cases like Consider something more complicated like twitter module: https://github.com/karlicoss/promnesia/blob/master/src/promnesia/sources/twitter.py#L9-L11 In promnesia it's just importing However if you wanted to make E.g. the default HPI is this: https://github.com/karlicoss/promnesia/blob/master/src/promnesia/sources/twitter.py#L9-L11 -- it's trying to merge twitter GDPR archive + Twint export. These would correspond to However, in my personal overlay I'm also using data from Talon app on top of that ... and the config section for Talon is So that means hpi_config would have to take multiple config sections, something like this:
To be honest it looks less bad than I expected before I started typing the response, so maybe it's a feasible option after all 😅 However perhaps more realistic is making it something like this:
I guess this is still simple enough, presumably the most annoying bit is having to init a separate config file, but if it's in the same file it's better? I actually wonder if it's possible to write this magic config loader even within the current HPI/promnesia implementation (although need to experiment to find out). https://github.com/karlicoss/HPI/blob/4a04c09f314e10a4db8f35bf1ecc10e4d0203223/tests/config.py So maybe something like this:
|
Apologies for a delayed response! I originally was thinking about something closer to the latter approach where you can define the HPI configs in a way that you usually define them and Promnesia can understand and consume that (presumably including installing the HPI dependency if it's not doing that already) |
Note to self -- been playing with it today, and at the moment it's achievable with something like this (needs improvement of course, but at least it's already possible in principle)
|
properly reload/unload the relevant modules so hopefully no more weird hacks should be required relevant - karlicoss/promnesia#340 - #46
properly reload/unload the relevant modules so hopefully no more weird hacks should be required relevant - karlicoss/promnesia#340 - #46
properly reload/unload the relevant modules so hopefully no more weird hacks should be required relevant - karlicoss/promnesia#340 - #46
properly reload/unload the relevant modules so hopefully no more weird hacks should be required relevant - karlicoss/promnesia#340 - #46
properly reload/unload the relevant modules so hopefully no more weird hacks should be required relevant - karlicoss/promnesia#340 - #46
Having to set up both promnesia and HPI backends considerably adds to the complexity of the setup.
IMO it'd be a considerable improvement if I could just pass a relevant configuration to HPI sources directly from Promnesia config.
So if I'm configuring Roam:
would be something like
And then a user does not need to figure out how to set up HPI config which is literally just used to provide that export path string
The text was updated successfully, but these errors were encountered: