Skip to main content

Dowell Permutation API Python Libray

Project description

DoWell-Permutation Python Library

Welcome to the Permutation API! The Permutation API is a comprehensive tool that enables users to generate permutations of a set of items efficiently. It provides a reliable and high-performance solution for permutation calculations, making it ideal for a wide range of applications such as combinatorial optimization, data analysis, and algorithm design.

Installation

  1. Installing the library
    pip install dowell-permutation
    
  2. Create an instance of the API
    from permutation import Permutation
    perm = Pemutation()
    

Features

The Permutation API offers the following key features:

  • Total Number of Permutations Possible : this feature calculates the precise count of all the potential permutations based on the provided values of 'n' and 'r'.
  • Exact Permutations : this feature allows users to find the precise permutations for any given range of 'n' and 'r'. This feature utilizes a specially designed algorithm that ensures accurate and efficient permutation generation.

Note : 'n' is total number of items present and 'r' is the total number of items to be selected from 'r'.

The library offers three main methods through the instance

  1. Find permuation
    perm.find(n, r, next_variable)
    
    """
        Generates permutations based on the given parameters. It sends a JSON payload using the provided params
        :param n: The total number of elements available for permutation
        :param r: The number of elements to be selected in each permutation
        :param next_variable: The next variable to be included in the permutation
        :return: response returns the generated permutation in JSON format. The response body contains the following information:
        eventId: An event ID associated with the permutation.
        n: The total number of elements available for permutation.
        r: The number of elements selected in each permutation.
        numberOfPermutations: The total number of possible permutations.
        permutationVariables: An array of arrays, where each inner array represents a permutation with the selected variables.
        inserted_id: The ID of the inserted permutation.
    """
    
  2. Save Permutation
    perm.save(inserted_id, selected_permutations)
    
    """
        Saves a selected permutation. It sends a JSON payload with the parameters provided
        :param id: The ID of the permutation to be saved
        :param selected_permutation: An array of variables representing the selected permutation
        :return: The response confirms the successful saving of the permutation. The response body contains a success message.
    """
    
  3. Show Permutaion
    perm.retrieve(id)
    
    """
        Retrieves a specific permutation based on its ID
        :param id:
        :return: the requested permutation in JSON format. The response body contains the following information:
        eventId: An event ID associated with the permutation.
        n: The total number of elements available for permutation.
        r: The number of elements selected in each permutation.
        permutationVariables: An array representing the selected permutation.
        inserted_id: The ID of the permutation.
    """
    

More about the API

To get started with the Permutation API, follow these steps:

  1. Review the API Documentation to understand the available endpoints, request parameters, and response formats.

  2. Make API requests to calculate the total number of permutations possible and to find the exact permutations by providing the 'n' , 'r' , and the exact values for each item.

  3. Analyze the returned results, including the number of permutations and the final permutation.

  4. Detailed Library Documentation

Example

Here is an example of how you can use the Permutation Library:

  1. Imagine you have a set of 5 letters: A, B, C, D, and E. You want to generate all possible permutations of these letters by selecting letters. You can use the Permutations API and provide 'n' as 5 and 'r' as 3 and the letter with which you want start calculating the permutations.
    my_permutation = perm.find(5,3,'A')
    
  2. Once the request is made, the API will process the data and return a response in JSON format. The response will include the total number of possible permutations, along with the generated permutations.
    {"eventId": "FB1010000000000000000000003004", 
    "n": 5, 
    "r": 3, 
    "numberOfPermutations": 60, 
    "permutationsVariables": ["A"], 
    "inserted_id": "648963a70d4d6ccff1a7b4a0"}
    
  3. You will now need to select one permuation from the generated permutations and call the API again by providing the next letter that you want to include in the permutation.
  4. Repeat the steps until the 3 letters are selected and permutation for 3 letters is generated.

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

dowell-permutation-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

dowell_permutation-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dowell-permutation-0.1.1.tar.gz.

File metadata

  • Download URL: dowell-permutation-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for dowell-permutation-0.1.1.tar.gz
Algorithm Hash digest
SHA256 493c1feb64cd34535816727e00eed57ea241a740226bb65a4406cc94430a336d
MD5 c8a7288418cd1bf3ee5357dd60c08ffb
BLAKE2b-256 a9c900a134f01d9dffab435a4bb1a1cbf037b349fa513b5d9d7cfea17d104d2d

See more details on using hashes here.

File details

Details for the file dowell_permutation-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dowell_permutation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecece34e325992ffc57442371443a94fe95cb9417bdeac973f53c231c11f7898
MD5 833b49f4a498453bdf072d01352dd581
BLAKE2b-256 d604e9140ee8393fa6d46305b5fe4bdf0bb6e63b0bb2f974b9dc86dd2395dcf4

See more details on using hashes here.

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