Command-line interface to search MAUDE database for medical device adverse events via openFDA API
Project description
MAUDE CLI
Command-line interface, written in pure Python, for searching the MAUDE (Manufacturer and User Facility Device Experience) database through the openFDA API. Search medical device adverse event reports directly from your terminal.
Installation
With uv:
uvx maude-cli
or pip:
pip install maude-cli
Usage
maude-cli [OPTIONS] TERM_GROUPS...
Basic Example
Search for reports containing either "MRI" or "MAGNET" AND either "STAPES" or "TYMP":
maude-cli "MRI,MAGNET" "STAPES,TYMP"
Options
-x, --exclude: Term groups to exclude (comma-separated terms OR'd within groups, groups AND'd together). Example: 'ARTIFACT,SHADOW' 'METAL,SCREW'-f, --search-fields: Fields to search (default:mdr_text.text)-p, --max-pages: Maximum pages to retrieve (0=all)-l, --limit: Results per page (default: 1000)-s, --sort: Sort criteria-o, --format: Output format (org,json, ortext; default:org)-O, --output: Output file. If not used then will print to standard out.-n, --name: Field to use as item name (default:report_number)-F, --fields: Comma-separated fields to include in output-L, --level: Org heading level (default: 3)
Output Formats
org: Org-mode formatted output (default)json: Pretty-printed JSONtext: Simple text formatcsv: CSV format.
Exclusion Criteria
The CLI supports sophisticated exclusion filtering using the -x=/``--exclude option. Exclusion terms follow the same logic as search terms but filter OUT matching results:
- Within each exclusion group: terms are OR'd (
term1 OR term2) - Between exclusion groups: conditions are AND'd (
group1 AND group2) - Results matching ALL exclusion groups will be filtered out
Examples
Search with specific fields and output format:
maude-cli "pacemaker" -f device.device_name -o json -F device.brand_name,patient.age
Search with pagination control:
maude-cli "defibrillator" -p 2 -l 50
Search for all entries that contain either "MRI" or "MAGNET" AND also containing either "CARDIAC" or "VALVE" and output as a csv file.
maude-cli "mri,magnet" "cardiac,valve" -o csv
Exclusion Examples
Basic exclusion Find MRI-related reports but exclude artifacts:
maude-cli "MRI,MAGNET" -x "ARTIFACT,SHADOW"
Multi-group exclusion Find pacemaker reports but exclude both battery AND lead issues:
maude-cli "pacemaker" -x "BATTERY,POWER" "LEAD,WIRE"
(Excludes reports containing ("BATTERY" OR "POWER") AND ("LEAD" OR "WIRE"))
Field-specific exclusion Search device names for "catheter" but exclude infection-related reports:
maude-cli "catheter" -f device.device_name -x "INFECTION,SEPSIS" -F patient.problem
Manufacturer exclusion Find defibrillator reports but exclude two specific manufacturers:
maude-cli "defibrillator" -x "MEDTRONIC,ST_JUDE" "BOSTON_SCIENTIFIC"
Report type filtering Find stent reports but exclude follow-ups and summaries:
maude-cli "stent" -x "FOLLOW-UP,SUMMARY,ADDITIONAL"
Combined search/exclusion Find reports about "valve" in cardiac devices but exclude MRI-related artifacts:
maude-cli "valve" -f "device.device_name" -x "MRI,MAGNET" "ARTIFACT,SHADOW"
Complex scenario Search for infusion pump issues but exclude:
- Software-related problems (group 1)
- Baxter-manufactured devices (group 2)
- Reports without patient injury (group 3)
maude-cli "infusion,pump" -x "SOFTWARE,ALGORITHM" "BAXTER" "NO INJURY,"
License
This code is licensed under the GNU GPL v3 license which can be found here.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maude_cli-0.1.1.tar.gz.
File metadata
- Download URL: maude_cli-0.1.1.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c633dd7afb0d12d2374656d45605cef19d7d9be92fe69c6fe53f79ff59cb530
|
|
| MD5 |
aed397d9a44fb167f55691128694735d
|
|
| BLAKE2b-256 |
1067039fd32f2272aad8b9e406e5de23d8193953308534c86b3f8bec93b011c5
|
File details
Details for the file maude_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: maude_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e451e2343f97917f4808f3d88084654b22945380e07e04cf587dea5cfe882e2
|
|
| MD5 |
fccc2b147cdd3b04c2a122b182ee6040
|
|
| BLAKE2b-256 |
be12a8fca25716fe170fa2eb13f37f23eee5d97a13749bbd416fd389e3f38c81
|