Skip to main content

A CLI tool to permutate with custom options by @yilmazhasan

Project description

Custom Permutation

Version 1.0.7

Python implementation for Custom Permutation.

Usage

Programmatic usage

from custom_permutation import cli

cli.generate(items=["a", "b", "c", "d"], includes=["a,1"], excludes=["c,2"])

Output:

[
    ['b', 'a', 'd', 'c'],
    ['c', 'a', 'b', 'd'],
    ['c', 'a', 'd', 'b'],
    ['d', 'a', 'b', 'c']
]

CLI usage

custom_permutation --items "a,b,c,d" -i "a,1" -x "c,2" -o stdout

Output:

['b', 'a', 'd', 'c']
['c', 'a', 'b', 'd']
['c', 'a', 'd', 'b']
['d', 'a', 'b', 'c']

Installation

pip install custom_permutation

Set up locally for development

  1. Clone the repository
  2. Create and activate the virtural environment

python -m venv .venv

source venv_mysite/bin/activate

  1. Install requirements:

pip install -r requirements.txt

  1. Run the app:

python src/custom_permutation/app.py --items a,b,c,d -i a,0 -x c,1 -x a,2

Args Explained

--items a,b,c,d -i a,0 -x c,1 -x a,2

This indicates:

  • we have four items ['a', 'b', 'c', 'd'].
  • We want to have a to be at index 0.
  • We want not to have c at index 1 and a index 2.
  • Thus, the permutation will be generated based o the options below:
[
    ['a'],
    ['a', 'b', 'd'],
    ['a', 'b', 'd'],
    ['a', 'b', 'c', 'd']
]

The result would be four lists:

a,b,c,d
a,b,d,c
a,d,b,c
a,d,c,b

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

custom_permutation-1.0.7.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

custom_permutation-1.0.7-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file custom_permutation-1.0.7.tar.gz.

File metadata

  • Download URL: custom_permutation-1.0.7.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for custom_permutation-1.0.7.tar.gz
Algorithm Hash digest
SHA256 265840e171f8788783322f4e7b076c6bfb236e57d0fde33392798f1b10b7b10a
MD5 a52509f6bb106caa028e94aff64e7d6d
BLAKE2b-256 738bc648429c87e4063efa14af0ab3a5c8760a608f637593ce28c4dbe35c8258

See more details on using hashes here.

Provenance

The following attestation bundles were made for custom_permutation-1.0.7.tar.gz:

Publisher: publish-to-pypi.yaml on yilmazhasan/custom_permutation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file custom_permutation-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for custom_permutation-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 07ae73c437c7f881e8e0bc1bdef10236379520ce0256e301b0be8db70b4f85d1
MD5 b94d98d61fe8a1ed2483b36d9190b8b3
BLAKE2b-256 cf9c646f0423aafad4025bbede79e71b8bd94538785bd02b0343c379be8ec47b

See more details on using hashes here.

Provenance

The following attestation bundles were made for custom_permutation-1.0.7-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on yilmazhasan/custom_permutation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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