--- id: fhir-resources version: "8.3.0" license: BSD license license_treatment: permissive maintenance: active --- # fhir.resources — FHIR Resources as Model Class License: permissive · Maintenance: active · Downloads: 2.6M/mo ## 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 above — 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 pip install fhir-resources uv add fhir-resources 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_current - Install friction: low - Maintenance: active - Downloads: 2.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fhir resource models python, healthcare data validation, hl7 fhir resources, fhir patient organization resources, pydantic fhir models, healthcare-data, fhir-hl7, data-validation [View on SkillFed](https://skillfed.io/packages/fhir-resources) · [View on PyPI](https://pypi.org/project/fhir-resources/)