Skip to main content

QSPy: Quantitative Systems Pharmacology in Python

img

QSPy ('Cue Ess Pie') is a Python-based framework for the programmatic construction of rule-based mathematical models that describe drugs and their interactions with biological systems. Built on PySB, it enables modular modeling and simulation of quantitative systems pharmacology (QSP) models.

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Python version badge PySB version badge license release Ruff Static Badge CI Static Badge

💊 💻

What's new in

version 0.1.0

  • First release!

Table of Contents

  1. Install
    1. Dependencies
    2. pip install
    3. Manual install
  2. License
  3. Change Log
  4. Documentation and Usage
    1. Quick Overview
    2. Example
  5. Contact
  6. Contributing
  7. Supporting
  8. Other Useful Tools

Install

! Note
qspy is still in version zero development so new versions may not be backwards compatible.

qspy has been developed with Python 3.11.9 and PySB 1.15.0.

Dependencies

QSPy has the following core dependencies:

Installation

  1. Install PySB using conda or mamba:
conda install -c alubbock pysb

OR

mamba install -c alubbock pysb
  1. Install qspy with pip:
pip install cueesspie

Testing and Coverage

For automated testing and coverage analysis:

pip install pytest coverage nose

License

This project is licensed under the BSD 2-Clause License - see the LICENSE file for details


Change Log

See: CHANGELOG


Documentation and Usage

Full documentation is available at:

https://borealis-biomodeling.github.io/qspy/

Built With:

Built with Material for MkDocs

Quick Start Example

from qspy import Model, parameters, monomers, rules, initials, observables
from qspy.functionaltags import PROTEIN, DRUG
from qspy.validation import ModelMetadataTracker, ModelChecker

Model(name="SimpleQSP").with_units(concentration='nM', time='1/s', volume='L')

with parameters():
    k_f = (1.0, "1/min")
    k_r = (0.5, "1/min")
    L_0 = (100.0, "nM")
    R_0 = (10.0, "nM")

with monomers():
    L = (["b"], {}, DRUG.AGONIST)
    R = (["b", 'active'], {'active':[False, True]}, PROTEIN.RECEPTOR)

with rules():
    bind = (L(b=None) + R(b=None, active=False) | L(b=1) % R(b=1, active=True), k_f, k_r)

with initials():
    L(b=None) << L_0
    R(b=None, active=False) << R_0

with observables():
    L() > "L_total"
    R() > "R_total"
    R(active=True) > "R_active"

# Track and export model metadata
ModelMetadataTracker(version="1.0.0", author="Alice", export_toml=True)

# Run model validation checks
ModelChecker()

# Generate a Markdown summary of the model
model.markdown_summary()
               

Contact

  • Issues 🐛 : Please open a GitHub Issue to report any problems/bugs with the code or its execution, or to make any feature requests.
  • Discussions ❔ : If you have questions, suggestions, or want to discuss anything else related to the project, feel free to use the Discussions board.
  • Support ❓ : For any other support inquiries you can send an email to blakeaw1102@gmail.com.

Contributing

Interested in contributing to this project? See CONTRIBUTING for details.


Supporting

I'm very happy that you've chosen to use qspy. This add-on is a project that I develop and maintain on my own time, independently of the core PySB library, and without external funding. If you've found it helpful, here are a few ways you can support its ongoing development:

  • Star ⭐ : Show your support by starring the GitHub repository. It helps increase the project's visibility and lets others know it's useful. It also benefits my motivation to continue improving the package!
  • Share 📣 : Sharing qspy on your social media, forums, or with your network is another great way to support the project. It helps more people discover qspy, which in turn motivates me to keep developing!
  • Cite 📚 : Citing or mentioning this software in your work, publications, or projects is another valuable way to support it. It helps spread the word and acknowledges the effort put into its development, which is greatly appreciated!
  • Sponsor 💵 : Even small financial contributions, such as spotting me the cost of a tea through Ko-fi so I can get my caffeine fix, can make a big difference! Every little bit can help me continue developing this and other open-source projects.

ko-fi


Acknowledegments

Special thanks for Martin Breuss's MkDocs tuorial, which served as the template for setting up and generating documentation using Mkdocs.

AI Acknowledgement

This package was developed with AI assistance. This inlcudes the generative AI tools ChatGPT, Microsoft Copilot, and GitHub Copilot, which were used to brainstorm features and implementation details, draft initial code snippets and boilerplate, and support documentation through outlining, editing, and docstring generation.


Metadata

Release files for cueesspie 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cueesspie 0.1.1
File Size Uploaded
cueesspie-0.1.1.tar.gz 40.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cueesspie 0.1.1
File Interpreter ABI Platform
cueesspie-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.3 kB

Release files / cueesspie-0.1.1.tar.gz

Download URL cueesspie-0.1.1.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de31a225e13b44c95e3702d059c1f081c96a620c1a317824c1843e8ce4a4688f
BLAKE2b-256 checksum
How to use checksums
f490b5e4c6815f94885b949af28f18c144ea82742991ae709e5832b6f3f8859f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2025.

Transparency log

Release files / cueesspie-0.1.1-py3-none-any.whl

Download URL cueesspie-0.1.1-py3-none-any.whl
Size 47.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fdc3845aa773cd308a1380496dc53c6d9a7094726cd6789e733b17ff8a318e8
BLAKE2b-256 checksum
How to use checksums
dc63b5b1cdce4a9061736a0cdb7c33ae5f464d1577392a50ae7a37fdc44e7a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page