{"id":28441634,"url":"https://github.com/biocpy/compressed-lists","last_synced_at":"2026-02-22T18:03:16.319Z","repository":{"id":288352182,"uuid":"965414768","full_name":"BiocPy/compressed-lists","owner":"BiocPy","description":"Memory-efficient container for list-like objects","archived":false,"fork":false,"pushed_at":"2026-02-16T16:29:45.000Z","size":289,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-16T23:56:56.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://biocpy.github.io/compressed-lists/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BiocPy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-13T05:34:44.000Z","updated_at":"2026-01-04T04:47:00.000Z","dependencies_parsed_at":"2025-04-17T13:50:41.204Z","dependency_job_id":"8f55e150-07b4-4207-a705-4f25471e22cc","html_url":"https://github.com/BiocPy/compressed-lists","commit_stats":null,"previous_names":["biocpy/compressed-lists"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/BiocPy/compressed-lists","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2Fcompressed-lists","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2Fcompressed-lists/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2Fcompressed-lists/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2Fcompressed-lists/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BiocPy","download_url":"https://codeload.github.com/BiocPy/compressed-lists/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BiocPy%2Fcompressed-lists/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29721056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T05:06:22.459Z","updated_at":"2026-02-22T18:03:16.310Z","avatar_url":"https://github.com/BiocPy.png","language":"Python","readme":"[![PyPI-Server](https://img.shields.io/pypi/v/compressed-lists.svg)](https://pypi.org/project/compressed-lists/)\n![Unit tests](https://github.com/BiocPy/compressed-lists/actions/workflows/run-tests.yml/badge.svg)\n\n# CompressedList Implementation in Python\n\nA Python implementation of the `CompressedList` class from R/Bioconductor for memory-efficient list-like objects.\n\n`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.\n\n## Install\n\nTo get started, install the package from [PyPI](https://pypi.org/project/compressed-lists/)\n\n```bash\npip install compressed-lists\n```\n\n## Usage\n\n```py\nfrom compressed_lists import CompressedIntegerList, CompressedStringList, Partitioning\n\n# Create a CompressedIntegerList\nint_data = [[1, 2, 3], [4, 5], [6, 7, 8, 9]]\nnames = [\"A\", \"B\", \"C\"]\nint_list = CompressedIntegerList.from_list(int_data, names)\n\n# Access elements\nprint(int_list[0])      # [1, 2, 3]\nprint(int_list[\"B\"])    # [4, 5]\nprint(int_list[1:3])    # Slice of elements\n\n# Apply a function to each element\nsquared = int_list.lapply(lambda x: [i**2 for i in x])\nprint(squared[0])       # [1, 4, 9]\n\n# Convert to a regular Python list\nregular_list = int_list.to_list()\n\n# Create a CompressedStringList from lengths\nimport biocutils as ut\nchar_data = ut.StringList([\"apple\", \"banana\", \"cherry\", \"date\", \"elderberry\", \"fig\"])\n\nchar_list = CompressedStringList(char_data, partitioning=Partitioning.from_lengths([2,3,1]))\nprint(char_list)\n```\n\n### Partitioning\n\nThe `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.\n\n```python\nfrom compressed_lists import Partitioning\n\n# Create partitioning from end positions\nends = [3, 5, 10]\nnames = [\"A\", \"B\", \"C\"]\npart = Partitioning(ends, names)\n\n# Get partition range for an element\nstart, end = part[1]  # Returns (3, 5)\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e Check out the [documentation](https://biocpy.github.io/compressed-lists) for available compressed list implementations and extending `CompressedLists` to custom data types.\n\n\u003c!-- biocsetup-notes --\u003e\n\n## Note\n\nThis project has been set up using [BiocSetup](https://github.com/biocpy/biocsetup)\nand [PyScaffold](https://pyscaffold.org/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fcompressed-lists","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiocpy%2Fcompressed-lists","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocpy%2Fcompressed-lists/lists"}