Skip to main content

PyPI-Server Unit tests

CompressedList Implementation in Python

A Python implementation of the CompressedList class from R/Bioconductor for memory-efficient list-like objects.

CompressedList is a memory-efficient container for list-like objects. Instead of storing each list element separately, it concatenates all elements into a single vector-like object and maintains information about where each original element begins and ends. This approach is significantly more memory-efficient than standard lists, especially when dealing with many list elements.

Install

To get started, install the package from PyPI

pip install compressed-lists

Usage

from compressed_lists import CompressedIntegerList, CompressedStringList, Partitioning

# Create a CompressedIntegerList
int_data = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]
names = ["A", "B", "C"]
int_list = CompressedIntegerList.from_list(int_data, names)

# Access elements
print(int_list[0])      # [1, 2, 3]
print(int_list["B"])    # [4, 5]
print(int_list[1:3])    # Slice of elements

# Apply a function to each element
squared = int_list.lapply(lambda x: [i**2 for i in x])
print(squared[0])       # [1, 4, 9]

# Convert to a regular Python list
regular_list = int_list.to_list()

# Create a CompressedStringList from lengths
import biocutils as ut
char_data = ut.StringList(["apple", "banana", "cherry", "date", "elderberry", "fig"])

char_list = CompressedStringList(char_data, partitioning=Partitioning.from_lengths([2,3,1]))
print(char_list)

Partitioning

The Partitioning class handles the information about where each element begins and ends in the concatenated data. It allows for efficient extraction of elements without storing each element separately.

from compressed_lists import Partitioning

# Create partitioning from end positions
ends = [3, 5, 10]
names = ["A", "B", "C"]
part = Partitioning(ends, names)

# Get partition range for an element
start, end = part[1]  # Returns (3, 5)

Note

This project has been set up using BiocSetup and PyScaffold.

Metadata

Release files for compressed-lists 0.4.6

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

Source distribution (sdist)

Source distribution for compressed-lists 0.4.6
File Size Uploaded Provenance Actions
compressed_lists-0.4.6.tar.gz 40.1 kB With provenance Details for compressed_lists-0.4.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for compressed-lists 0.4.6
File Interpreter ABI Platform Actions
compressed_lists-0.4.6-py3-none-any.whl Python 3 none any Details for compressed_lists-0.4.6-py3-none-any.whl

Total release size: 61.5 kB

Release files / compressed_lists-0.4.6.tar.gz

Download URL compressed_lists-0.4.6.tar.gz
Size 40.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e5adf479795566a1831c900458c707d5a648f5463a226cdc13c489594f3ad652
BLAKE2b-256 checksum
How to use checksums
1bf47f0e4dcc50cb7249bae8b72c278a571964935f34a096d95221158a727e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

Release files / compressed_lists-0.4.6-py3-none-any.whl

Download URL compressed_lists-0.4.6-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad2b123a7809ab893f088d511ea2ed1bf571c3d05a28b73b28192157c9e85e5e
BLAKE2b-256 checksum
How to use checksums
71382102160617b947bde689eb005542430f0b30f64e2ed87ca54282f1b55a13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

Security for compressed-lists 0.4.6

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for compressed_lists-0.4.6.tar.gz

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 Nov 7, 2026.

Transparency log

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