skillfed

fhirclient

A flexible client for FHIR servers supporting the SMART on FHIR protocol

fhirclient v4.4.0 331.0K downloads/30d#7,523 on PyPI694
Permissive license Active released

What it is and what it does

fhirclient is a Python library that connects your code to FHIR (Fast Healthcare Interoperability Resources) servers—the standard format for electronic health records. It handles both the network communication and the data model, so you can read patient records, search for encounters or procedures, and work with healthcare data in a Pythonic way. The library supports SMART on FHIR, which means it can manage OAuth login flows for protected servers, and it includes pre-built classes for common FHIR resources like Patient, Encounter, and Procedure.

You use it by creating a FHIRClient with your server URL, then calling methods on resource classes to fetch or search for data. The library validates data structure as you build or deserialize FHIR objects, catching schema errors early. It's actively maintained, requires only requests as a dependency, and supports current Python versions.

Use it for:

  • Fetch a patient's demographics and medical history from a SMART-enabled EHR for display in a web or mobile app.
  • Search for all encounters or procedures for a patient within a given date range and process the results.
  • Build a Flask or Django app that logs users in via SMART OAuth and displays their own health data.
  • Validate and serialize FHIR data objects when building healthcare integrations or data pipelines.
  • Query a public FHIR sandbox server for research or testing without authentication setup.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for connecting to FHIR servers and working with FHIR healthcare data, supporting the SMART on FHIR protocol for OAuth-based authentication and resource queries.

Yes. The library is actively maintained, has no known vulnerabilities, installs with minimal friction, and is the standard choice for FHIR + SMART integration in Python. Use it if you need to connect to FHIR servers or work with FHIR data models in Python.

Install

fhirclient on PyPI

pip

pip install fhirclient

uv

uv add fhirclient

poetry

poetry add fhirclient

Installing fhirclient

Before you install

Low friction: pure Python wheel with only requests as a runtime dependency. Actively maintained with recent commits and stable production status.

License in practice

Permissive license allows use in both open-source and proprietary projects without significant restrictions.

Quickstart

pip install fhirclient

from fhirclient import client
from fhirclient.models.patient import Patient

settings = {'app_id': 'my_app', 'api_base': 'https://r4.smarthealthit.org'}
smart = client.FHIRClient(settings=settings)
patient = Patient.read('patient-id', smart.server)
print(patient.birthDate.isostring)

Requires Python 3.10 or later.

Verify before relying

  • Whether the library handles FHIR versions beyond R4 (4.0.1) in current releases.
  • Performance characteristics when querying large result sets or performing bulk operations.
  • Specific OAuth flow support details and limitations for different SMART server implementations.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance actively maintained — 185 days since the last release
Last repo commit
First released
Downloads 330,970/month — #7,523 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fhirclient-4.4.0-py3-none-any.whl

Keywords: smart, fhir, healthcare, medical-informatics, clinical-informatics, biomedical-informatics

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

fhir client pythonsmart on fhirhealthcare data apifhir server connectionmedical records pythonclinical data accessfhir resource queries
healthcare-datafhir-standardoauth-client

More Python Modules packages