A CLI tool to permutate with custom options by @yilmazhasan
Project description
Custom Permutation
Version 1.0.8
Python implementation for Custom Permutation.
Usage
Programmatic usage
from custom_permutation import CustomPermutation
CustomPermutation.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
-
Clone the repository
-
Create and activate the virtural environment
python -m venv .venvsource venv_mysite/bin/activate -
Install requirements:
pip install -r requirements.txt -
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 that:
- We have four items
['a', 'b', 'c', 'd']. - We want
ato be set at index0. - We want neither
cto be at index1noraindex2. - Thus, the permutation will be generated based on the options below for each indexes:
[['a'], ['a', 'b', 'd'], ['a', 'b', 'd'], ['a', 'b', 'c', 'd']]
idx n must be a member in list such as:
- idx
0$\in$['a'] - idx
1$\in$['a', 'b', 'd'] - idx
2$\in$['a', 'b', 'd'] - idx
3$\in$['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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custom_permutation-1.0.8.tar.gz.
File metadata
- Download URL: custom_permutation-1.0.8.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
339b70e184bbe9e8ce7413502f9a2ed757f988022f746c8fa8b7ce665fb2fef5
|
|
| MD5 |
0ec8f648456fa1f0e3b7b7b25c85023e
|
|
| BLAKE2b-256 |
a402d0a617c2df8e2f10ebe3784903e52a7c1e54e7e39586fa82f9ba81f17769
|
Provenance
The following attestation bundles were made for custom_permutation-1.0.8.tar.gz:
Publisher:
publish-to-pypi.yaml on yilmazhasan/custom_permutation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
custom_permutation-1.0.8.tar.gz -
Subject digest:
339b70e184bbe9e8ce7413502f9a2ed757f988022f746c8fa8b7ce665fb2fef5 - Sigstore transparency entry: 1748152987
- Sigstore integration time:
-
Permalink:
yilmazhasan/custom_permutation@2a82f3a7e9b93f163d1d43b9ee2daf1ea8977d90 -
Branch / Tag:
refs/tags/1.0.8 - Owner: https://github.com/yilmazhasan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@2a82f3a7e9b93f163d1d43b9ee2daf1ea8977d90 -
Trigger Event:
push
-
Statement type:
File details
Details for the file custom_permutation-1.0.8-py3-none-any.whl.
File metadata
- Download URL: custom_permutation-1.0.8-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
974bb79572443bb82e027926edf5947cce6694da434178a122d5b7e8d2b0ed43
|
|
| MD5 |
bcb94289b9acfa4884ba80d32887bcf0
|
|
| BLAKE2b-256 |
ea5b9d437e193511cfa3fb879894cad54274ef769a445c41a69d33fa9b456d9a
|
Provenance
The following attestation bundles were made for custom_permutation-1.0.8-py3-none-any.whl:
Publisher:
publish-to-pypi.yaml on yilmazhasan/custom_permutation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
custom_permutation-1.0.8-py3-none-any.whl -
Subject digest:
974bb79572443bb82e027926edf5947cce6694da434178a122d5b7e8d2b0ed43 - Sigstore transparency entry: 1748153110
- Sigstore integration time:
-
Permalink:
yilmazhasan/custom_permutation@2a82f3a7e9b93f163d1d43b9ee2daf1ea8977d90 -
Branch / Tag:
refs/tags/1.0.8 - Owner: https://github.com/yilmazhasan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@2a82f3a7e9b93f163d1d43b9ee2daf1ea8977d90 -
Trigger Event:
push
-
Statement type: