Installation

Requirements

  • Python 3.8 or newer (tested up to 3.14).

  • fhir-core ≥ 1.1.12 and pydantic V2 — installed automatically.

Install from PyPI

$ pip install fhir.resources
$ uv add fhir.resources
$ poetry add fhir.resources

Optional extras

JSON support is always available. XML and YAML need one extra dependency each:

Extra

Installs

Enables

xml

lxml

model_dump_xml() / model_validate_xml(), XSD validation.

yaml

PyYAML

model_dump_yaml() / model_validate_yaml().

all

both of the above

everything.

$ pip install "fhir.resources[all]"

Development version

To work on the library itself, clone the repository and install it in editable mode with the development extras:

$ git clone https://github.com/nazrulworld/fhir.resources.git
$ cd fhir.resources
$ pip install -e ".[dev]"

See Contributing for running the tests and regenerating models.

Check the installation

>>> import fhir.resources
>>> fhir.resources.__fhir_version__
'5.0.0'