Show HN: Muler, a search engine for drug info built with Flask
muler.pythonanywhere.com
muler.pythonanywhere.com
Muler is a Flask app that allows users to search for pharmacological information by entering generic or proprietary drug names. External libraries used include Flask, SQLAlchemy, and FuzzyWuzzy.
This is a hobby project I made during my final year of medical school. As far as I can tell from the logs there are no more than five humans who use it semi-regularly (lots of bots pinging though). I don't mind because I find it very useful personally, and I've also learned a lot about Python, web dev, and databases.
Right now I'm trying to refactor the code (just wrote my first class) and implement unit tests (just started reading the Pytest docs), so I'd really appreciate specific feedback and tips about those.
Thanks for your time!
As a layperson, I searched for "aspirin" and got a result for "Acetylsalicylic acid" and I didn't know if the search result was even correct. If it had said "Acetylsalicylic acid is a synonym of aspirin", things would have made sense immediately.
(I think Wikipedia displays such types of disambiguation info at the top of their pages.)
Thanks for pointing that out :) I'll have to do some tweaking.
A few questions though:
- is the indentation of section headings, such as "Indication", "Pharmacodynamics", etc, intentional? The yellow highlight seems to take care of the emphasis on its own. It feels, to me, it should either be one or the other.
- when sections (e.g. "Pharmacodynamics") include clear points of emphasis within them (e.g. asterisks for bold), then could those perhaps be rendered as sub-headings for increased readability? An example can be seen when searching for "codeine": https://muler.pythonanywhere.com/codeine
Yeah I indented the headings but you're right, it looks better with the highlighting alone.
That's a good suggestion about subheadings. I'll try to do something with regex - shouldn't be too difficult I imagine.
Thanks for taking the time to test it and give feedback :)
If you want an idea for a future project, I conceived a little while ago of a browser extension enabling hover-over drug info pop-ups in the same vein as YomiChan (a tool providing mouse-over definitions for Japanese language learners). Maybe I’ll get to that at some point.
One thing I've noticed is that the first line under the drug name, I guess is the category? Some of them are probably a bit more specific than they need to be, like ibuprofen: https://muler.pythonanywhere.com/Ibuprofen
You could take the summary from DrugBank instead of a category, but that might have other issues too.
Either way, I'll probably come back and use this in the future!
Thanks very much for the feedback :)
Regarding your request on unit tests : do not do too much of them, too low-level. Try to write tests whose output should not change, should you refactor, this way they will help you avoid side-effects of refactoring. If your unit tests are too low-level, you will need to change them everytime you change your code.
One good think to test would be your fuzzy-matching logic, with edge cases taken into account.
Happy hacking !
Edit: it was available over the counter and was pitched as a less addictive alternative to morphine
Thanks for the helpful advice re unit tests!
Could definitely need some speed improvements or at least some indication of what's going on. Loading spinners are a band-aid, but are better than nothing.
Thanks so much for trying it out and giving your suggestions!
Thanks!
This is aimed at the general public. An API is also available:
https://developer.api.nhs.uk/nhs-api/documentation/5b8e85b39...
EDIT: seems to be up now.