|badge1| |badge2| |badge3| |badge4| |badge5| |badge6|
.. |badge1| image:: https://img.shields.io/pypi/v/pharmpy-core.svg
:target: https://pypi.org/project/pharmpy-core
.. |badge2| image:: https://img.shields.io/pypi/l/pharmpy-core.svg
:target: https://github.com/pharmpy/pharmpy/blob/main/LICENSE.LESSER
.. |badge3| image:: https://github.com/pharmpy/pharmpy/actions/workflows/main.yml/badge.svg
:target: https://github.com/pharmpy/pharmpy/actions
.. |badge4| image:: https://img.shields.io/pypi/pyversions/pharmpy-core
:target: https://www.python.org/downloads/
.. |badge5| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. |badge6| image:: https://codecov.io/gh/pharmpy/pharmpy/branch/main/graph/badge.svg?token=JZTHXXQPII
:target: https://codecov.io/gh/pharmpy/pharmpy
.. _README:
|logo|
======
.. |logo| image:: https://github.com/pharmpy/pharmpy/raw/main/docs/Pharmpy_logo.svg
:width: 250
Pharmpy is an open-source software package for pharmacometric modeling. It has functionality ranging from reading and
manipulating model files and datasets to full tools where subsequent results are collected and presented.
Features include:
* A **model abstraction** which splits a model into core components which Pharmpy understands and can manipulate:
parameters, random variables, statements (including ODE system), dataset, and execution steps
* An **abstraction for modelfit results** which splits a parsed results into core components: e.g. OFV, parameter
estimates, relative standard errors (RSEs), residuals, predictions
* **Functions for manipulation of models and datasets** in the modeling-module: e.g. change structural model, add
time-after-dose column, deidentify dataset
* **Tools to aid model development** in the tools-module: execution of models within Python/R scripts, automatic
development of models (e.g. AMD, IIVSearch, RUVSearch), comparison of estimation methods
* Support for **multiple estimation tools**: parse NONMEM models, execute NONMEM, nlmixr2, and rxODE2 models, run all
Pharmpy tools with NONMEM and some with nlmixr2
For more comprehensive information and documentation, see: https://pharmpy.github.io
Pharmpy can be used as a regular Python package, in R via the `pharmr <https://github.com/pharmpy/pharmr>`_ package,
or via its built in command line interface.
Getting started
===============
The sections below are intended as first steps, please check our `website <https://pharmpy.github.io>`_ website for
more comprehensive documentation, such as user guides and API references.
Installation
------------
For installation in R, see `pharmr <https://github.com/pharmpy/pharmr>`_.
Install the latest stable version from PyPI:
pip install pharmpy-core # or 'pip3 install' if that is your default python3 pip
Python Example
--------------
.. code-block:: none
>>> from pharmpy.modeling import read_model
>>> from pharmpy.tools import load_example_modelfit_results
>>> model = load_example_model("pheno")
>>> model.parameters
value lower upper fix
POP_CL 0.004693 0.00 ∞ False
POP_VC 1.009160 0.00 ∞ False
COVAPGR 0.100000 -0.99 ∞ False
IIV_CL 0.030963 0.00 ∞ False
IIV_VC 0.031128 0.00 ∞ False
SIGMA 0.013086 0.00 ∞ False
>>> res = load_example_modelfit_results("pheno")
>>> res.parameter_estimates
POP_CL 0.004696
POP_VC 0.984258
COVAPGR 0.158920
IIV_CL 0.029351
IIV_VC 0.027906
SIGMA 0.013241
Name: estimates, dtype: float64
>>>
CLI Example
-----------
.. code-block:: none
# Get help
pharmpy -h
# Remove first ID from dataset and save new model using new dataset
pharmpy data filter run1.mod 'ID!=1'
# Run tool for selecting IIV structure
pharmpy run iivsearch run1.mod
Contact
=======
This is the `team behind Pharmpy <https://pharmpy.github.io/latest/contributors.html>`_
Please ask a question in an issue or contact one of the maintainers if you have any questions.
Contributing
------------
If you interested in contributing to Pharmpy, you can find more information under
`Contribute <https://pharmpy.github.io/latest/contribute.html#contribute>`_.
Raw data
{
"_id": null,
"home_page": "https://pharmpy.github.io",
"name": "pharmpy-core",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "pharmacometrics",
"author": "Rikard Nordgren",
"author_email": "rikard.nordgren@farmaci.uu.se",
"download_url": "https://files.pythonhosted.org/packages/52/43/79509796cd2b7c97ac1ad19cbf471a48500f2bc93e084e971a3e1d15ce5d/pharmpy_core-1.5.0.tar.gz",
"platform": null,
"description": "|badge1| |badge2| |badge3| |badge4| |badge5| |badge6|\n\n.. |badge1| image:: https://img.shields.io/pypi/v/pharmpy-core.svg\n :target: https://pypi.org/project/pharmpy-core\n\n.. |badge2| image:: https://img.shields.io/pypi/l/pharmpy-core.svg\n :target: https://github.com/pharmpy/pharmpy/blob/main/LICENSE.LESSER\n\n.. |badge3| image:: https://github.com/pharmpy/pharmpy/actions/workflows/main.yml/badge.svg\n :target: https://github.com/pharmpy/pharmpy/actions\n\n.. |badge4| image:: https://img.shields.io/pypi/pyversions/pharmpy-core\n :target: https://www.python.org/downloads/\n\n.. |badge5| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n\n.. |badge6| image:: https://codecov.io/gh/pharmpy/pharmpy/branch/main/graph/badge.svg?token=JZTHXXQPII\n :target: https://codecov.io/gh/pharmpy/pharmpy\n\n.. _README:\n\n|logo|\n======\n\n.. |logo| image:: https://github.com/pharmpy/pharmpy/raw/main/docs/Pharmpy_logo.svg\n :width: 250\n\nPharmpy is an open-source software package for pharmacometric modeling. It has functionality ranging from reading and\nmanipulating model files and datasets to full tools where subsequent results are collected and presented.\n\nFeatures include:\n\n* A **model abstraction** which splits a model into core components which Pharmpy understands and can manipulate:\n parameters, random variables, statements (including ODE system), dataset, and execution steps\n* An **abstraction for modelfit results** which splits a parsed results into core components: e.g. OFV, parameter\n estimates, relative standard errors (RSEs), residuals, predictions\n* **Functions for manipulation of models and datasets** in the modeling-module: e.g. change structural model, add\n time-after-dose column, deidentify dataset\n* **Tools to aid model development** in the tools-module: execution of models within Python/R scripts, automatic\n development of models (e.g. AMD, IIVSearch, RUVSearch), comparison of estimation methods\n* Support for **multiple estimation tools**: parse NONMEM models, execute NONMEM, nlmixr2, and rxODE2 models, run all\n Pharmpy tools with NONMEM and some with nlmixr2\n\nFor more comprehensive information and documentation, see: https://pharmpy.github.io\n\nPharmpy can be used as a regular Python package, in R via the `pharmr <https://github.com/pharmpy/pharmr>`_ package,\nor via its built in command line interface.\n\nGetting started\n===============\n\nThe sections below are intended as first steps, please check our `website <https://pharmpy.github.io>`_ website for\nmore comprehensive documentation, such as user guides and API references.\n\nInstallation\n------------\n\nFor installation in R, see `pharmr <https://github.com/pharmpy/pharmr>`_.\n\nInstall the latest stable version from PyPI:\n\n pip install pharmpy-core # or 'pip3 install' if that is your default python3 pip\n\nPython Example\n--------------\n\n.. code-block:: none\n\n >>> from pharmpy.modeling import read_model\n >>> from pharmpy.tools import load_example_modelfit_results\n >>> model = load_example_model(\"pheno\")\n >>> model.parameters\n value lower upper fix\n POP_CL 0.004693 0.00 \u221e False\n POP_VC 1.009160 0.00 \u221e False\n COVAPGR 0.100000 -0.99 \u221e False\n IIV_CL 0.030963 0.00 \u221e False\n IIV_VC 0.031128 0.00 \u221e False\n SIGMA 0.013086 0.00 \u221e False\n >>> res = load_example_modelfit_results(\"pheno\")\n >>> res.parameter_estimates\n POP_CL 0.004696\n POP_VC 0.984258\n COVAPGR 0.158920\n IIV_CL 0.029351\n IIV_VC 0.027906\n SIGMA 0.013241\n Name: estimates, dtype: float64\n >>>\n\nCLI Example\n-----------\n\n.. code-block:: none\n\n # Get help\n pharmpy -h\n\n # Remove first ID from dataset and save new model using new dataset\n pharmpy data filter run1.mod 'ID!=1'\n\n # Run tool for selecting IIV structure\n pharmpy run iivsearch run1.mod\n\n\nContact\n=======\n\nThis is the `team behind Pharmpy <https://pharmpy.github.io/latest/contributors.html>`_\n\nPlease ask a question in an issue or contact one of the maintainers if you have any questions.\n\nContributing\n------------\n\nIf you interested in contributing to Pharmpy, you can find more information under\n`Contribute <https://pharmpy.github.io/latest/contribute.html#contribute>`_.\n",
"bugtrack_url": null,
"license": "GNU Lesser General Public License v3 (LGPLv3)",
"summary": "Pharmacometric modeling",
"version": "1.5.0",
"project_urls": {
"Bug Tracker": "https://github.com/pharmpy/pharmpy/issues",
"Homepage": "https://pharmpy.github.io",
"Source Code": "https://github.com/pharmpy/pharmpy"
},
"split_keywords": [
"pharmacometrics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "202a74b85a11ac1d562780cda03e128deacfdb7c244e5f9c8cbf82cb48fa88fd",
"md5": "30ffe57f46c00fde6d175d11e8eccc64",
"sha256": "b6ed9edde63cc832e9d9c4b0bd74b7fe62f02ea537b00e67dd8ba35ab12806e5"
},
"downloads": -1,
"filename": "pharmpy_core-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30ffe57f46c00fde6d175d11e8eccc64",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 926317,
"upload_time": "2025-01-15T16:59:08",
"upload_time_iso_8601": "2025-01-15T16:59:08.779108Z",
"url": "https://files.pythonhosted.org/packages/20/2a/74b85a11ac1d562780cda03e128deacfdb7c244e5f9c8cbf82cb48fa88fd/pharmpy_core-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "524379509796cd2b7c97ac1ad19cbf471a48500f2bc93e084e971a3e1d15ce5d",
"md5": "7ca2d373544d6d0575cd5e2bfe3abdcc",
"sha256": "d78f54b3b4f06f2ac39b25f27499fbbe2822edfe30941c90352eb29769226721"
},
"downloads": -1,
"filename": "pharmpy_core-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "7ca2d373544d6d0575cd5e2bfe3abdcc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 3261806,
"upload_time": "2025-01-15T16:59:12",
"upload_time_iso_8601": "2025-01-15T16:59:12.255535Z",
"url": "https://files.pythonhosted.org/packages/52/43/79509796cd2b7c97ac1ad19cbf471a48500f2bc93e084e971a3e1d15ce5d/pharmpy_core-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 16:59:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pharmpy",
"github_project": "pharmpy",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "alabaster",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "altair",
"specs": [
[
"==",
"5.5.0"
]
]
},
{
"name": "appdirs",
"specs": [
[
"==",
"1.4.4"
]
]
},
{
"name": "asttokens",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "attrs",
"specs": [
[
"==",
"24.3.0"
]
]
},
{
"name": "Babel",
"specs": [
[
"==",
"2.16.0"
]
]
},
{
"name": "beautifulsoup4",
"specs": [
[
"==",
"4.12.3"
]
]
},
{
"name": "bleach",
"specs": [
[
"==",
"6.2.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.12.14"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.1"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.8"
]
]
},
{
"name": "cloudpickle",
"specs": [
[
"==",
"3.1.1"
]
]
},
{
"name": "comm",
"specs": [
[
"==",
"0.2.2"
]
]
},
{
"name": "csscompressor",
"specs": [
[
"==",
"0.9.5"
]
]
},
{
"name": "dask",
"specs": [
[
"==",
"2024.12.1"
]
]
},
{
"name": "debugpy",
"specs": [
[
"==",
"1.8.11"
]
]
},
{
"name": "decorator",
"specs": [
[
"==",
"5.1.1"
]
]
},
{
"name": "defusedxml",
"specs": [
[
"==",
"0.7.1"
]
]
},
{
"name": "distributed",
"specs": [
[
"==",
"2024.12.1"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.21.2"
]
]
},
{
"name": "exceptiongroup",
"specs": [
[
"==",
"1.2.2"
]
]
},
{
"name": "executing",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "fastjsonschema",
"specs": [
[
"==",
"2.21.1"
]
]
},
{
"name": "fsspec",
"specs": [
[
"==",
"2024.12.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "imagesize",
"specs": [
[
"==",
"1.4.1"
]
]
},
{
"name": "importlib_metadata",
"specs": [
[
"==",
"8.5.0"
]
]
},
{
"name": "ipykernel",
"specs": [
[
"==",
"6.29.5"
]
]
},
{
"name": "ipython",
"specs": [
[
"==",
"8.31.0"
]
]
},
{
"name": "ipywidgets",
"specs": [
[
"==",
"8.1.5"
]
]
},
{
"name": "jedi",
"specs": [
[
"==",
"0.19.2"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.5"
]
]
},
{
"name": "jsonschema",
"specs": [
[
"==",
"4.23.0"
]
]
},
{
"name": "jsonschema-specifications",
"specs": [
[
"==",
"2024.10.1"
]
]
},
{
"name": "jupyter-client",
"specs": [
[
"==",
"8.6.3"
]
]
},
{
"name": "jupyter-core",
"specs": [
[
"==",
"5.7.2"
]
]
},
{
"name": "jupyter-sphinx",
"specs": [
[
"==",
"0.5.3"
]
]
},
{
"name": "jupyterlab-pygments",
"specs": [
[
"==",
"0.3.0"
]
]
},
{
"name": "jupyterlab-widgets",
"specs": [
[
"==",
"3.0.13"
]
]
},
{
"name": "lark",
"specs": [
[
"==",
"1.2.2"
]
]
},
{
"name": "locket",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"5.3.0"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"3.0.2"
]
]
},
{
"name": "matplotlib-inline",
"specs": [
[
"==",
"0.1.7"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "mistune",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "mpmath",
"specs": [
[
"==",
"1.3.0"
]
]
},
{
"name": "msgpack",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "narwhals",
"specs": [
[
"==",
"1.22.0"
]
]
},
{
"name": "nbclient",
"specs": [
[
"==",
"0.10.2"
]
]
},
{
"name": "nbconvert",
"specs": [
[
"==",
"7.16.5"
]
]
},
{
"name": "nbformat",
"specs": [
[
"==",
"5.10.4"
]
]
},
{
"name": "nest-asyncio",
"specs": [
[
"==",
"1.6.0"
]
]
},
{
"name": "networkx",
"specs": [
[
"==",
"3.4.2"
]
]
},
{
"name": "numexpr",
"specs": [
[
"==",
"2.10.2"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.2"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.3"
]
]
},
{
"name": "pandocfilters",
"specs": [
[
"==",
"1.5.1"
]
]
},
{
"name": "parso",
"specs": [
[
"==",
"0.8.4"
]
]
},
{
"name": "partd",
"specs": [
[
"==",
"1.4.2"
]
]
},
{
"name": "patsy",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "pexpect",
"specs": [
[
"==",
"4.9.0"
]
]
},
{
"name": "platformdirs",
"specs": [
[
"==",
"4.3.6"
]
]
},
{
"name": "prompt-toolkit",
"specs": [
[
"==",
"3.0.48"
]
]
},
{
"name": "psutil",
"specs": [
[
"==",
"6.1.1"
]
]
},
{
"name": "ptyprocess",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "pure-eval",
"specs": [
[
"==",
"0.2.3"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.19.1"
]
]
},
{
"name": "pyreadr",
"specs": [
[
"==",
"0.5.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2024.2"
]
]
},
{
"name": "pywin32",
"specs": [
[
">=",
"302"
],
[
"!=",
"304"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.2"
]
]
},
{
"name": "pyzmq",
"specs": [
[
"==",
"26.2.0"
]
]
},
{
"name": "referencing",
"specs": [
[
"==",
"0.35.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.9.4"
]
]
},
{
"name": "rpds-py",
"specs": [
[
"==",
"0.22.3"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.15.1"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "snowballstemmer",
"specs": [
[
"==",
"2.2.0"
]
]
},
{
"name": "sortedcontainers",
"specs": [
[
"==",
"2.4.0"
]
]
},
{
"name": "soupsieve",
"specs": [
[
"==",
"2.6"
]
]
},
{
"name": "Sphinx",
"specs": [
[
"==",
"8.1.3"
]
]
},
{
"name": "sphinxcontrib-applehelp",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "sphinxcontrib-devhelp",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "sphinxcontrib-htmlhelp",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "sphinxcontrib-jsmath",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "sphinxcontrib-qthelp",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "sphinxcontrib-serializinghtml",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "stack-data",
"specs": [
[
"==",
"0.6.3"
]
]
},
{
"name": "symengine",
"specs": [
[
"==",
"0.13.0"
]
]
},
{
"name": "statsmodels",
"specs": [
[
"==",
"0.14.4"
]
]
},
{
"name": "sympy",
"specs": [
[
"==",
"1.13.3"
]
]
},
{
"name": "tblib",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "tinycss2",
"specs": [
[
"==",
"1.4.0"
]
]
},
{
"name": "tomli",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "toolz",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "tornado",
"specs": [
[
"==",
"6.4.2"
]
]
},
{
"name": "traitlets",
"specs": [
[
"==",
"5.14.3"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2024.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.3.0"
]
]
},
{
"name": "wcwidth",
"specs": [
[
"==",
"0.2.13"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "widgetsnbextension",
"specs": [
[
"==",
"4.0.13"
]
]
},
{
"name": "zict",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.21.0"
]
]
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
},
{
"name": "tflite_runtime",
"specs": []
}
],
"tox": true,
"lcname": "pharmpy-core"
}