Skip to main content

A Python package for generating cases in a list.

Project description

casepy

Documentation Status made-with-python PyPI download total GitHub license

casepy is a Python package for the advanced case combination and permutation calculation.

This package is designed to be possible to calculation of the case combination and permutation from the duplicated elements.

This package is designed to calculate combinations and permutations from the duplicate elements list. You can designate the number of elements you want to select. For instance, you can get all combinations and permutations of choosing 5 elements in a given list [1,1,2,3,4,5,5].

The combination and permutation list is sorted by numerical or alphabetical. Using the n-th-permutation or n-th-combination, you can get the n-th permutation or n-th combination of a given parameter without calculating 0-th to (n-1)-th case (current method).

Documentation: Documentation Status

Installation

You can install casepy via pip from PyPI:

$ pip install casepy

Quick Start

import casepy

element_list = [1, 2, 2, 3, 4]

all_combinations = casepy.all_combinations(element_list, 2)
# [[1, 2], [1, 3], [1, 4], [2, 2], [2, 3], [2, 4], [3, 4]]

all_permutations = casepy.all_permutations(test_list, 2)
# [[1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [2, 3], [2, 4], [3, 1], [3, 2], [3, 4], [4, 1], [4, 2], [4, 3]]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casepy-0.2.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casepy-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file casepy-0.2.0.tar.gz.

File metadata

  • Download URL: casepy-0.2.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for casepy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d323c4718e409b28a319d4597a497433efa7fffad4b90f370021b998dd67a88
MD5 dbc921fe57b6809757d51003e36d0d2c
BLAKE2b-256 4f0af8c88e57867f0995f18ee195db0c3f138593872213c49f4cdd7a0cec420a

See more details on using hashes here.

File details

Details for the file casepy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: casepy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for casepy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 437915cb8af2e11833dab9dd3ae7b2708424cd42d6ea2bc938686c85c7ce080f
MD5 4203b1e9b2b510d16c90f1cc7cdddec3
BLAKE2b-256 3b5ef99c4df22d53d743c2e60bc4ed26db1c4b6bc5dfeda8bf5101a4b93ac817

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page