Custom Combination
Version 0.0.3
Python implementation for Custom Combination.
Usage
Programmatic usage
from custom_combination import CustomCombination
CustomCombination.generate(
items=[("a", 1), ("b", 2), ("c", 3), "d"],
pick=3,
min_picks=[("b", 1)],
max_picks=[("a", 0)])
CLI usage
custom_combination --items "a,b,b,c,c,c,d" -p 3 -minp "b,1" -maxp "a,0"
Output:
['b', 'c', 'd']
['b', 'c', 'c']
Set up locally for development
-
Clone the repository
git clone git@github.com:yilmazhasan/custom_combination.git -
Create and activate the virtural environment
python -m venv .venvsource .venv/bin/activate -
Install requirements:
pip install -r requirements.txt -
Run the app:
python src/custom_combination/cli.py --items a,b,b,c,c,c,d -p 3 -minp b,1 -maxp a,0 -
Test the app:
pytest
Args Explained
--items "a,b,b,c,c,c,d" --pick 3 --min-picks b,1 --max-picks a,0
or shortly:
--items "a,b,b,c,c,c,d" -p 3 -minp b,1 -maxp a,0
This indicates that:
-
We have four items in the set
["a", "b", "c", "d"]but with different frequencies. -
Thus we have the list as
["a", "b", "b", "c", "c", "c", "d"] -
We want to generate combinations that have 3 items, which
-pick 3specifies. -
We want to pick at least:
- 1 occurrences of
"b"
- 1 occurrences of
-
We want to pick at max:
- 0 occurrences of
"a"
- 0 occurrences of
This indicates the list to generate from is:
["b", "b", "c", "c", "c", "d"] out of
["a", "b", "b", "c", "c", "c", "d"] as "a" is excluded.
Since "b" is to be included once, we need to select 2 more items from the list ["c", "c", "c", "d"], so we can select ["c", "c"] or ["c", "d"]
Expected output:
[
["b", "c", "c"],
["b", "c", "d"]
]
Release files for custom-combination 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| custom_combination-0.0.3.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| custom_combination-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / custom_combination-0.0.3.tar.gz
| Download URL | custom_combination-0.0.3.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b5779d87385695c30cf71a0da5ac87af6653019e9f46a855ff837d52efbe0de
|
|
BLAKE2b-256 checksum How to use checksums |
fb329901f9278285416bff7aaa2fa8180d0f5f0c9b2ebd334b4619cf2821aa3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 13, 2026.
Transparency logRelease files / custom_combination-0.0.3-py3-none-any.whl
| Download URL | custom_combination-0.0.3-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
643c0f13e67124467130f094668d7fa5e66e2511519916f6266183b1705df909
|
|
BLAKE2b-256 checksum How to use checksums |
23fbe84fc0f955d3ddbf1de50321a4397dcd4d178d7127bd4ea0f42ce18f6d46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 13, 2026.
Transparency log