Skip to main content

crosszip

PyPI version Python versions

crosszip is a Python utility that makes it easy to apply a function to all possible combinations of elements from multiple iterables. It combines the power of the Cartesian product and functional programming into a single, intuitive tool.

Additionally, @pytest.mark.crosszip_parametrize is a pytest marker that simplifies running tests with all possible combinations of parameter values.

Installation

uv add crosszip

Usage

Example of using crosszip:

# @pyodide
# Label Generation for Machine Learning

from crosszip import crosszip


def create_label(category, subcategory, version):
    return f"{category}_{subcategory}_v{version}"


categories = ["cat", "dog"]
subcategories = ["small", "large"]
versions = ["1.0", "2.0"]

labels = crosszip(create_label, categories, subcategories, versions)
print(labels)
['cat_small_v1.0', 'cat_small_v2.0', 'cat_large_v1.0', 'cat_large_v2.0', 'dog_small_v1.0', 'dog_small_v2.0', 'dog_large_v1.0', 'dog_large_v2.0']

Example of using pytest marker crosszip_parametrize:

# @pyodide
# Testing Power Function

import math
import crosszip
import pytest


@pytest.mark.crosszip_parametrize(
    "base",
    [2, 10],
    "exponent",
    [-1, 0, 1],
)
def test_power_function(base, exponent):
    result = math.pow(base, exponent)
    assert result == base**exponent


print("Tests executed successfully.")
Tests executed successfully.

For more examples, check out the package documentation at: https://www.indrapatil.com/crosszip/

Key Features

  • Flexible Input: Works with any iterables, including lists, tuples, sets, and generators.
  • pytest Plugin: Provides a crosszip_parametrize marker for running tests with all possible combinations of parameter values.
  • Simple API: Minimalist, intuitive design for quick integration into your projects.
  • Advanced patterns: See the Advanced Usage guide for memory efficiency strategies, managing test explosion, and testing validation functions across input types and edge cases.

License

This project is licensed under the MIT License.

Code of Conduct

Please note that the crosszip project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Acknowledgements

Hex sticker font is Rubik, and the image is taken from icon made by Freepik and available at flaticon.com.

Metadata

Release files for crosszip 1.5.0

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

Source distribution (sdist)

Source distribution for crosszip 1.5.0
File Size Uploaded Provenance Actions
crosszip-1.5.0.tar.gz 6.9 kB With provenance Details for crosszip-1.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 14.3 kB

Release files / crosszip-1.5.0.tar.gz

Download URL crosszip-1.5.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e98a3cbd8282f33f925a990bd987f8bc5373474fc7b11eac54aee2bd06679b84
BLAKE2b-256 checksum
How to use checksums
d4f65781f2596287eef4235e1822abf235fe59fde6880f74fa174b7068715856
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 Oct 7, 2026.

Transparency log

Release files / crosszip-1.5.0-py3-none-any.whl

Download URL crosszip-1.5.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a3c3bb08997b136f5dfc879d822d0cae64ab1035121bf399726244d85f49292
BLAKE2b-256 checksum
How to use checksums
1ba36d0497f05d17f8a4f0714e5b621726fa16bb12164fb510539afed8c66fe9
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 Oct 7, 2026.

Transparency log

Security for crosszip 1.5.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for crosszip-1.5.0.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 Oct 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