castorbind
Python bindings for the C++ core of castor, the R package for efficient phylogenetics on large trees (tree simulation, ancestral state reconstruction, and fitting models of trait evolution and diversification), with no R needed at build time or at runtime.
- Free software: GPL-2.0-or-later
- Repository: https://github.com/mmore500/castorbind
castor is by Stilianos Louca, and full credit for it is due to its original author. castorbind is not an official port.
castorbind wraps every C++ function castor exports in castorbind.legacy, under its castor name minus the _CPP suffix, taking castor's own flat, 0-based inputs and returning dicts.
R's random number generator is included, so outputs match castor in R bit for bit, including seeded simulations: set_seed(n) gives the same random stream as set.seed(n) in R.
castor's R-level functions are not included.
castorbind is versioned independently of castor; castorbind.castor_version gives the version of castor it wraps.
Usage
from castorbind import legacy as cb
r = cb.read_Newick_string(
input="((a:1,b:1):1,c:2);",
underscores_as_blanks=False,
interpret_quotes=True,
look_for_edge_names=False,
look_for_edge_numbers=False,
)
depths = cb.get_distances_from_root(
Ntips=r["Ntips"],
Nnodes=r["Nnodes"],
Nedges=len(r["tree_edge"]) // 2,
tree_edge=r["tree_edge"],
edge_length=r["edge_lengths"],
)
- Trees are counts plus a row-major, 0-based
tree_edgearray of length 2 × Nedges (a(Nedges, 2)array also works). Tips are 0 to Ntips−1 and internal nodes follow. - Results are dicts with castor's own keys (
success,error, ...); failures are reported throughsuccess=False, not raised. - Arrays go in as numpy arrays or lists, and come back as numpy arrays (matrices as 2-D arrays); strings come back as lists of
str.
Installation
python3 -m pip install castorbind
Building from source needs a C++17 compiler and CMake:
git clone --recursive https://github.com/mmore500/castorbind
python3 -m pip install ./castorbind
AI Use
Substantial portions of castorbind were prepared using agentic coding tools.
Citing
If castorbind is useful in your research, please cite castor:
Louca, S., & Doebeli, M. (2017). Efficient comparative phylogenetics on large trees. Bioinformatics, 34(6), 1053–1055. https://doi.org/10.1093/bioinformatics/btx701
@article{louca2017efficient,
title = {Efficient comparative phylogenetics on large trees},
volume = {34},
ISSN = {1367-4811},
url = {http://dx.doi.org/10.1093/bioinformatics/btx701},
DOI = {10.1093/bioinformatics/btx701},
number = {6},
journal = {Bioinformatics},
publisher = {Oxford University Press (OUP)},
author = {Louca, Stilianos and Doebeli, Michael},
editor = {Valencia, Alfonso},
year = {2017},
month = oct,
pages = {1053--1055}
}
Metadata
Release files for castorbind 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| castorbind-0.2.1.tar.gz | 868.7 kB | Without provenance | Details for castorbind-0.2.1.tar.gz |
Built distributions (wheels)
Total release size: 30.2 MB
Release files / castorbind-0.2.1.tar.gz
| Download URL | castorbind-0.2.1.tar.gz |
|---|---|
| Size | 868.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44bcd0a68b73adfe772e9b4f6ba48fdca65fb5b6cf80a4dc2893507b409757e5
|
|
BLAKE2b-256 checksum How to use checksums |
3ce94d29a282f5606198b09e27e2a13410d47d43443c5f2dd6fc6ebb3664fd17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | castorbind-0.2.1-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
300ecaa36df0b045191fd5dc6f0ee6b11a03ed321580becd5fd430ad57b6d9f6
|
|
BLAKE2b-256 checksum How to use checksums |
d4168864f772198e260a949f0cc6099765749c0078ee13e22c3aba9c36615481
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp313-cp313-musllinux_1_2_aarch64.whl
| Download URL | castorbind-0.2.1-cp313-cp313-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
7179301312b0cfddd7a8cfdbe24e93dcee8d59cad9a244aa7db388c0e7535dfe
|
|
BLAKE2b-256 checksum How to use checksums |
79cfed8a6a604901f5352ffa7c79d444a16be84954ca65a5176a7c779173eeec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | castorbind-0.2.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c8ef5106761999d02fc435fcbfddbab1a55e142848edde1a24f6247e430a6534
|
|
BLAKE2b-256 checksum How to use checksums |
6db717b3944d55f4ff7694efbc126df33cea358fc311a7722ba3b28c6fa86eb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | castorbind-0.2.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 985.3 kB |
| Tags | CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
be5f8e37d43335abc01ca7594161d81c1712a0e3753532254e2752d35289bab3
|
|
BLAKE2b-256 checksum How to use checksums |
268fe0796aa85e4db6808deb9275ff7a216cd448d77f8832d82dcac30d5a18a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | castorbind-0.2.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 997.6 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2400d5165f3aa3171a0bbaf9f60f21cf2b55d7d328820117a7c67e0c79df773d
|
|
BLAKE2b-256 checksum How to use checksums |
1af2132f389aa60e713c350b8234a0f2b2e874a7d8fa05d432c25cfb1cdadacd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | castorbind-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
d6618011d46be3283cb29c4bea7d401c7ed3ba86e70b923e88a63a60ad1e27a3
|
|
BLAKE2b-256 checksum How to use checksums |
e5aba1a6ea127403634d8098b4b0c2588e4a382488ea10811884e638f8784759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp312-cp312-musllinux_1_2_aarch64.whl
| Download URL | castorbind-0.2.1-cp312-cp312-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
6b7d70995b7873265471b569d2f6ff0a15989a63edcc7b3ad3ea5442508b018f
|
|
BLAKE2b-256 checksum How to use checksums |
a0c5993cd42a2f75907166bd1840335a27f87ffd90881ca08ee863e833e99f1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | castorbind-0.2.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e3f0b930e5457e46f2642afd7e73175e0cf61fd5d945523cc4b467d7301047e4
|
|
BLAKE2b-256 checksum How to use checksums |
e35469fc3495150ccaad00aabfd789e8aaa8355176ca9ba6a231841da450a66c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | castorbind-0.2.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 985.1 kB |
| Tags | CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
bef0486dcb1ce2b51a3e384fcd8219530895d3878f260316a2e5bac3f6447ad2
|
|
BLAKE2b-256 checksum How to use checksums |
cc51b9d2437c3d7f0d851de942b5b11dd30efac60f50e07bea8d1a3f904eb798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | castorbind-0.2.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 997.6 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
06799f8d84451dc64fe1edbede0e2087b13e1a3402bfa96290efbab4adda7953
|
|
BLAKE2b-256 checksum How to use checksums |
e82ec8aad7d7dc594c31209636793430fe9305ba3cc4fe5d6d16c4f4fec30e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | castorbind-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
3e295dedf30c8e22ca1bb97038858cd068ff22ceb3082e4ce23944b1d8b7d613
|
|
BLAKE2b-256 checksum How to use checksums |
15f39919726e5b514a8078e915d36afc606d3238a4c4c24993c0dc61aae0b770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp311-cp311-musllinux_1_2_aarch64.whl
| Download URL | castorbind-0.2.1-cp311-cp311-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
5af52350ec26b9d2ad12087a012dcf0067c61e1ddc799a46a580f15b697e8371
|
|
BLAKE2b-256 checksum How to use checksums |
5e2bc2605e063df1e39a44e5a2f1cb32e00a98f19bf74becdbe52c2a957f262d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | castorbind-0.2.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bec888d2db80cfce33240b35db6ab599dd5cd02c4dcd537458464cafbbd413b5
|
|
BLAKE2b-256 checksum How to use checksums |
0476552c711dcd7ec16fa583d3d6ffad3a5a9b7658e6355dfa1f2597188fad19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | castorbind-0.2.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 990.9 kB |
| Tags | CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
705d2304f80560f443a199bbc8ce19dc93e0337ceb61e1df5b56bd706b52a620
|
|
BLAKE2b-256 checksum How to use checksums |
ccaabde39f76b804b386c42099917bb8b4ad13d9bdbe4b5ec3b4c5d227899fbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | castorbind-0.2.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 994.0 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1241fbf703ba83b0d3956602ccb6c849d5fa6284d87720d71dd3e017cc0e8e34
|
|
BLAKE2b-256 checksum How to use checksums |
3fcca5f7bdd949059e694677593e0d0d142fd1e58dc8db5efac7f74915fe2a36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | castorbind-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
861782b0b86783a2261c57e6813f233ebaa95551a460c3b25f351fc4a5a5af1a
|
|
BLAKE2b-256 checksum How to use checksums |
e241a95fbedffa4003ada7dd81c67b8c70787a157ce93493798996bddc493bf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp310-cp310-musllinux_1_2_aarch64.whl
| Download URL | castorbind-0.2.1-cp310-cp310-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
8c0477ad44b5a35f6ff1b40bf11431c44bc3b53bff1429128f9cc389df560017
|
|
BLAKE2b-256 checksum How to use checksums |
404193562fb73a771304b4c0f242207d7a655376199c7f7b09e8875f20076202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | castorbind-0.2.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6e05e86740a56242c8887ebb1e84038692d5f4d2d3ea222ec80af820c7b5356d
|
|
BLAKE2b-256 checksum How to use checksums |
c4112180ca29777e31bdea300181187b6de823766eda7b295ce2cf97dd3795a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | castorbind-0.2.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 990.2 kB |
| Tags | CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
dfb67faed16fed3df141f47bb5da48c10d527aa44138c7b5d6aa8a2bb7f0a8b5
|
|
BLAKE2b-256 checksum How to use checksums |
035979901679b366b05c04135f86d472f93f3d98ec4df2bd8f22a42f31511be8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / castorbind-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | castorbind-0.2.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 992.0 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
93e6a9d40b08bdcf492568e90428dadd1c808a9c8fd42a690840b3541650a286
|
|
BLAKE2b-256 checksum How to use checksums |
3174d5ea824f0357c60e577c1dbca35830bd6cc8661d55481b2dab6f378f98d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for castorbind 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.