{"id":20963656,"url":"https://github.com/baslia/openfda_map","last_synced_at":"2025-08-24T13:13:26.498Z","repository":{"id":262593359,"uuid":"887746357","full_name":"baslia/openFDA_map","owner":"baslia","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-13T11:14:43.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T01:33:09.938Z","etag":null,"topics":["dashboard","fda"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baslia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T08:02:21.000Z","updated_at":"2024-11-13T11:14:46.000Z","dependencies_parsed_at":"2024-11-13T09:32:06.567Z","dependency_job_id":null,"html_url":"https://github.com/baslia/openFDA_map","commit_stats":null,"previous_names":["baslia/openfda_map"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslia%2FopenFDA_map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslia%2FopenFDA_map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslia%2FopenFDA_map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslia%2FopenFDA_map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baslia","download_url":"https://codeload.github.com/baslia/openFDA_map/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243360235,"owners_count":20278353,"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":["dashboard","fda"],"created_at":"2024-11-19T02:47:40.609Z","updated_at":"2025-03-13T07:25:19.704Z","avatar_url":"https://github.com/baslia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openFDA Events Dashboard\n\n![Dashboard Screenshot](https://via.placeholder.com/800x400?text=Dashboard+Screenshot)\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Running the Dashboard](#running-the-dashboard)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgements](#acknowledgements)\n\n## Overview\n\nThe **openFDA Events Dashboard** is an interactive web application built using [Plotly Dash](https://plotly.com/dash/) that visualizes drug adverse event data retrieved from the [openFDA API](https://open.fda.gov/apis/drug/event/). This dashboard provides users with insightful visualizations to analyze and explore FDA-reported adverse drug events, enabling stakeholders such as healthcare professionals, researchers, and the general public to make informed decisions based on real-world data.\n\n## Features\n\n- **Time Series Analysis**: View the number of adverse events reported each month for a selected year.\n- **Top Reported Drugs**: Identify the top 10 drugs most frequently reported in adverse events.\n- **Top Reactions**: Discover the most common adverse reactions associated with drugs.\n- **Interactive Filters**: Select specific years to update all visualizations dynamically.\n- **Data Table**: Explore a sample of adverse event reports in a tabular format.\n\n## Prerequisites\n\nBefore setting up the dashboard, ensure you have the following installed on your machine:\n\n- **Python** (version 3.7 or higher): [Download Python](https://www.python.org/downloads/)\n- **pip**: Python package installer (comes bundled with Python)\n- **Git** (optional, for cloning the repository): [Download Git](https://git-scm.com/downloads)\n\n## Installation\n\n### 1. Clone the Repository\n\nFirst, clone the repository to your local machine using Git. If you don't have Git installed, you can download the source code as a ZIP file and extract it.\n\n```bash\ngit clone https://github.com/baslia/openFDA_map.git\ncd openFDA_map\n```\n\n### 2. Create a Virtual Environment (Optional but Recommended)\n\nCreating a virtual environment isolates the project's dependencies from other Python projects on your system.\n\n```bash\npython -m venv venv\n```\n\nActivate the virtual environment:\n\n- **Windows:**\n\n  ```bash\n  venv\\Scripts\\activate\n  ```\n\n- **macOS/Linux:**\n\n  ```bash\n  source venv/bin/activate\n  ```\n\n### 3. Install Dependencies\n\nInstall the required Python libraries using `pip`:\n\n```bash\npip install -r requirements.txt\n```\n\nIf a `requirements.txt` file is not provided, you can install the dependencies manually:\n\n```bash\npip install dash plotly pandas requests\n```\n\n## Configuration\n\nThe dashboard fetches data from the openFDA API, which has certain rate limits:\n\n- **Public Access**: 240 requests per minute. Each request can retrieve a maximum of 100 records.\n- **API Key (Optional)**: For higher rate limits, you can obtain a free API key from [openFDA](https://open.fda.gov/apis/authentication/).\n\n### Setting Up an API Key (Optional)\n\n1. **Request an API Key**: Visit the [openFDA API Key Request Page](https://open.fda.gov/apis/authentication/) and follow the instructions to obtain a key.\n2. **Configure the Application**: Modify the `fetch_openfda_data` function in `openfda_dashboard.py` to include your API key.\n\n```python\nparams = {\n    'api_key': 'YOUR_API_KEY_HERE',\n    'search': 'patient.reaction.reactionmeddrapt:*',\n    'limit': limit\n}\n```\n\n**Note**: Replace `'YOUR_API_KEY_HERE'` with your actual API key.\n\n## Running the Dashboard\n\nOnce the installation and configuration are complete, you can run the dashboard locally.\n\n1. **Navigate to the Project Directory** (if not already there):\n\n   ```bash\n   cd openFDA_map\n   ```\n\n2. **Run the Application**:\n\n   ```bash\n   python openfda_dashboard.py\n   ```\n\n   You should see output similar to:\n\n   ```\n   Dash is running on http://127.0.0.1:8050/\n\n   * Serving Flask app 'openfda_dashboard'\n   * Debug mode: on\n   ```\n\n3. **Access the Dashboard**:\n\n   Open your web browser and navigate to [http://127.0.0.1:8050/](http://127.0.0.1:8050/) to view the dashboard.\n\n## Usage\n\n### Navigating the Dashboard\n\n- **Year Selection Dropdown**: Located at the top of the dashboard, allow you to select the year for which you want to view adverse event data. All visualizations will update based on the selected year.\n\n- **Time Series Plot**:\n  - **Description**: Shows the number of reported adverse events each month for the selected year.\n  - **Use Case**: Identify trends or spikes in adverse events over time.\n\n- **Top Reported Drugs**:\n  - **Description**: Displays a horizontal bar chart of the top 10 drugs most frequently reported in adverse events.\n  - **Use Case**: Determine which drugs have the highest number of reported adverse events.\n\n- **Top Reactions**:\n  - **Description**: Shows a horizontal bar chart of the top 10 most common adverse reactions.\n  - **Use Case**: Understand which adverse reactions are most frequently reported.\n\n- **Data Table**:\n  - **Description**: Presents a sample of adverse event reports in a table format, including drug name, reaction, patient age, and sex.\n  - **Use Case**: Examine specific details of individual adverse event reports.\n\n### Interactivity\n\n- **Dynamic Updates**: Changing the year in the dropdown will automatically refresh all visualizations to reflect data from the selected year.\n- **Hover Information**: Hover over data points in the charts to view detailed information such as exact counts and categories.\n\n## Contributing\n\nContributions are welcome! If you'd like to improve the dashboard or add new features, please follow these steps:\n\n1. **Fork the Repository**: Click the \"Fork\" button at the top right of the repository page.\n\n2. **Clone Your Fork**:\n\n   ```bash\n   git clone https://github.com/baslia/openFDA_map.git\n   cd openFDA_map\n   ```\n\n3. **Create a New Branch**:\n\n   ```bash\n   git checkout -b feature/awesome-feature\n   ```\n\n4. **Make Your Changes**: Implement your feature or fix.\n\n5. **Commit Your Changes**:\n\n   ```bash\n   git commit -m \"Add awesome feature\"\n   ```\n\n6. **Push to Your Fork**:\n\n   ```bash\n   git push origin feature/awesome-feature\n   ```\n\n7. **Open a Pull Request**: Navigate to the original repository and open a pull request from your fork.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Acknowledgements\n\n- **[openFDA](https://open.fda.gov/)**: For providing the comprehensive APIs used to access FDA data.\n- **[Plotly Dash](https://plotly.com/dash/)**: For the powerful framework to build interactive dashboards.\n- **[Pandas](https://pandas.pydata.org/)**: For data manipulation and analysis.\n- **[Requests](https://docs.python-requests.org/)**: For handling HTTP requests to the openFDA API.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslia%2Fopenfda_map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaslia%2Fopenfda_map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslia%2Fopenfda_map/lists"}