This release is a pre-release and may not be stable for production use.
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.r4 import bundles
from pathling.etc import find_jar
spark = SparkSession.builder \
.appName('pathling-test') \
.master('local[*]') \
.config('spark.jars', find_jar()) \
.getOrCreate()
json_bundles = bundles.load_from_directory(spark, 'examples/data/bundles/')
patients = bundles.extract_entry(spark, json_bundles, 'Patient')
patients.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.
Release files for pathling 5.0.3.dev0
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.0.3.dev0.tar.gz | 19.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pathling-5.0.3.dev0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 39.1 MB
Release files / pathling-5.0.3.dev0.tar.gz
| Download URL | pathling-5.0.3.dev0.tar.gz |
|---|---|
| Size | 19.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3eeb6362779f6ebcf703ef71a23ca7b57585f56adf62c77547f415b98da17bbd
|
|
BLAKE2b-256 checksum How to use checksums |
d229e30afe601783a4d62078477742261eb341bca250c6f5533aa0fb58ce5794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.13
|
Release files / pathling-5.0.3.dev0-py2.py3-none-any.whl
| Download URL | pathling-5.0.3.dev0-py2.py3-none-any.whl |
|---|---|
| Size | 19.6 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c27c365bfaf29ec8c5d7ec1c0b205606418853a1c1fc21562ce87158860623a8
|
|
BLAKE2b-256 checksum How to use checksums |
a16ea3b2bb58263a072d42c6a6061fd375720fd0f838f8e222753134a28edbc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.13
|