LogicChunks


NameLogicChunks JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/LogicChunks
SummaryA Python package to divide lists into groups based on conditions.
upload_time2024-12-17 21:28:26
maintainerNone
docs_urlNone
authorManikanth Madishatti
requires_python>=3.6
licenseMIT
keywords python data structures lists
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LogicChunks

`LogicChunks` is a Python package offering extended functionalities for working with lists, tuples, dictionaries, and sets. It provides a wide range of predefined conditions to categorize data based on user-defined or built-in conditions, making it easier to handle and organize various data types.

## Installation

You can install the package using `pip`:

```bash
pip install LogicChunks



Features:

-->Divide lists into multiple groups based on user-defined or predefined conditions.

Predefined conditions include:

-> Even numbers
-> Odd numbers
-> Prime numbers
-> Perfect square numbers
-> Perfect cube numbers
-> Fibonacci numbers
-> Palindromes
-> Ascending digits
-> And many more...

User-customizable conditions:
->Check if a number is greater than, less than, or equal to a specified number.
->Check if a number is divisible by another number or is a multiple of a given number.
->Check if a number is a power of another number.
->Check if a number is within a specific range.

Usage:
->Divide List into Groups
->You can use the divide_list function to divide your data into different groups based on predefined or custom conditions.


Predefined Conditions:

The following predefined conditions can be used for grouping data:

->is_even(x): Returns True if x is an even number.
->is_odd(x): Returns True if x is an odd number.
->is_prime(x): Returns True if x is a prime number.
->is_perfect_square(x): Returns True if x is a perfect square.
->is_perfect_cube(x): Returns True if x is a perfect cube.
->is_fibonacci(x): Returns True if x is a Fibonacci number.
->is_palindrome(x): Returns True if x is a palindrome (reads the same forward and backward).
->is_ascending_digits(x): Returns True if the digits of x are in ascending order.
->is_zero(x): Returns True if x is equal to zero.
->is_positive(x): Returns True if x is a positive number.
->is_negative(x): Returns True if x is a negative number.
->Custom Conditions

You can also create your own conditions using functions that return a True or False value based on a specific condition. Some examples include:

->is_greater_than(user_number): Returns a function that checks if a number is greater than a user-defined number.
->is_less_than(user_number): Returns a function that checks if a number is less than a user-defined number.
->is_divisible_by(user_number): Returns a function that checks if a number is divisible by a user-defined number.
->is_multiple_of(user_number): Returns a function that checks if a number is a multiple of a user-defined number.
->is_between_range(min_value, max_value): Returns a function that checks if a number is between a given range (inclusive).



This README will be a good starting point for users of the `LogicChunks` package to install, use, and understand its features.


## Sample Usage


from logicchunks.lists import *

# Example list of numbers
numbers = [1, 2, 3, 4, 5, 6, 10,10, 12, 16, 25, 100, 144, 50, 0,121, 0, -5, -10,2901]



# Define the conditions dictionary based on user selections
conditions = {
    "Greater than 10": is_greater_than(10),
    "Divisible by 2": is_divisible_by(2),
    "Multiple of 3": is_multiple_of(3),
    "Power of 2": is_power_of_x(2),
    "Even": is_even,
    "Odd": is_odd,
    "Positive": is_positive,
    "Negative": is_negative,
    "Prime": is_prime,
    "Perfect Square": is_perfect_square,
    "Perfect Cube": is_perfect_cube,
    "Fibonacci": is_fibonacci,
    "Even Length": is_even_length,
    "Odd Length": is_odd_length,
    "Integer": is_integer,
    "Float": is_float,
    "Zero": is_zero,
    "Palindrome": is_palindrome,
    "Ascending Digits": is_ascending_digits,
    "Less than 10": is_less_than(10),
    "Equal to 10": is_equal_to(10),
    "Not Equal to 10": is_not_equal_to(10),
    "Between 5 and 50": is_between_range(5,50),
    "Multiple of 2 or 3": is_multiple_of_any([2,3]),
    "Square Root Integer": is_square_root_integer
}

# Using the divide_list function to divide the numbers into groups based on conditions
grouped_numbers = divide_list(numbers, conditions)

# Print the results
for condition_name, group in grouped_numbers.items():
    print(f"\n{condition_name}:")
    print(group)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/LogicChunks",
    "name": "LogicChunks",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, data structures, lists",
    "author": "Manikanth Madishatti",
    "author_email": "manikanthmadishatti4@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e2/47/13a8b15ca93bc496cccc50b6cf8f8d8c3d7878c31241a83b9cd7536e565f/logicchunks-0.1.0.tar.gz",
    "platform": null,
    "description": "# LogicChunks\r\n\r\n`LogicChunks` is a Python package offering extended functionalities for working with lists, tuples, dictionaries, and sets. It provides a wide range of predefined conditions to categorize data based on user-defined or built-in conditions, making it easier to handle and organize various data types.\r\n\r\n## Installation\r\n\r\nYou can install the package using `pip`:\r\n\r\n```bash\r\npip install LogicChunks\r\n\r\n\r\n\r\nFeatures:\r\n\r\n-->Divide lists into multiple groups based on user-defined or predefined conditions.\r\n\r\nPredefined conditions include:\r\n\r\n-> Even numbers\r\n-> Odd numbers\r\n-> Prime numbers\r\n-> Perfect square numbers\r\n-> Perfect cube numbers\r\n-> Fibonacci numbers\r\n-> Palindromes\r\n-> Ascending digits\r\n-> And many more...\r\n\r\nUser-customizable conditions:\r\n->Check if a number is greater than, less than, or equal to a specified number.\r\n->Check if a number is divisible by another number or is a multiple of a given number.\r\n->Check if a number is a power of another number.\r\n->Check if a number is within a specific range.\r\n\r\nUsage:\r\n->Divide List into Groups\r\n->You can use the divide_list function to divide your data into different groups based on predefined or custom conditions.\r\n\r\n\r\nPredefined Conditions:\r\n\r\nThe following predefined conditions can be used for grouping data:\r\n\r\n->is_even(x): Returns True if x is an even number.\r\n->is_odd(x): Returns True if x is an odd number.\r\n->is_prime(x): Returns True if x is a prime number.\r\n->is_perfect_square(x): Returns True if x is a perfect square.\r\n->is_perfect_cube(x): Returns True if x is a perfect cube.\r\n->is_fibonacci(x): Returns True if x is a Fibonacci number.\r\n->is_palindrome(x): Returns True if x is a palindrome (reads the same forward and backward).\r\n->is_ascending_digits(x): Returns True if the digits of x are in ascending order.\r\n->is_zero(x): Returns True if x is equal to zero.\r\n->is_positive(x): Returns True if x is a positive number.\r\n->is_negative(x): Returns True if x is a negative number.\r\n->Custom Conditions\r\n\r\nYou can also create your own conditions using functions that return a True or False value based on a specific condition. Some examples include:\r\n\r\n->is_greater_than(user_number): Returns a function that checks if a number is greater than a user-defined number.\r\n->is_less_than(user_number): Returns a function that checks if a number is less than a user-defined number.\r\n->is_divisible_by(user_number): Returns a function that checks if a number is divisible by a user-defined number.\r\n->is_multiple_of(user_number): Returns a function that checks if a number is a multiple of a user-defined number.\r\n->is_between_range(min_value, max_value): Returns a function that checks if a number is between a given range (inclusive).\r\n\r\n\r\n\r\nThis README will be a good starting point for users of the `LogicChunks` package to install, use, and understand its features.\r\n\r\n\r\n## Sample Usage\r\n\r\n\r\nfrom logicchunks.lists import *\r\n\r\n# Example list of numbers\r\nnumbers = [1, 2, 3, 4, 5, 6, 10,10, 12, 16, 25, 100, 144, 50, 0,121, 0, -5, -10,2901]\r\n\r\n\r\n\r\n# Define the conditions dictionary based on user selections\r\nconditions = {\r\n    \"Greater than 10\": is_greater_than(10),\r\n    \"Divisible by 2\": is_divisible_by(2),\r\n    \"Multiple of 3\": is_multiple_of(3),\r\n    \"Power of 2\": is_power_of_x(2),\r\n    \"Even\": is_even,\r\n    \"Odd\": is_odd,\r\n    \"Positive\": is_positive,\r\n    \"Negative\": is_negative,\r\n    \"Prime\": is_prime,\r\n    \"Perfect Square\": is_perfect_square,\r\n    \"Perfect Cube\": is_perfect_cube,\r\n    \"Fibonacci\": is_fibonacci,\r\n    \"Even Length\": is_even_length,\r\n    \"Odd Length\": is_odd_length,\r\n    \"Integer\": is_integer,\r\n    \"Float\": is_float,\r\n    \"Zero\": is_zero,\r\n    \"Palindrome\": is_palindrome,\r\n    \"Ascending Digits\": is_ascending_digits,\r\n    \"Less than 10\": is_less_than(10),\r\n    \"Equal to 10\": is_equal_to(10),\r\n    \"Not Equal to 10\": is_not_equal_to(10),\r\n    \"Between 5 and 50\": is_between_range(5,50),\r\n    \"Multiple of 2 or 3\": is_multiple_of_any([2,3]),\r\n    \"Square Root Integer\": is_square_root_integer\r\n}\r\n\r\n# Using the divide_list function to divide the numbers into groups based on conditions\r\ngrouped_numbers = divide_list(numbers, conditions)\r\n\r\n# Print the results\r\nfor condition_name, group in grouped_numbers.items():\r\n    print(f\"\\n{condition_name}:\")\r\n    print(group)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package to divide lists into groups based on conditions.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/LogicChunks"
    },
    "split_keywords": [
        "python",
        " data structures",
        " lists"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9c87f06226237c509655ffbd8745b1ce37b078e3f6f41f5e5d06976f000a476",
                "md5": "d2a8b171429b39702aadcfc9b89453c0",
                "sha256": "0649812de90105afccf98d34556e3a4b6e719ba9f680d6e37b34ac34e669528b"
            },
            "downloads": -1,
            "filename": "LogicChunks-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2a8b171429b39702aadcfc9b89453c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7358,
            "upload_time": "2024-12-17T21:28:25",
            "upload_time_iso_8601": "2024-12-17T21:28:25.329771Z",
            "url": "https://files.pythonhosted.org/packages/c9/c8/7f06226237c509655ffbd8745b1ce37b078e3f6f41f5e5d06976f000a476/LogicChunks-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e24713a8b15ca93bc496cccc50b6cf8f8d8c3d7878c31241a83b9cd7536e565f",
                "md5": "23b608ad672722f4941b605ee144f9f6",
                "sha256": "98929419779a4185a6b6e55c54d1dae9708911c00c35b6ca786162d9204e52f4"
            },
            "downloads": -1,
            "filename": "logicchunks-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "23b608ad672722f4941b605ee144f9f6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6587,
            "upload_time": "2024-12-17T21:28:26",
            "upload_time_iso_8601": "2024-12-17T21:28:26.674031Z",
            "url": "https://files.pythonhosted.org/packages/e2/47/13a8b15ca93bc496cccc50b6cf8f8d8c3d7878c31241a83b9cd7536e565f/logicchunks-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-17 21:28:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "LogicChunks",
    "github_not_found": true,
    "lcname": "logicchunks"
}
        
Elapsed time: 0.41432s