Python API for Pathling
This is the Python API for Pathling. It currently supports encoding of FHIR JSON bundles and NDJSON into Apache Spark dataframes.
Installation
Prerequisites:
- Python 3.8+ with pip
- PySpark 3.1+
To install, run this command:
pip install pathling
Usage
The code below shows an example of using the Pathling API to encode Patient resources from FHIR JSON bundles:
from pyspark.sql import SparkSession
from pathling import PathlingContext
from pathling.etc import find_jar
spark = SparkSession.builder
.appName('pathling-test')
.master('local[*]')
.config('spark.jars', find_jar())
.getOrCreate()
ptl = PathlingContext.create(spark)
json_bundles = spark.read.text('examples/data/bundles/', wholetext=True)
patients_df = ptl.encode_bundle(json_bundles, 'Patient')
patients_df.show()
More usage examples can be found in the examples directory.
Development setup
Create an isolated python environment with Miniconda, e.g:
conda create -n pathling-dev python=3.8
conda activate pathling-dev
Prerequisites:
- maven (Ubuntu 20.04:
apt install maven) - java (Ubuntu 20.04:
apt install default-jdk) - make (Ubuntu 20.04:
apt install make)
To run the tests and install the package, run this command from the project root:
mvn install -pl lib/python -am
Pathling is copyright © 2018-2022, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230. Licensed under the CSIRO Open Source Software Licence Agreement.
Metadata
Release files for pathling 5.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pathling-5.3.2.tar.gz | 29.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pathling-5.3.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 58.7 MB
Release files / pathling-5.3.2.tar.gz
| Download URL | pathling-5.3.2.tar.gz |
|---|---|
| Size | 29.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8089e7c6cd1340cb964c744db2041e2392e0e1bc8a64e8aa2aa58995db81c8ff
|
|
BLAKE2b-256 checksum How to use checksums |
c113bb52873bfd79012d02ca7a78f43db6c72d73937f270a31706cdbe9450ab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Release files / pathling-5.3.2-py2.py3-none-any.whl
| Download URL | pathling-5.3.2-py2.py3-none-any.whl |
|---|---|
| Size | 29.4 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
72155d2dfc80abb8049f52785a69fb21fb7a8f520578fa7d31826db51558e8ac
|
|
BLAKE2b-256 checksum How to use checksums |
66b6b8be5f4b5ef24c47fa043856c67f57045965e4edda2dd1f6b58421cbcdac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|