pcomp


Namepcomp JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://github.com/AntonisPilo/pcomp
SummaryPossible permutations with repetition - Python Library
upload_time2024-03-18 23:31:23
maintainer
docs_urlNone
authorAntonis Piloridis
requires_python>=3.3
licenseMIT
keywords permutations permutations with repetition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pcomp-1.3.2:

A simple library that calculates all possible permutations (with repetition) from an iterator and a length.

Functions:

area:


Calculate the area for permutation computation.


Parameters:

    iterable (Iterable): The iterable object.

    length (int): The length for permutation computation.


Returns:

    int: The area for permutation computation.


pc:


Generate permutations of given iterable with specified length.


Parameters:

    iterable (Iterable): The iterable object.

    length (int): The length for permutation computation.


Returns:

    list: List of permutations of the given iterable with the specified length.


Example(hex to binnary):

Code:

import pcomp

print("Area:", pcomp.area(range(2), 4))  # it returns: 16

print("Permutations with repetition:", pcomp.pc(range(2), 4))  # it returns: [[0, 0, 0, 0], [0, 0, 0, 1], ..., [1, 1, 1, 1]]


The area function returns the total number of possible permutations with repetition.

And the pcomp function returns a list where each sublist represents one permutation.

Change Log
==========

1.3.2 (18/3/2024)
-----------------
- typo

1.3.1 (18/3/2024)
-----------------
- typo

1.3 (18/3/2024)
-----------------
- Improved code readability and readme

1.2.1 (28/11/2022)
-----------------
- typo

1.2 (28/11/2022)
-----------------
- Added error exception for invaide arguments

1.1.1 (22/8/2022)
-----------------
- combinations --> permutations with repetition (word replacement due to typo) 
(I might add combinations in the future + repetition True-False) (The package name will remain the same)

- Version 1.0.2 in the changelog was 2 times (typo)

1.1.0 (19/8/2022)
-----------------
- New return form
- The all function has been renamed to pc
- Better file organization and function syntax

1.0.2 (10/7/2022)
-----------------
- Added github

1.0.1 (10/7/2022)
-----------------
- Fixed a problem

1.0.0 (10/7/2022)
-----------------
- First Release


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AntonisPilo/pcomp",
    "name": "pcomp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.3",
    "maintainer_email": "",
    "keywords": "permutations,permutations with repetition",
    "author": "Antonis Piloridis",
    "author_email": "antonispiloridis@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1f/ba/8aeafb36a3a57bceada7260f285b2413dba21cdce69273b09f368a525214/pcomp-1.3.2.tar.gz",
    "platform": null,
    "description": "pcomp-1.3.2:\n\nA simple library that calculates all possible permutations (with repetition) from an iterator and a length.\n\nFunctions:\n\narea:\n\n\nCalculate the area for permutation computation.\n\n\nParameters:\n\n    iterable (Iterable): The iterable object.\n\n    length (int): The length for permutation computation.\n\n\nReturns:\n\n    int: The area for permutation computation.\n\n\npc:\n\n\nGenerate permutations of given iterable with specified length.\n\n\nParameters:\n\n    iterable (Iterable): The iterable object.\n\n    length (int): The length for permutation computation.\n\n\nReturns:\n\n    list: List of permutations of the given iterable with the specified length.\n\n\nExample(hex to binnary):\n\nCode:\n\nimport pcomp\n\nprint(\"Area:\", pcomp.area(range(2), 4))  # it returns: 16\n\nprint(\"Permutations with repetition:\", pcomp.pc(range(2), 4))  # it returns: [[0, 0, 0, 0], [0, 0, 0, 1], ..., [1, 1, 1, 1]]\n\n\nThe area function returns the total number of possible permutations with repetition.\n\nAnd the pcomp function returns a list where each sublist represents one permutation.\n\nChange Log\n==========\n\n1.3.2 (18/3/2024)\n-----------------\n- typo\n\n1.3.1 (18/3/2024)\n-----------------\n- typo\n\n1.3 (18/3/2024)\n-----------------\n- Improved code readability and readme\n\n1.2.1 (28/11/2022)\n-----------------\n- typo\n\n1.2 (28/11/2022)\n-----------------\n- Added error exception for invaide arguments\n\n1.1.1 (22/8/2022)\n-----------------\n- combinations --> permutations with repetition (word replacement due to typo) \n(I might add combinations in the future + repetition True-False) (The package name will remain the same)\n\n- Version 1.0.2 in the changelog was 2 times (typo)\n\n1.1.0 (19/8/2022)\n-----------------\n- New return form\n- The all function has been renamed to pc\n- Better file organization and function syntax\n\n1.0.2 (10/7/2022)\n-----------------\n- Added github\n\n1.0.1 (10/7/2022)\n-----------------\n- Fixed a problem\n\n1.0.0 (10/7/2022)\n-----------------\n- First Release\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Possible permutations with repetition - Python Library",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://github.com/AntonisPilo/pcomp"
    },
    "split_keywords": [
        "permutations",
        "permutations with repetition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d47e528ff78e352abf12a63c2193da97cb0e68cfa502dd058043f307edf4f735",
                "md5": "f77c4884bfb961802dc1a18e6f08e7c4",
                "sha256": "7de060aa823d907c739f5f4de7deee85628f43e63f203edf2d93f7d9589becdb"
            },
            "downloads": -1,
            "filename": "pcomp-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f77c4884bfb961802dc1a18e6f08e7c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.3",
            "size": 3760,
            "upload_time": "2024-03-18T23:31:21",
            "upload_time_iso_8601": "2024-03-18T23:31:21.879157Z",
            "url": "https://files.pythonhosted.org/packages/d4/7e/528ff78e352abf12a63c2193da97cb0e68cfa502dd058043f307edf4f735/pcomp-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1fba8aeafb36a3a57bceada7260f285b2413dba21cdce69273b09f368a525214",
                "md5": "440ed1aa92212103f7b2a72bf77e5c61",
                "sha256": "2eef5f4d42b9552b7b661b6c386db82aebc9eac4ff518ce49490c2eb1a7acfa4"
            },
            "downloads": -1,
            "filename": "pcomp-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "440ed1aa92212103f7b2a72bf77e5c61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.3",
            "size": 3762,
            "upload_time": "2024-03-18T23:31:23",
            "upload_time_iso_8601": "2024-03-18T23:31:23.072841Z",
            "url": "https://files.pythonhosted.org/packages/1f/ba/8aeafb36a3a57bceada7260f285b2413dba21cdce69273b09f368a525214/pcomp-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 23:31:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AntonisPilo",
    "github_project": "pcomp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pcomp"
}
        
Elapsed time: 0.31689s