Skip to main content

This is a simple implementation of PBPK modeling in python.

Project description

pbpk-lite

pbpk-lite is a lightweight Python package for basic physiologically based pharmacokinetic (PBPK) modeling.

It provides a simple programmatic interface for defining substance properties, patient physiology, elimination kinetics, and solving the resulting ODE system.

Features

  • Substance partition coefficient calculation using logP and fraction unbound
  • Patient blood flows and tissue volumes derived from body weight
  • Linear liver and kidney elimination pathways
  • ODE solution via scipy.integrate.solve_ivp
  • Simple plotting helper for concentration visualization

Installation

Install from PyPI:

pip install pbpk-lite

Install from source:

pip install .

Quick Start

from pbpk_lite import model

m = model()
m.set_substance(log_p=6.97, fu=0.0022448)
m.set_patient(bw=70)
m.set_elimination(cl_l=10, cl_k=0)

doses = [10]
times = [0, 24]

t, c = m.simulate(doses, times)
print(t)
print(c.shape)

Dosing Schedule

The simulate() method expects:

  • doses: array-like of administered doses
  • times: array-like of dosing times plus a final endpoint

Important: times must have exactly one more element than doses. Each dose at index i is administered at times[i], and the final value in times is the last observation or endpoint.

Example with one dose:

# one dose at time 0, observation at 24 hours
doses = [10]
times = [0, 24]

Example with two doses:

# doses at 0 and 12 hours, observation at 24 hours
doses = [10, 10]
times = [0, 12, 24]

API Summary

pbpk_lite.model

set_substance(log_p, fu)

Set the substance physicochemical properties.

  • log_p: log octanol-water partition coefficient
  • fu: fraction unbound in blood

set_patient(bw)

Set patient physiological parameters using body weight in kilograms.

set_elimination(cl_l=0, cl_k=0)

Set linear clearance from liver and kidney compartments.

simulate(doses, times)

Simulate the PBPK model and return time points t and compartment concentrations c.

License

pbpk-lite is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pbpk_lite-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pbpk_lite-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pbpk_lite-0.1.0.tar.gz.

File metadata

  • Download URL: pbpk_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbpk_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8680565cba32a9cb3d86391aa8ced62ad9104d500e0a748f1a6ae0054a255205
MD5 27da437b598925a08f6d0e52ff8753e9
BLAKE2b-256 c82dc37deb29a5e490228e4d4ca35701ec6bbebebd4ca1ca2ea8879a3bae375a

See more details on using hashes here.

File details

Details for the file pbpk_lite-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pbpk_lite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbpk_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb3284e66cbb4fe07dc7e588b08ec340475d9745047509a419df1afda020a3d6
MD5 59c7d04fbfbe2a5b93813302afd063ea
BLAKE2b-256 20112f8db5302da958052f7a33f31aba0b075c11ba30251b9a3f742c5057b2dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page