skillfed

fhirpy

FHIR client for python

fhirpy v2.2.0 1.1M downloads/30d#4,329 on PyPI212
License unclear AGING released

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 fhirpy

uv

uv add fhirpy

poetry

poetry add fhirpy

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules

Tags

fhir client pythonfhir api wrapperhealthcare interoperabilityasync fhir operationsfhir resource managementfhir search and crudfhir server client
healthcare-interopfhir-standardasync-ready

More Python Modules packages