{"id":15392688,"url":"https://github.com/jackdbd/dash-fda","last_synced_at":"2025-04-15T23:28:00.080Z","repository":{"id":48215027,"uuid":"102153702","full_name":"jackdbd/dash-fda","owner":"jackdbd","description":"A Plotly Dash application to interact with the API endpoints of openFDA","archived":false,"fork":false,"pushed_at":"2020-09-30T11:19:48.000Z","size":3072,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T17:37:22.951Z","etag":null,"topics":["dash","dashboard","fda","plotly"],"latest_commit_sha":null,"homepage":"https://cutt.ly/dash-fda","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackdbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-01T21:16:07.000Z","updated_at":"2024-03-26T10:07:15.000Z","dependencies_parsed_at":"2022-09-01T06:31:32.000Z","dependency_job_id":null,"html_url":"https://github.com/jackdbd/dash-fda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fdash-fda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fdash-fda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fdash-fda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fdash-fda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/dash-fda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241212185,"owners_count":19927897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dash","dashboard","fda","plotly"],"created_at":"2024-10-01T15:15:41.056Z","updated_at":"2025-02-28T19:30:45.064Z","avatar_url":"https://github.com/jackdbd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dash FDA\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/jackdbd/dash-fda.svg?branch=master)](https://travis-ci.org/jackdbd/dash-fda) [![Coverage](https://codecov.io/github/jackdbd/dash-fda/coverage.svg?branch=master)](https://codecov.io/github/jackdbd/dash-fda?branch=master) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nA Dash app to visualize data from the openFDA elasticsearch API.\n\n![A GIF file showing a short demo on how to use the Dash FDA dashboard](https://github.com/jackdbd/dash-fda/blob/master/demo.gif \"How to use the Dash FDA dashboard\")\n\n[App on CapRover](https://cutt.ly/dash-fda).\n\nBuilt with:\n\n- [Plotly Dash](https://plotly.com/dash/)\n- [openFDA /device endpoint](https://open.fda.gov/device/)\n\nData from [openFDA](https://open.fda.gov/).\n\n## API keys\n\nThis project requires to get some API keys from external services.\n\n- `PLOTLY_USERNAME`, `PLOTLY_API_KEY`: get them at [chart-studio.plotly.com](https://chart-studio.plotly.com/).\n- `OPEN_FDA_API_KEY`: get it at [openFDA](https://open.fda.gov/apis/authentication/)\n\n## Installation\n\nThis project uses [pyenv](https://github.com/pyenv/pyenv) and [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) to manage the Python virtual environment, and [poetry](https://poetry.eustace.io/) to manage the project dependencies.\n\nIf you don't already have it, install python `3.8.5`.\n\n```shell\npyenv install 3.8.5\n```\n\nCreate a virtual environment and activate it.\n\n```shell\npyenv virtualenv 3.8.5 dash_fda\npyenv activate dash_fda\n```\n\nRemember to activate the virtual environment every time you work on this project.\n\nInstall all the dependencies from the `poetry.lock` file.\n\n```shell\npoetry install\n```\n\n## Tasks\n\nThis project uses the task runner [Poe the Poet](https://github.com/nat-n/poethepoet) to run poetry scripts.\n\n## Non-dockerized app\n\nRun the app locally using a development server (Dash uses a Flask development server):\n\n```shell\npoetry run poe dev\n\n# or, in alternative\npython app.py\n```\n\nRun the app locally using a production server (gunicorn):\n\n```shell\npoetry run poe prod\n```\n\nRun all tests with pytest:\n\n```shell\npoetry run poe test\n```\n\nFormat all code with black:\n\n```shell\npoetry run poe format\n```\n\n## Dockerized app\n\nBuild the Docker image and give it a name and a version tag:\n\n```shell\ndocker build -t dash-fda:v0.1.0 .\n```\n\nRun the Docker container:\n\n```shell\ndocker run --env-file ./dash_fda/.env -p 5001:5000 dash-fda:v0.1.0\n```\n\nDeploy the dockerized app on CapRover (running on my DigitalOcean Droplet):\n\n```shell\n./deploy.sh\n```\n\n## Troubleshooting\n\nIf you are on Ubuntu you might get `ModuleNotFoundError: No module named '_bz2'` and/or `UserWarning: 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 these [compression libraries](https://github.com/pandas-dev/pandas/issues/27575). If you get these errors you need to install the libbz2-dev package and the liblzma-dev package, then re-compile your python interpreter.\n\nHere is how you can do it:\n\n```shell\n# deactivate and remove the virtual environment\npyenv deactivate\npyenv virtualenv-delete dash_fda\n\n# remove the \"broken\" python interpreter\npyenv uninstall 3.8.5\n\n# install the compression libreries\nsudo apt-get install libbz2-dev liblzma-dev\n\n# download and compile the python interpreter\npyenv install 3.8.5\n\n# re-create the virtual environment and activate it\npyenv virtualenv 3.8.5 dash_fda\npyenv activate dash_fda\n\n# re-install all the dependencies\npoetry install\n```\n\n## Disclaimer\n\nThis app is just an independent project, and it has not been evaluated by the Food and Drug Administration.\nThis app is not intended to diagnose, treat, cure, or prevent any disease.\nDo not rely on this app to make any decision regarding medical care.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fdash-fda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Fdash-fda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fdash-fda/lists"}