Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Plotly Dash application to interact with the API endpoints of openFDA

License

NotificationsYou must be signed in to change notification settings

jackdbd/dash-fda

Repository files navigation

License: MITBuild StatusCoverageCode style: black

A Dash app to visualize data from the openFDA elasticsearch API.

A GIF file showing a short demo on how to use the Dash FDA dashboard

App on CapRover.

Built with:

Data fromopenFDA.

API keys

This project requires to get some API keys from external services.

Installation

This project usespyenv andpyenv-virtualenv to manage the Python virtual environment, andpoetry to manage the project dependencies.

If you don't already have it, install python3.8.5.

pyenv install 3.8.5

Create a virtual environment and activate it.

pyenv virtualenv 3.8.5 dash_fdapyenv activate dash_fda

Remember to activate the virtual environment every time you work on this project.

Install all the dependencies from thepoetry.lock file.

poetry install

Tasks

This project uses the task runnerPoe the Poet to run poetry scripts.

Non-dockerized app

Run the app locally using a development server (Dash uses a Flask development server):

poetry run poe dev# or, in alternativepython app.py

Run the app locally using a production server (gunicorn):

poetry run poe prod

Run all tests with pytest:

poetry run poetest

Format all code with black:

poetry run poe format

Dockerized app

Build the Docker image and give it a name and a version tag:

docker build -t dash-fda:v0.1.0.

Run the Docker container:

docker run --env-file ./dash_fda/.env -p 5001:5000 dash-fda:v0.1.0

Deploy the dockerized app on CapRover (running on my DigitalOcean Droplet):

./deploy.sh

Troubleshooting

If you are on Ubuntu you might getModuleNotFoundError: No module named '_bz2' and/orUserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError. These errors are caused by pandas when it tries to import thesecompression libraries. If you get these errors you need to install the libbz2-dev package and the liblzma-dev package, then re-compile your python interpreter.

Here is how you can do it:

# deactivate and remove the virtual environmentpyenv deactivatepyenv virtualenv-delete dash_fda# remove the "broken" python interpreterpyenv uninstall 3.8.5# install the compression libreriessudo apt-get install libbz2-dev liblzma-dev# download and compile the python interpreterpyenv install 3.8.5# re-create the virtual environment and activate itpyenv virtualenv 3.8.5 dash_fdapyenv activate dash_fda# re-install all the dependenciespoetry install

Disclaimer

This app is just an independent project, and it has not been evaluated by the Food and Drug Administration.This app is not intended to diagnose, treat, cure, or prevent any disease.Do not rely on this app to make any decision regarding medical care.

About

A Plotly Dash application to interact with the API endpoints of openFDA

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp