fhirpy
FHIR client for python
What it is and what it does
fhirpy is a dual-mode HTTP client for the FHIR (Fast Healthcare Interoperability Resources) standard, offering both async (via aiohttp) and sync (via requests) interfaces. It abstracts FHIR resource operations—create, read, update, patch, delete—into a Python object model, and provides a fluent search API with support for FHIR query parameters, chained searches, date filtering, and result pagination.
The library is aimed at healthcare developers building integrations with FHIR servers. It handles resource instantiation, serialization, reference resolution, and conditional operations, letting you work with FHIR data as Python objects rather than raw JSON. The async variant is suitable for concurrent server interactions; the sync variant integrates into traditional blocking codebases.
Use it for:
- Query a FHIR server for patient records by name, birthdate, or other search criteria and iterate over paginated results.
- Create or update clinical resources (Patient, Observation, Condition) programmatically and save them back to a FHIR server.
- Build healthcare data pipelines that fetch, transform, and persist FHIR resources in bulk operations.
- Resolve FHIR references (e.g., a patient's general practitioner) and fetch related resources in a single operation.
- Validate FHIR resources against server-side rules before persisting them using the $validate operation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Async/sync FHIR client for Python that provides CRUD operations over FHIR resources via HTTP, supporting search, filtering, and resource manipulation.
Yes, if you are building against a FHIR server and need a Python client. The package is stable (Production/Stable classifier), supports current Python versions (3.9–3.12), has no known vulnerabilities, and offers both async and sync modes. Caveat: verify the license terms in the repository before use, and note that maintenance is aging (311 days since last release); if active development is critical, confirm the project's roadmap with the maintainers.
Install
fhirpy on PyPI
pip
pip install fhirpyuv
uv add fhirpypoetry
poetry add fhirpyInstalling fhirpy
Before you install
Low install friction with a pure-Python wheel and four common runtime dependencies (requests, aiohttp, pytz, typing-extensions). Maintenance status is aging—last release was 311 days ago—but the repository remains active and unarchived with modest community engagement (212 stars).
License in practice
License treatment is unclear; no SPDX identifier or raw license text is recorded in the package metadata. Verify the actual license terms in the repository before adopting in proprietary or restricted-license projects.
Quickstart
pip install fhirpy
from fhirpy import AsyncFHIRClient
import asyncio
async def main():
client = AsyncFHIRClient('http://fhir-server/', authorization='Bearer TOKEN')
patients = await client.resources('Patient').search(name='John').fetch()
print(patients)
asyncio.run(main())
Requires Python 3.9 or later. A running FHIR server endpoint is needed to connect to.
Verify before relying
- What is the actual license of fhirpy? The package metadata does not declare it.
- How actively is the project maintained? Last release was 311 days ago; confirm whether this reflects a stable, feature-complete state or reduced activity.
- Does the package support all FHIR versions, or is it tied to a specific FHIR release (e.g., R4, R5)?
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — requests, aiohttp, pytz, typing-extensions |
| Maintenance | aging — 311 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,124,621/month — #4,329 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fhirpy-2.2.0-py3-none-any.whl
Keywords: fhir
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fhir.resourcesProvides Python classes and validation for all…
permissive · top 5,000 on PyPI
fhirclientA Python client library for connecting to FHIR…
permissive · top 15,000 on PyPI
carelyticsCarelytics provides healthcare data cleaning,…
permissive · top 15,000 on PyPI
fhir-coreProvides Pydantic V2-based abstract base…
permissive · top 5,000 on PyPI
aioopenexchangeratesAsync client library for fetching currency…
permissive · top 15,000 on PyPI
stackit-resourcemanagerProvides Python API bindings to manage STACKIT…
permissive · top 15,000 on PyPI
pydantic-mongoProvides a Repository pattern for MongoDB with…
permissive · top 15,000 on PyPI
chargebeeOfficial Python client library for integrating…
unclear · top 5,000 on PyPI
fastcrudFastCRUD provides async CRUD operations and…
permissive · top 15,000 on PyPI
shazamioAsynchronous Python library that recognizes…
permissive · top 15,000 on PyPI