Skip to main content

A CLI tool to permutate with custom options by @yilmazhasan

Project description

Custom Permutation

Version 1.0.6

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"

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.6.tar.gz (5.2 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.6-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: custom_permutation-1.0.6.tar.gz
  • Upload date:
  • Size: 5.2 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.6.tar.gz
Algorithm Hash digest
SHA256 21607b94f7a6b09d51ed6e3ff346282ced230503b0b54488b479fbae9f9c0ba8
MD5 06aba05e13c2af134e83c77d1af1875a
BLAKE2b-256 b715468caaa44ce47bcacb35d9cb7a7b791556ebe4f93424570126f8e6cb1008

See more details on using hashes here.

Provenance

The following attestation bundles were made for custom_permutation-1.0.6.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.6-py3-none-any.whl.

File metadata

File hashes

Hashes for custom_permutation-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa6f3b0394cba3f15243d8b73b3614fe7954e5093aa0188df552de06356fd3f
MD5 039c0a0ed9673a7fdc16e0cac8804165
BLAKE2b-256 a7993a73787ca878194317a1bdd897c4272de5e7177e7f003e133b5532946333

See more details on using hashes here.

Provenance

The following attestation bundles were made for custom_permutation-1.0.6-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