skillfed

fhir.resources

FHIR Resources as Model Class

fhir-resources v8.3.0 2.6M downloads/30d#2,986 on PyPI534
Permissive license BSD license Active released

What it is and what it does

fhir.resources is a Python library that wraps the FHIR (Fast Healthcare Interoperability Resources) specification as pydantic V2 model classes. It provides type-safe, validated Python objects for all FHIR resource types—Patient, Organization, Observation, and many others—across multiple FHIR versions (R5 by default, with R4B and STU3 available as sub-packages). You use it to construct healthcare data structures in Python, validate them against FHIR rules, and serialize them to JSON or other formats.

The package is built on pydantic V2 for performance and includes automatic validation, ORM compatibility, and support for FHIR's extensibility model. It's designed for developers building FHIR-based APIs, integrating with healthcare systems, or working with FHIR data programmatically. The library handles the complexity of the FHIR specification so you can focus on your application logic rather than manually building and validating resource objects.

Use it for:

  • Build a FHIR-compliant REST API that accepts and returns Patient, Observation, or other resource types with automatic validation.
  • Parse and validate FHIR JSON from external healthcare systems to ensure data integrity before processing.
  • Construct FHIR resources programmatically in Python and export them as JSON for integration with EHR systems.
  • Migrate or transform healthcare data between different FHIR versions (R5, R4B, STU3) using version-specific sub-packages.
  • Develop healthcare data pipelines that need type-safe, validated FHIR objects with ORM support for database storage.

Worth the install?

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

Provides Python classes and validation for all FHIR resource types (R5, R4B, STU3), enabling you to construct, validate, and serialize healthcare data structures according to the FHIR specification.

Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a concrete problem—FHIR resource modeling and validation—with low install friction. It's well-positioned for production use in healthcare applications. Install it if you're building or integrating with FHIR-based systems.

Install

fhir-resources on PyPI

pip

pip install fhir-resources

uv

uv add fhir-resources

poetry

poetry add fhir-resources

Installing fhir.resources

Before you install

Low friction: pure-Python wheel with a single runtime dependency (fhir-core). Active maintenance—last release 42 days ago, repository not archived, 534 stars.

License in practice

BSD license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install fhir.resources

from fhir.resources.patient import Patient
json_obj = {"resourceType": "Patient", "id": "p001", "active": True, "name": [{"text": "Adam Smith"}], "birthDate": "1985-06-12"}
pat = Patient.model_validate(json_obj)
print(pat.get_resource_type())

Verify before relying

  • Whether fhir-core is a lightweight dependency or introduces significant transitive requirements
  • Performance characteristics of pydantic V2 validation for large batches of FHIR resources
  • Completeness and stability of experimental XML/YAML serialization support

Package facts

License BSD license (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — fhir-core
Maintenance actively maintained — 42 days since the last release
Last repo commit
First released
Downloads 2,582,390/month — #2,986 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fhir_resources-8.3.0-py2.py3-none-any.whl

Keywords: fhir, resources, python, hl7, health IT, healthcare

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Healthcare IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

fhir resource models pythonhealthcare data validationhl7 fhir resourcesfhir patient organization resourcespydantic fhir models
healthcare-datafhir-hl7data-validation

More Application Frameworks packages