Skip to main content

Tests Coverage Status Documentation PyPI

sercol

sercol provides Collection, a sequence that filters and groups while keeping its collection type and source metadata, and saves to JSON through serializable. It is the base class for varcode's VariantCollection and EffectCollection and mhctools' BindingPredictionCollection, so their filtering and grouping behave the same.

Install

python -m pip install sercol

sercol needs Python 3.11 or later; it installs serializable and pandas 3.

Quick start

from sercol import Collection

values = Collection([5, 2, 3, 2])
selected = values.filter(lambda value: value >= 3)
groups = values.groupby(lambda value: value % 2)
print(list(selected))
print({key: list(group) for key, group in groups.items()})
[5, 3]
{1: [5, 3], 0: [2, 2]}

filter() returns a new collection and groupby() a dictionary of collections, each of the original class with the same distinct, sort_key and sources. The original collection is unchanged.

Documentation

The documentation covers, in reading order:

  1. Getting started: filter, group, save and reload.
  2. Select, order and track values: duplicates, sorting, threshold lookups, multiple groups, source metadata and subclassing.
  3. API reference.

Development

python -m pip install -e . pytest pytest-cov ruff
./lint.sh   # ruff check
./test.sh   # pytest with coverage
python -m pip install -r requirements-docs.txt
./docs.sh   # strict build, rendered links and runnable examples

The development installer uses python from the active environment. Set PYTHON=/path/to/python ./develop.sh to select an interpreter explicitly; additional arguments are passed to pip.

License

Apache 2.0; see LICENSE.

Metadata

Release files for sercol 1.2.2

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

Source distribution (sdist)

Source distribution for sercol 1.2.2
File Size Uploaded Provenance Actions
sercol-1.2.2.tar.gz 18.1 kB Without provenance Details for sercol-1.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 31.2 kB

Release files / sercol-1.2.2.tar.gz

Download URL sercol-1.2.2.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
772fb424fa1c3be8c7bf21818574ca2c6da61d31c32936d68c1f0f8b801cad2d
BLAKE2b-256 checksum
How to use checksums
e49280e49d498dc17154ab06d179f9042e40f7b9cec8f2af38381dd0376707ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Release files / sercol-1.2.2-py3-none-any.whl

Download URL sercol-1.2.2-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cee741242489da20ae09c98f6da8c11314423f3dbcb06d39c42aa81efe15a2e
BLAKE2b-256 checksum
How to use checksums
ae1201f4a9832a12c6b9c8d4f2f23c93685f478cd3ccf2ca6a2fed9ff779bfb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Security for sercol 1.2.2

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.

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