Installation¶
pkpdutils requires python >= 3.13 and is available from pypi. It is tested on Linux, macOS and Windows and is itself pure python; its dependencies ship binary wheels for those platforms, the rust kernel of the non-compartmental analysis (pkpdutils-core) among them, so no compiler is needed.
With uv¶
uv is the recommended way to install the package. In a project it is added as a dependency:
Into an existing virtual environment it is installed through the pip interface of uv:
With pip¶
Development version¶
The current state of the develop branch is installed directly from GitHub:
or, with pip,
To work on the repository itself, with the test and documentation tooling, see Development.
Dependencies¶
| package | used for |
|---|---|
| pkpdutils-core | the rust kernel which runs the non-compartmental analyses it carries (pkpdutils.nca.engine), measured against the python core in Performance |
| numpy, scipy | numerics, integration, regression, optimization and statistics |
| xarray, pandas | timecourses and results as labeled arrays and tables |
| pint | units and unit conversions |
| pydantic | validated data structures and options |
| matplotlib | figures |
| rich | console output of scripts and examples |
Logging¶
pkpdutils does not configure logging. It logs to loggers below the pkpdutils logger and leaves handlers, levels and formatting to the application:
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger("pkpdutils").setLevel(logging.WARNING)
For scripts and interactive work the rich output of the package can be turned on explicitly: