Utilities for BiocPy
Motivation
This repository contains a variety of simple utilities for the BiocPy project, mostly convenient aspects of R that aren't provided by base Python. The aim is to simplify development of higher-level packages like scranpy and singler that would otherwise have to implement these methods individually.
Available utilities
match
import biocutils
biocutils.match(["A", "C", "E"], ["A", "B", "C", "D", "E"])
## [0, 2, 4]
factor
import biocutils
biocutils.factorize(["A", "B", "B", "A", "C", "D", "C", "D"])
## (['A', 'B', 'C', 'D'], [0, 1, 1, 0, 2, 3, 2, 3])
intersect
import biocutils
biocutils.intersect(["A", "B", "C", "D"], ["D", "A", "E"])
## ['A', 'D']
union
import biocutils
biocutils.union(["A", "B", "C", "D"], ["D", "A", "E"])
## ['A', 'B', 'C', 'D', 'E']
subset
import biocutils
biocutils.subset(["A", "B", "C", "D", "E"], [0, 2, 4])
## ['A', 'C', 'E']
import numpy as np
y = np.array([10, 20, 30, 40, 50])
biocutils.subset(y, [0, 2, 4])
## array([10, 30, 50])
is_list_of_type
Checks if all elements of a list or tuple are of the same type.
import biocutils
import numpy as np
x = [np.random.rand(3), np.random.rand(3, 2)]
biocutils.is_list_of_type(x, np.ndarray)
## True
and many more. Check out the documentation for more information.
Release files for biocutils 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| biocutils-0.4.2.tar.gz | 72.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| biocutils-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 130.0 kB
Release files / biocutils-0.4.2.tar.gz
| Download URL | biocutils-0.4.2.tar.gz |
|---|---|
| Size | 72.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20e10da036772dde58417ecfeedda7ae21ec3a7e036814e555d134725750b135
|
|
BLAKE2b-256 checksum How to use checksums |
ede83e71659ab22c7051b4fb1fbe36c284e5252724749f601d48cddf981885e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency logRelease files / biocutils-0.4.2-py3-none-any.whl
| Download URL | biocutils-0.4.2-py3-none-any.whl |
|---|---|
| Size | 57.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c35df319575b090094d9196b1994aa8e1ab68668818b2dcc8b90874f410f828
|
|
BLAKE2b-256 checksum How to use checksums |
7076de838f8cb768967a5f2c4db50c4519a8dff945cc70d97d8646efabf1ce51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 31, 2026.
Transparency log